diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-12-19 14:01:48 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-01-15 02:49:44 +0800 |
commit | e4551c8f6037302124cae4cda51b8f7624ade687 (patch) | |
tree | 7878caf2441e72bd5e8147db44bc0d3426407e34 /packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts | |
parent | 2f1454e90e5fd7d85c4deb3a8c674043e8a14564 (diff) | |
download | dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.gz dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.bz2 dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.lz dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.xz dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.tar.zst dexon-sol-tools-e4551c8f6037302124cae4cda51b8f7624ade687.zip |
Works for almost all tests
Diffstat (limited to 'packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts')
-rw-r--r-- | packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts | 56 |
1 files changed, 12 insertions, 44 deletions
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts index 83f5437df..b9aa50429 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts @@ -104,12 +104,6 @@ export class ERC20TokenContract extends BaseContract { > { const self = this as any as ERC20TokenContract; const functionSignature = 'approve(address,uint256)'; - const inputAbi = self._lookupAbi(functionSignature).inputs; - [_spender, - _value - ] = BaseContract._formatABIDataItemList(inputAbi, [_spender, - _value - ], BaseContract._bigNumberToString.bind(self)); const abiEncoder = self._lookupAbiEncoder(functionSignature); const encodedData = abiEncoder.encode([_spender, _value @@ -124,8 +118,8 @@ export class ERC20TokenContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult); + return resultArray[0]; }, }; public totalSupply = { @@ -136,8 +130,6 @@ export class ERC20TokenContract extends BaseContract { > { const self = this as any as ERC20TokenContract; const functionSignature = 'totalSupply()'; - const inputAbi = self._lookupAbi(functionSignature).inputs; - [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self)); const abiEncoder = self._lookupAbiEncoder(functionSignature); const encodedData = abiEncoder.encode([]); const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync( @@ -150,8 +142,8 @@ export class ERC20TokenContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult); + return resultArray[0]; }, }; public transferFrom = { @@ -230,14 +222,6 @@ export class ERC20TokenContract extends BaseContract { > { const self = this as any as ERC20TokenContract; const functionSignature = 'transferFrom(address,address,uint256)'; - const inputAbi = self._lookupAbi(functionSignature).inputs; - [_from, - _to, - _value - ] = BaseContract._formatABIDataItemList(inputAbi, [_from, - _to, - _value - ], BaseContract._bigNumberToString.bind(self)); const abiEncoder = self._lookupAbiEncoder(functionSignature); const encodedData = abiEncoder.encode([_from, _to, @@ -253,8 +237,8 @@ export class ERC20TokenContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult); + return resultArray[0]; }, }; public balanceOf = { @@ -266,10 +250,6 @@ export class ERC20TokenContract extends BaseContract { > { const self = this as any as ERC20TokenContract; const functionSignature = 'balanceOf(address)'; - const inputAbi = self._lookupAbi(functionSignature).inputs; - [_owner - ] = BaseContract._formatABIDataItemList(inputAbi, [_owner - ], BaseContract._bigNumberToString.bind(self)); const abiEncoder = self._lookupAbiEncoder(functionSignature); const encodedData = abiEncoder.encode([_owner ]); @@ -283,8 +263,8 @@ export class ERC20TokenContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult); + return resultArray[0]; }, }; public transfer = { @@ -355,12 +335,6 @@ export class ERC20TokenContract extends BaseContract { > { const self = this as any as ERC20TokenContract; const functionSignature = 'transfer(address,uint256)'; - const inputAbi = self._lookupAbi(functionSignature).inputs; - [_to, - _value - ] = BaseContract._formatABIDataItemList(inputAbi, [_to, - _value - ], BaseContract._bigNumberToString.bind(self)); const abiEncoder = self._lookupAbiEncoder(functionSignature); const encodedData = abiEncoder.encode([_to, _value @@ -375,8 +349,8 @@ export class ERC20TokenContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult); + return resultArray[0]; }, }; public allowance = { @@ -389,12 +363,6 @@ export class ERC20TokenContract extends BaseContract { > { const self = this as any as ERC20TokenContract; const functionSignature = 'allowance(address,address)'; - const inputAbi = self._lookupAbi(functionSignature).inputs; - [_owner, - _spender - ] = BaseContract._formatABIDataItemList(inputAbi, [_owner, - _spender - ], BaseContract._bigNumberToString.bind(self)); const abiEncoder = self._lookupAbiEncoder(functionSignature); const encodedData = abiEncoder.encode([_owner, _spender @@ -409,8 +377,8 @@ export class ERC20TokenContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult); + return resultArray[0]; }, }; public static async deployFrom0xArtifactAsync( |