aboutsummaryrefslogtreecommitdiffstats
path: root/packages/abi-gen-templates/partials/callAsync.handlebars
diff options
context:
space:
mode:
Diffstat (limited to 'packages/abi-gen-templates/partials/callAsync.handlebars')
-rw-r--r--packages/abi-gen-templates/partials/callAsync.handlebars5
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}};
},