From f2f9bd2e7ac1372073644a4e30a5d99e8c57fbb1 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 10 Apr 2018 13:44:15 +0200 Subject: Revert "Merge pull request #493 from hysz/features/deployer/multipleCodebaseSupport" This reverts commit 70d403e6f8c56bc70e6d3471a770b9bbff5d72e7, reversing changes made to 073bf738ddb271b6b4158798baf4cac3cb0608e9. --- .../partials/callAsync.handlebars | 4 ++-- packages/contract_templates/partials/tx.handlebars | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'packages/contract_templates/partials') diff --git a/packages/contract_templates/partials/callAsync.handlebars b/packages/contract_templates/partials/callAsync.handlebars index a6f4abdf2..8de69203e 100644 --- a/packages/contract_templates/partials/callAsync.handlebars +++ b/packages/contract_templates/partials/callAsync.handlebars @@ -5,9 +5,9 @@ async callAsync( defaultBlock?: BlockParam, ): Promise<{{> return_type outputs=outputs}}> { const self = this as any as {{contractName}}Contract; - const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs; + const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs; [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); - const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}( + const encodedData = self._ethersInterface.functions.{{this.name}}( {{> params inputs=inputs}} ).data; const callDataWithDefaults = await self._applyDefaultsToTxDataAsync( diff --git a/packages/contract_templates/partials/tx.handlebars b/packages/contract_templates/partials/tx.handlebars index 22fe0c597..41ba6d3f7 100644 --- a/packages/contract_templates/partials/tx.handlebars +++ b/packages/contract_templates/partials/tx.handlebars @@ -1,4 +1,4 @@ -public {{this.tsName}} = { +public {{this.name}} = { async sendTransactionAsync( {{> typed_params inputs=inputs}} {{#this.payable}} @@ -9,17 +9,17 @@ public {{this.tsName}} = { {{/this.payable}} ): Promise { const self = this as any as {{contractName}}Contract; - const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs; + const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs; [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); - const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}( + const encodedData = self._ethersInterface.functions.{{this.name}}( {{> params inputs=inputs}} - ).data; + ).data const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( { ...txData, data: encodedData, }, - self.{{this.tsName}}.estimateGasAsync.bind( + self.{{this.name}}.estimateGasAsync.bind( self, {{> params inputs=inputs}} ), @@ -32,11 +32,11 @@ public {{this.tsName}} = { txData: Partial = {}, ): Promise { const self = this as any as {{contractName}}Contract; - const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs; + const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs; [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(this)); - const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}( + const encodedData = self._ethersInterface.functions.{{this.name}}( {{> params inputs=inputs}} - ).data; + ).data const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( { ...txData, @@ -50,11 +50,11 @@ public {{this.tsName}} = { {{> typed_params inputs=inputs}} ): string { const self = this as any as {{contractName}}Contract; - const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs; + const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs; [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); - const abiEncodedTransactionData = self._lookupEthersInterface('{{this.name}}').functions.{{this.name}}( + const abiEncodedTransactionData = self._ethersInterface.functions.{{this.name}}( {{> params inputs=inputs}} - ).data; + ).data return abiEncodedTransactionData; }, {{> callAsync}} -- cgit v1.2.3