diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-12-19 14:01:48 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-01-15 02:49:44 +0800 |
commit | e4551c8f6037302124cae4cda51b8f7624ade687 (patch) | |
tree | 7878caf2441e72bd5e8147db44bc0d3426407e34 /packages/abi-gen-templates | |
parent | 2f1454e90e5fd7d85c4deb3a8c674043e8a14564 (diff) | |
download | dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.gz dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.bz2 dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.lz dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.xz dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.zst dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.zip |
Works for almost all tests
Diffstat (limited to 'packages/abi-gen-templates')
-rw-r--r-- | packages/abi-gen-templates/partials/callAsync.handlebars | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/packages/abi-gen-templates/partials/callAsync.handlebars b/packages/abi-gen-templates/partials/callAsync.handlebars index 5b56be52e..d4fb772c7 100644 --- a/packages/abi-gen-templates/partials/callAsync.handlebars +++ b/packages/abi-gen-templates/partials/callAsync.handlebars @@ -5,8 +5,6 @@ async callAsync( ): Promise<{{> return_type outputs=outputs}}> { const self = this as any as {{contractName}}Contract; const functionSignature = '{{this.functionSignature}}'; - const inputAbi = self._lookupAbi(functionSignature).inputs; - [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); const abiEncoder = self._lookupAbiEncoder(functionSignature); const encodedData = abiEncoder.encode([{{> params inputs=inputs}}]); const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync( @@ -19,10 +17,6 @@ async callAsync( ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - {{#if hasReturnValue}} - let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); + let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult); return resultArray{{#singleReturnValue}}[0]{{/singleReturnValue}}; - {{else}} - return; - {{/if}} }, |