diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-07-27 05:11:03 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-08-09 05:27:30 +0800 |
commit | 6a5965d73bb542634631d7af76c150795d899744 (patch) | |
tree | aba6597779094b9738c0ad94fb2694a18d22cdc2 /packages/contract_templates/partials | |
parent | 19cda0eb036b6876964d8074aea1295142d25027 (diff) | |
download | dexon-sol-tools-6a5965d73bb542634631d7af76c150795d899744.tar dexon-sol-tools-6a5965d73bb542634631d7af76c150795d899744.tar.gz dexon-sol-tools-6a5965d73bb542634631d7af76c150795d899744.tar.bz2 dexon-sol-tools-6a5965d73bb542634631d7af76c150795d899744.tar.lz dexon-sol-tools-6a5965d73bb542634631d7af76c150795d899744.tar.xz dexon-sol-tools-6a5965d73bb542634631d7af76c150795d899744.tar.zst dexon-sol-tools-6a5965d73bb542634631d7af76c150795d899744.zip |
Add strictArgumentEncodingCheck to BaseContract and use it in contract templates
Diffstat (limited to 'packages/contract_templates/partials')
-rw-r--r-- | packages/contract_templates/partials/callAsync.handlebars | 1 | ||||
-rw-r--r-- | packages/contract_templates/partials/tx.handlebars | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/packages/contract_templates/partials/callAsync.handlebars b/packages/contract_templates/partials/callAsync.handlebars index fcaae57c6..94752691d 100644 --- a/packages/contract_templates/partials/callAsync.handlebars +++ b/packages/contract_templates/partials/callAsync.handlebars @@ -7,6 +7,7 @@ async callAsync( const functionSignature = '{{this.functionSignature}}'; const inputAbi = self._lookupAbi(functionSignature).inputs; [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); + BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]); const ethersFunction = self._lookupEthersInterface(functionSignature).functions.{{this.name}}( {{> params inputs=inputs}} ) as ethers.CallDescription; diff --git a/packages/contract_templates/partials/tx.handlebars b/packages/contract_templates/partials/tx.handlebars index e297d05e6..4340d662e 100644 --- a/packages/contract_templates/partials/tx.handlebars +++ b/packages/contract_templates/partials/tx.handlebars @@ -11,6 +11,7 @@ public {{this.tsName}} = { const self = this as any as {{contractName}}Contract; const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs; [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); + BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]); const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}( {{> params inputs=inputs}} ).data; |