aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/test/abi_encoder_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/order-utils/test/abi_encoder_test.ts')
-rw-r--r--packages/order-utils/test/abi_encoder_test.ts30
1 files changed, 29 insertions, 1 deletions
diff --git a/packages/order-utils/test/abi_encoder_test.ts b/packages/order-utils/test/abi_encoder_test.ts
index f9e28015b..fb149faa1 100644
--- a/packages/order-utils/test/abi_encoder_test.ts
+++ b/packages/order-utils/test/abi_encoder_test.ts
@@ -833,7 +833,7 @@ describe.only('ABI Encoder', () => {
});
});
- describe.only('Integer', () => {
+ describe('Integer', () => {
const testIntDataItem = { name: 'testInt', type: 'int' };
it('Positive - Base case', async () => {
const intDataType = new AbiEncoder.Int(testIntDataItem);
@@ -862,6 +862,34 @@ describe.only('ABI Encoder', () => {
const expectedAbiEncodedInt = '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5e7409f';
expect(intDataType.getHexValue()).to.be.equal(expectedAbiEncodedInt);
});
+
+ // TODO: Add bounds tests + tests for different widths
+ });
+
+ describe('Unsigned Integer', () => {
+ const testIntDataItem = { name: 'testUInt', type: 'uint' };
+ it('Lower Bound', async () => {
+ const uintDataType = new AbiEncoder.UInt(testIntDataItem);
+ uintDataType.assignValue(new BigNumber(0));
+ const expectedAbiEncodedUInt = '0x0000000000000000000000000000000000000000000000000000000000000000';
+ expect(uintDataType.getHexValue()).to.be.equal(expectedAbiEncodedUInt);
+ });
+
+ it('Base Case', async () => {
+ const uintDataType = new AbiEncoder.UInt(testIntDataItem);
+ uintDataType.assignValue(new BigNumber(1));
+ const expectedAbiEncodedUInt = '0x0000000000000000000000000000000000000000000000000000000000000001';
+ expect(uintDataType.getHexValue()).to.be.equal(expectedAbiEncodedUInt);
+ });
+
+ it('Random value', async () => {
+ const uintDataType = new AbiEncoder.UInt(testIntDataItem);
+ uintDataType.assignValue(new BigNumber(437829473));
+ const expectedAbiEncodedUInt = '0x000000000000000000000000000000000000000000000000000000001a18bf61';
+ expect(uintDataType.getHexValue()).to.be.equal(expectedAbiEncodedUInt);
+ });
+
+ // TODO: Add bounds tests + tests for different widths
});
describe('String', () => {