diff options
author | Greg Hysen <hysz@users.noreply.github.com> | 2019-01-15 03:48:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-15 03:48:17 +0800 |
commit | 1c25d8e997456c248470d925cf6702e46d959a62 (patch) | |
tree | 4e2c77924445247b2916d7713e058ba3466b70a5 /packages/utils/test/abi_encoder/return_values_test.ts | |
parent | fc89b97818eda9c7447273b5728c1ba8fbb5cdf5 (diff) | |
parent | b0817854e81512ad95cca4d842a671304ae3b94a (diff) | |
download | dexon-0x-contracts-1c25d8e997456c248470d925cf6702e46d959a62.tar dexon-0x-contracts-1c25d8e997456c248470d925cf6702e46d959a62.tar.gz dexon-0x-contracts-1c25d8e997456c248470d925cf6702e46d959a62.tar.bz2 dexon-0x-contracts-1c25d8e997456c248470d925cf6702e46d959a62.tar.lz dexon-0x-contracts-1c25d8e997456c248470d925cf6702e46d959a62.tar.xz dexon-0x-contracts-1c25d8e997456c248470d925cf6702e46d959a62.tar.zst dexon-0x-contracts-1c25d8e997456c248470d925cf6702e46d959a62.zip |
Merge pull request #1475 from 0xProject/feature/monorepo/useNewAbiEncoder
Use Compressed Calldata in Contract Wrappers
Diffstat (limited to 'packages/utils/test/abi_encoder/return_values_test.ts')
-rw-r--r-- | packages/utils/test/abi_encoder/return_values_test.ts | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/packages/utils/test/abi_encoder/return_values_test.ts b/packages/utils/test/abi_encoder/return_values_test.ts index 104c7f5db..308d11ee5 100644 --- a/packages/utils/test/abi_encoder/return_values_test.ts +++ b/packages/utils/test/abi_encoder/return_values_test.ts @@ -15,7 +15,7 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { // Decode return value const method = new AbiEncoder.Method(ReturnValueAbis.noReturnValues); const returnValue = '0x'; - const decodedReturnValue = method.decodeReturnValues(returnValue); + const decodedReturnValue = method.decodeReturnValues(returnValue, { shouldConvertStructsToObjects: false }); const expectedDecodedReturnValue: any[] = []; expect(decodedReturnValue).to.be.deep.equal(expectedDecodedReturnValue); }); @@ -24,7 +24,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.singleStaticReturnValue); const returnValue = ['0x01020304']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); @@ -33,7 +35,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.multipleStaticReturnValues); const returnValue = ['0x01020304', '0x05060708']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); @@ -42,7 +46,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.singleDynamicReturnValue); const returnValue = ['0x01020304']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); @@ -51,7 +57,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.multipleDynamicReturnValues); const returnValue = ['0x01020304', '0x05060708']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); @@ -60,7 +68,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.mixedStaticAndDynamicReturnValues); const returnValue = ['0x01020304', '0x05060708']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); |