diff options
author | fragosti <francesco.agosti93@gmail.com> | 2019-01-25 09:35:25 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2019-01-25 09:35:25 +0800 |
commit | a9ca1f3174279dce6aa429d1c62a8f2ffb5ae5a1 (patch) | |
tree | ac608e0471b472b76d9128d52c7099887b5cccfa /packages/abi-gen-templates/partials/tx.handlebars | |
parent | a8c3b4126e6b62f423a71dba7ba55a85e7e2bde7 (diff) | |
parent | 5b06595a6b6d459d53840d066fb204c0a9e3ed02 (diff) | |
download | dexon-0x-contracts-a9ca1f3174279dce6aa429d1c62a8f2ffb5ae5a1.tar dexon-0x-contracts-a9ca1f3174279dce6aa429d1c62a8f2ffb5ae5a1.tar.gz dexon-0x-contracts-a9ca1f3174279dce6aa429d1c62a8f2ffb5ae5a1.tar.bz2 dexon-0x-contracts-a9ca1f3174279dce6aa429d1c62a8f2ffb5ae5a1.tar.lz dexon-0x-contracts-a9ca1f3174279dce6aa429d1c62a8f2ffb5ae5a1.tar.xz dexon-0x-contracts-a9ca1f3174279dce6aa429d1c62a8f2ffb5ae5a1.tar.zst dexon-0x-contracts-a9ca1f3174279dce6aa429d1c62a8f2ffb5ae5a1.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into development
Diffstat (limited to 'packages/abi-gen-templates/partials/tx.handlebars')
-rw-r--r-- | packages/abi-gen-templates/partials/tx.handlebars | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/packages/abi-gen-templates/partials/tx.handlebars b/packages/abi-gen-templates/partials/tx.handlebars index b39156583..0f1027fae 100644 --- a/packages/abi-gen-templates/partials/tx.handlebars +++ b/packages/abi-gen-templates/partials/tx.handlebars @@ -9,10 +9,7 @@ public {{this.tsName}} = { {{/this.payable}} ): Promise<string> { const self = this as any as {{contractName}}Contract; - const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs; - [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); - BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]); - const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]); + const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]); const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync( { to: self.address, @@ -33,9 +30,7 @@ public {{this.tsName}} = { txData: Partial<TxData> = {}, ): Promise<number> { const self = this as any as {{contractName}}Contract; - const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs; - [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString); - const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]); + const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]); const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync( { to: self.address, @@ -51,9 +46,7 @@ public {{this.tsName}} = { {{> typed_params inputs=inputs}} ): string { const self = this as any as {{contractName}}Contract; - const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs; - [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString); - const abiEncodedTransactionData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]); + const abiEncodedTransactionData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]); return abiEncodedTransactionData; }, {{> callAsync}} |