aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract_templates/partials/tx.handlebars
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-04-12 08:20:52 +0800
committerGitHub <noreply@github.com>2018-04-12 08:20:52 +0800
commitbe73084e04264d44cfbd7cf6b8ba3a993368133d (patch)
tree68fc540971871fd99d0977957ac20132d6efed60 /packages/contract_templates/partials/tx.handlebars
parent63b941fbaf08167234cf7871e874c1a96e4347fa (diff)
parent5eb90697c824f1c98467cdb6cd71dbb94ff70805 (diff)
downloaddexon-sol-tools-be73084e04264d44cfbd7cf6b8ba3a993368133d.tar
dexon-sol-tools-be73084e04264d44cfbd7cf6b8ba3a993368133d.tar.gz
dexon-sol-tools-be73084e04264d44cfbd7cf6b8ba3a993368133d.tar.bz2
dexon-sol-tools-be73084e04264d44cfbd7cf6b8ba3a993368133d.tar.lz
dexon-sol-tools-be73084e04264d44cfbd7cf6b8ba3a993368133d.tar.xz
dexon-sol-tools-be73084e04264d44cfbd7cf6b8ba3a993368133d.tar.zst
dexon-sol-tools-be73084e04264d44cfbd7cf6b8ba3a993368133d.zip
Merge branch 'development' into feature/subproviders/mnemonic-wallet-subprovider
Diffstat (limited to 'packages/contract_templates/partials/tx.handlebars')
-rw-r--r--packages/contract_templates/partials/tx.handlebars22
1 files changed, 11 insertions, 11 deletions
diff --git a/packages/contract_templates/partials/tx.handlebars b/packages/contract_templates/partials/tx.handlebars
index 41ba6d3f7..22fe0c597 100644
--- a/packages/contract_templates/partials/tx.handlebars
+++ b/packages/contract_templates/partials/tx.handlebars
@@ -1,4 +1,4 @@
-public {{this.name}} = {
+public {{this.tsName}} = {
async sendTransactionAsync(
{{> typed_params inputs=inputs}}
{{#this.payable}}
@@ -9,17 +9,17 @@ public {{this.name}} = {
{{/this.payable}}
): Promise<string> {
const self = this as any as {{contractName}}Contract;
- const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs;
+ const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self));
- const encodedData = self._ethersInterface.functions.{{this.name}}(
+ const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}(
{{> params inputs=inputs}}
- ).data
+ ).data;
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
{
...txData,
data: encodedData,
},
- self.{{this.name}}.estimateGasAsync.bind(
+ self.{{this.tsName}}.estimateGasAsync.bind(
self,
{{> params inputs=inputs}}
),
@@ -32,11 +32,11 @@ public {{this.name}} = {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as {{contractName}}Contract;
- const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs;
+ const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(this));
- const encodedData = self._ethersInterface.functions.{{this.name}}(
+ const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}(
{{> params inputs=inputs}}
- ).data
+ ).data;
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
{
...txData,
@@ -50,11 +50,11 @@ public {{this.name}} = {
{{> typed_params inputs=inputs}}
): string {
const self = this as any as {{contractName}}Contract;
- const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs;
+ const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self));
- const abiEncodedTransactionData = self._ethersInterface.functions.{{this.name}}(
+ const abiEncodedTransactionData = self._lookupEthersInterface('{{this.name}}').functions.{{this.name}}(
{{> params inputs=inputs}}
- ).data
+ ).data;
return abiEncodedTransactionData;
},
{{> callAsync}}