From ef40cb96876cb77e897be441ceff1ca1521dc682 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 26 Feb 2018 17:04:19 -0800 Subject: Add txData to async calls --- packages/contract_templates/partials/callAsync.handlebars | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/contract_templates') diff --git a/packages/contract_templates/partials/callAsync.handlebars b/packages/contract_templates/partials/callAsync.handlebars index 88cc49ffa..93d347145 100644 --- a/packages/contract_templates/partials/callAsync.handlebars +++ b/packages/contract_templates/partials/callAsync.handlebars @@ -7,6 +7,7 @@ async callAsync( {{^this.payable}} txData: TxData = {}, {{/this.payable}} + defaultBlock?: Web3.BlockParam, ): Promise<{{> return_type outputs=outputs}}> { const self = this as {{contractName}}Contract; const inputAbi = _.find(this.abi, {name: '{{this.name}}'}).inputs; @@ -19,7 +20,7 @@ async callAsync( data: encodedData, } ) - const rawCallResult = await self._web3Wrapper.callAsync(callData); + const rawCallResult = await self._web3Wrapper.callAsync(callData, defaultBlock); const outputAbi = _.find(this.abi, {name: '{{this.name}}'}).outputs as Web3.DataItem[]; const outputParamsTypes = _.map(outputAbi, 'type'); let resultArray = ethersContracts.Interface.decodeParams(outputParamsTypes, rawCallResult) as any; -- cgit v1.2.3