aboutsummaryrefslogtreecommitdiffstats
path: root/packages/abi-gen-templates
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-12-19 13:44:26 +0800
committerGreg Hysen <greg.hysen@gmail.com>2019-01-15 02:49:29 +0800
commit2f1454e90e5fd7d85c4deb3a8c674043e8a14564 (patch)
tree65ce021b55cf9e384e808bba94b2979d9c73f170 /packages/abi-gen-templates
parentb89f9869492e369370bcef593d69e59172f13da4 (diff)
downloaddexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar
dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.gz
dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.bz2
dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.lz
dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.xz
dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.zst
dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.zip
Working for almost every test
Diffstat (limited to 'packages/abi-gen-templates')
-rw-r--r--packages/abi-gen-templates/partials/callAsync.handlebars10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/abi-gen-templates/partials/callAsync.handlebars b/packages/abi-gen-templates/partials/callAsync.handlebars
index 0fe8b0463..5b56be52e 100644
--- a/packages/abi-gen-templates/partials/callAsync.handlebars
+++ b/packages/abi-gen-templates/partials/callAsync.handlebars
@@ -19,10 +19,10 @@ async callAsync(
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- const decodingRules = {structsAsObjects: false};
- let resultArray = abiEncoder.decodeReturnValues(rawCallResult, decodingRules);
- const outputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
+ {{#if hasReturnValue}}
+ let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true});
return resultArray{{#singleReturnValue}}[0]{{/singleReturnValue}};
+ {{else}}
+ return;
+ {{/if}}
},