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/abi-gen-templates/partials/callAsync.handlebars | |
parent | 7991de9ed0b5f1e8a38097d902eae09cc6b5cf11 (diff) | |
download | dexon-sol-tools-b06f8239e1fe75703f88d34c0d225701406e28c2.tar dexon-sol-tools-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.gz dexon-sol-tools-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.bz2 dexon-sol-tools-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.lz dexon-sol-tools-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.xz dexon-sol-tools-b06f8239e1fe75703f88d34c0d225701406e28c2.tar.zst dexon-sol-tools-b06f8239e1fe75703f88d34c0d225701406e28c2.zip |
Finished porting new abi encoder to contracts
Diffstat (limited to 'packages/abi-gen-templates/partials/callAsync.handlebars')
-rw-r--r-- | packages/abi-gen-templates/partials/callAsync.handlebars | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/abi-gen-templates/partials/callAsync.handlebars b/packages/abi-gen-templates/partials/callAsync.handlebars index d4fb772c7..e978f577d 100644 --- a/packages/abi-gen-templates/partials/callAsync.handlebars +++ b/packages/abi-gen-templates/partials/callAsync.handlebars @@ -4,9 +4,7 @@ async callAsync( defaultBlock?: BlockParam, ): Promise<{{> return_type outputs=outputs}}> { const self = this as any as {{contractName}}Contract; - const functionSignature = '{{this.functionSignature}}'; - const abiEncoder = self._lookupAbiEncoder(functionSignature); - const encodedData = abiEncoder.encode([{{> params inputs=inputs}}]); + const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]); const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync( { to: self.address, @@ -17,6 +15,7 @@ async callAsync( ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); + const abiEncoder = self._lookupAbiEncoder('{{this.functionSignature}}'); let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult); return resultArray{{#singleReturnValue}}[0]{{/singleReturnValue}}; }, |