diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-12-23 09:23:02 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-01-15 02:49:44 +0800 |
commit | b06f8239e1fe75703f88d34c0d225701406e28c2 (patch) | |
tree | 9beb83b64b37fb6ad67d066f089b868a8ad25fcb /packages/utils/src/abi_encoder/evm_data_types | |
parent | 7991de9ed0b5f1e8a38097d902eae09cc6b5cf11 (diff) | |
download | dexon-0x-contracts-b06f8239e1fe75703f88d34c0d225701406e28c2.tar dexon-0x-contracts-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.gz dexon-0x-contracts-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.bz2 dexon-0x-contracts-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.lz dexon-0x-contracts-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.xz dexon-0x-contracts-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.zst dexon-0x-contracts-b06f8239e1fe75703f88d34c0d225701406e28c2.zip |
Finished porting new abi encoder to contracts
Diffstat (limited to 'packages/utils/src/abi_encoder/evm_data_types')
-rw-r--r-- | packages/utils/src/abi_encoder/evm_data_types/method.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/utils/src/abi_encoder/evm_data_types/method.ts b/packages/utils/src/abi_encoder/evm_data_types/method.ts index 44456cd0a..212e2ca6b 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/method.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/method.ts @@ -35,6 +35,12 @@ export class MethodDataType extends AbstractSetDataType { return value; } + public decodeAsArray(returndata: string, rules?: DecodingRules): any { + const value = this.decode(returndata, rules); + const valuesAsArray = _.isObject(value) ? _.values(value) : [value]; + return valuesAsArray; + } + public encodeReturnValues(value: any, rules?: EncodingRules): string { const returnData = this._returnDataType.encode(value, rules); return returnData; |