diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-09 05:57:36 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:10 +0800 |
commit | 8b91727364c205cd2bd44abdabd62c1044dd13d4 (patch) | |
tree | 92bdaa2550955b4e81daa75f600561dd5d4a474c /packages/order-utils/test/abi_encoder_test.ts | |
parent | 8f61f6d0f9532e95fd32cbab8dd0344b42de2da7 (diff) | |
download | dexon-sol-tools-8b91727364c205cd2bd44abdabd62c1044dd13d4.tar dexon-sol-tools-8b91727364c205cd2bd44abdabd62c1044dd13d4.tar.gz dexon-sol-tools-8b91727364c205cd2bd44abdabd62c1044dd13d4.tar.bz2 dexon-sol-tools-8b91727364c205cd2bd44abdabd62c1044dd13d4.tar.lz dexon-sol-tools-8b91727364c205cd2bd44abdabd62c1044dd13d4.tar.xz dexon-sol-tools-8b91727364c205cd2bd44abdabd62c1044dd13d4.tar.zst dexon-sol-tools-8b91727364c205cd2bd44abdabd62c1044dd13d4.zip |
types with default widths
Diffstat (limited to 'packages/order-utils/test/abi_encoder_test.ts')
-rw-r--r-- | packages/order-utils/test/abi_encoder_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/order-utils/test/abi_encoder_test.ts b/packages/order-utils/test/abi_encoder_test.ts index cea33112d..ad43e70a3 100644 --- a/packages/order-utils/test/abi_encoder_test.ts +++ b/packages/order-utils/test/abi_encoder_test.ts @@ -134,6 +134,18 @@ describe.only('ABI Encoder', () => { expect(calldata).to.be.equal(expectedCalldata);*/ }); + it.only('Types with default widths', async () => { + const method = new AbiEncoder.Method(AbiSamples.typesWithDefaultWidthsAbi); + const args = [new BigNumber(1), new BigNumber(-1), '0x56', [new BigNumber(1)], [new BigNumber(-1)], ['0x56']]; + const calldata = method.encode(args); + console.log(calldata); + console.log('*'.repeat(40)); + console.log(method.getSignature()); + console.log(JSON.stringify(args)); + const expectedCalldata = '0x09f2b0c30000000000000000000000000000000000000000000000000000000000000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff560000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000015600000000000000000000000000000000000000000000000000000000000000'; + expect(calldata).to.be.equal(expectedCalldata); + }); + it('Array of Static Tuples (Array has defined length)', async () => { const method = new AbiEncoder.Method(AbiSamples.arrayOfStaticTuplesWithDefinedLengthAbi); |