From 60971be35af8c64e70589c0ae3bdd5739c2ceb46 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 27 Sep 2018 11:21:47 +0200 Subject: Throw revert reasons from contract wrappers --- packages/contract_templates/partials/callAsync.handlebars | 1 + 1 file changed, 1 insertion(+) (limited to 'packages') 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)); -- cgit v1.2.3