diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-21 01:14:04 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-21 01:14:04 +0800 |
commit | 5bfdffda1155e306b17eee0a4e60320c3433d5c4 (patch) | |
tree | 10beed3fe27c6027378e9ef347fb8de59ed6d3df /packages/contracts/src/utils/core_combinatorial_utils.ts | |
parent | 247f8c8557a501ea5081615d9b031c9e4b7aeec7 (diff) | |
download | dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.tar dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.tar.gz dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.tar.bz2 dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.tar.lz dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.tar.xz dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.tar.zst dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.zip |
Add support for approveAll in assetWrapper and fillOrderScenarios
Diffstat (limited to 'packages/contracts/src/utils/core_combinatorial_utils.ts')
-rw-r--r-- | packages/contracts/src/utils/core_combinatorial_utils.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/contracts/src/utils/core_combinatorial_utils.ts b/packages/contracts/src/utils/core_combinatorial_utils.ts index f1a5599ef..7e9d18e46 100644 --- a/packages/contracts/src/utils/core_combinatorial_utils.ts +++ b/packages/contracts/src/utils/core_combinatorial_utils.ts @@ -630,6 +630,14 @@ export class CoreCombinatorialUtils { ); break; + case AllowanceAmountScenario.Unlimited: + await this.assetWrapper.setProxyAllowanceAsync( + signedOrder.makerAddress, + signedOrder.makerAssetData, + constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS, + ); + break; + default: throw errorUtils.spawnSwitchErr( 'makerStateScenario.traderAssetAllowance', @@ -659,6 +667,14 @@ export class CoreCombinatorialUtils { ); break; + case AllowanceAmountScenario.Unlimited: + await this.assetWrapper.setProxyAllowanceAsync( + signedOrder.makerAddress, + this.zrxAssetData, + constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS, + ); + break; + default: throw errorUtils.spawnSwitchErr( 'makerStateScenario.zrxFeeAllowance', @@ -738,6 +754,14 @@ export class CoreCombinatorialUtils { ); break; + case AllowanceAmountScenario.Unlimited: + await this.assetWrapper.setProxyAllowanceAsync( + this.takerAddress, + signedOrder.takerAssetData, + constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS, + ); + break; + default: throw errorUtils.spawnSwitchErr( 'takerStateScenario.traderAssetAllowance', @@ -767,6 +791,14 @@ export class CoreCombinatorialUtils { ); break; + case AllowanceAmountScenario.Unlimited: + await this.assetWrapper.setProxyAllowanceAsync( + signedOrder.takerAddress, + this.zrxAssetData, + constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS, + ); + break; + default: throw errorUtils.spawnSwitchErr( 'takerStateScenario.zrxFeeAllowance', |