diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-12-19 13:44:26 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-01-15 02:49:29 +0800 |
commit | 2f1454e90e5fd7d85c4deb3a8c674043e8a14564 (patch) | |
tree | 65ce021b55cf9e384e808bba94b2979d9c73f170 /packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts | |
parent | b89f9869492e369370bcef593d69e59172f13da4 (diff) | |
download | dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.gz dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.bz2 dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.lz dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.xz dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.tar.zst dexon-sol-tools-2f1454e90e5fd7d85c4deb3a8c674043e8a14564.zip |
Working for almost every test
Diffstat (limited to 'packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts')
-rw-r--r-- | packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts | 56 |
1 files changed, 14 insertions, 42 deletions
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts index a2daaff74..b1d0d3be5 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts @@ -45,12 +45,8 @@ export class OrderValidatorContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - const decodingRules = {structsAsObjects: false}; - let resultArray = abiEncoder.decodeReturnValues(rawCallResult, decodingRules); - const outputAbi = (_.find(self.abi, {name: 'getOrderAndTraderInfo'}) as MethodAbi).outputs; - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this)); - return resultArray; + let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); + return resultArray; }, }; public getBalanceAndAllowance = { @@ -83,12 +79,8 @@ export class OrderValidatorContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - const decodingRules = {structsAsObjects: false}; - let resultArray = abiEncoder.decodeReturnValues(rawCallResult, decodingRules); - const outputAbi = (_.find(self.abi, {name: 'getBalanceAndAllowance'}) as MethodAbi).outputs; - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this)); - return resultArray; + let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); + return resultArray; }, }; public getOrdersAndTradersInfo = { @@ -121,12 +113,8 @@ export class OrderValidatorContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - const decodingRules = {structsAsObjects: false}; - let resultArray = abiEncoder.decodeReturnValues(rawCallResult, decodingRules); - const outputAbi = (_.find(self.abi, {name: 'getOrdersAndTradersInfo'}) as MethodAbi).outputs; - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this)); - return resultArray; + let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); + return resultArray; }, }; public getTradersInfo = { @@ -159,12 +147,8 @@ export class OrderValidatorContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - const decodingRules = {structsAsObjects: false}; - let resultArray = abiEncoder.decodeReturnValues(rawCallResult, decodingRules); - const outputAbi = (_.find(self.abi, {name: 'getTradersInfo'}) as MethodAbi).outputs; - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this)); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); + return resultArray[0]; }, }; public getERC721TokenOwner = { @@ -197,12 +181,8 @@ export class OrderValidatorContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - const decodingRules = {structsAsObjects: false}; - let resultArray = abiEncoder.decodeReturnValues(rawCallResult, decodingRules); - const outputAbi = (_.find(self.abi, {name: 'getERC721TokenOwner'}) as MethodAbi).outputs; - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this)); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); + return resultArray[0]; }, }; public getBalancesAndAllowances = { @@ -235,12 +215,8 @@ export class OrderValidatorContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - const decodingRules = {structsAsObjects: false}; - let resultArray = abiEncoder.decodeReturnValues(rawCallResult, decodingRules); - const outputAbi = (_.find(self.abi, {name: 'getBalancesAndAllowances'}) as MethodAbi).outputs; - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this)); - return resultArray; + let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); + return resultArray; }, }; public getTraderInfo = { @@ -273,12 +249,8 @@ export class OrderValidatorContract extends BaseContract { ); const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); BaseContract._throwIfRevertWithReasonCallResult(rawCallResult); - const decodingRules = {structsAsObjects: false}; - let resultArray = abiEncoder.decodeReturnValues(rawCallResult, decodingRules); - const outputAbi = (_.find(self.abi, {name: 'getTraderInfo'}) as MethodAbi).outputs; - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); - resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this)); - return resultArray[0]; + let resultArray = abiEncoder.decodeReturnValuesAsArray(rawCallResult, {structsAsObjects: true}); + return resultArray[0]; }, }; public static async deployFrom0xArtifactAsync( |