diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-09-27 17:21:47 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-09-27 17:21:47 +0800 |
commit | 60971be35af8c64e70589c0ae3bdd5739c2ceb46 (patch) | |
tree | f219d944a94b4d5468c038633563072d48f95579 | |
parent | cb99ebf78aad869e61ec2ca7c48bb25178274ec5 (diff) | |
download | dexon-sol-tools-60971be35af8c64e70589c0ae3bdd5739c2ceb46.tar dexon-sol-tools-60971be35af8c64e70589c0ae3bdd5739c2ceb46.tar.gz dexon-sol-tools-60971be35af8c64e70589c0ae3bdd5739c2ceb46.tar.bz2 dexon-sol-tools-60971be35af8c64e70589c0ae3bdd5739c2ceb46.tar.lz dexon-sol-tools-60971be35af8c64e70589c0ae3bdd5739c2ceb46.tar.xz dexon-sol-tools-60971be35af8c64e70589c0ae3bdd5739c2ceb46.tar.zst dexon-sol-tools-60971be35af8c64e70589c0ae3bdd5739c2ceb46.zip |
Throw revert reasons from contract wrappers
-rw-r--r-- | packages/contract_templates/partials/callAsync.handlebars | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/packages/contract_templates/partials/callAsync.handlebars b/packages/contract_templates/partials/callAsync.handlebars index dd1b90212..ddbbe7508 100644 --- a/packages/contract_templates/partials/callAsync.handlebars +++ b/packages/contract_templates/partials/callAsync.handlebars @@ -19,6 +19,7 @@ async callAsync( self._web3Wrapper.getContractDefaults(), ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); + BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); let resultArray = ethersFunction.decode(rawCallResult); const outputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).outputs; resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); |