aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-02 16:48:59 +0800
committerFabio Berger <me@fabioberger.com>2018-07-02 16:48:59 +0800
commit0326ddd79d2a97b5841f3e5dbfe6c3067e089bba (patch)
treebe8969d5468e7b5d51327a73931d17b43f18cf09 /packages
parent1a2c58494fa8ddd430c9f20829d0007e77b7d6c3 (diff)
downloaddexon-sol-tools-0326ddd79d2a97b5841f3e5dbfe6c3067e089bba.tar.gz
dexon-sol-tools-0326ddd79d2a97b5841f3e5dbfe6c3067e089bba.tar.zst
dexon-sol-tools-0326ddd79d2a97b5841f3e5dbfe6c3067e089bba.zip
Add maker and taker balance/allowance scenarios to generateFillOrderCombination
Diffstat (limited to 'packages')
-rw-r--r--packages/contracts/src/utils/core_combinatorial_utils.ts32
1 files changed, 24 insertions, 8 deletions
diff --git a/packages/contracts/src/utils/core_combinatorial_utils.ts b/packages/contracts/src/utils/core_combinatorial_utils.ts
index 5b725fbe3..aadf7a57c 100644
--- a/packages/contracts/src/utils/core_combinatorial_utils.ts
+++ b/packages/contracts/src/utils/core_combinatorial_utils.ts
@@ -165,6 +165,14 @@ export class CoreCombinatorialUtils {
AssetDataScenario.ZRXFeeToken,
];
const takerAssetFillAmountScenario = [TakerAssetFillAmountScenario.ExactlyRemainingFillableTakerAssetAmount];
+ const makerAssetBalanceScenario = [BalanceAmountScenario.Higher];
+ const makerAssetAllowanceScenario = [AllowanceAmountScenario.Higher];
+ const makerZRXBalanceScenario = [BalanceAmountScenario.Higher];
+ const makerZRXAllowanceScenario = [AllowanceAmountScenario.Higher];
+ const takerAssetBalanceScenario = [BalanceAmountScenario.Higher];
+ const takerAssetAllowanceScenario = [AllowanceAmountScenario.Higher];
+ const takerZRXBalanceScenario = [BalanceAmountScenario.Higher];
+ const takerZRXAllowanceScenario = [AllowanceAmountScenario.Higher];
const fillScenarioArrays = CoreCombinatorialUtils._getAllCombinations([
takerScenarios,
feeRecipientScenarios,
@@ -176,6 +184,14 @@ export class CoreCombinatorialUtils {
makerAssetDataScenario,
takerAssetDataScenario,
takerAssetFillAmountScenario,
+ makerAssetBalanceScenario,
+ makerAssetAllowanceScenario,
+ makerZRXBalanceScenario,
+ makerZRXAllowanceScenario,
+ takerAssetBalanceScenario,
+ takerAssetAllowanceScenario,
+ takerZRXBalanceScenario,
+ takerZRXAllowanceScenario,
]);
const fillScenarios = _.map(fillScenarioArrays, fillScenarioArray => {
@@ -193,16 +209,16 @@ export class CoreCombinatorialUtils {
},
takerAssetFillAmountScenario: fillScenarioArray[9] as TakerAssetFillAmountScenario,
makerStateScenario: {
- traderAssetBalance: BalanceAmountScenario.Higher,
- traderAssetAllowance: AllowanceAmountScenario.Higher,
- zrxFeeBalance: BalanceAmountScenario.Higher,
- zrxFeeAllowance: AllowanceAmountScenario.Higher,
+ traderAssetBalance: fillScenarioArray[10] as BalanceAmountScenario,
+ traderAssetAllowance: fillScenarioArray[11] as AllowanceAmountScenario,
+ zrxFeeBalance: fillScenarioArray[12] as BalanceAmountScenario,
+ zrxFeeAllowance: fillScenarioArray[13] as AllowanceAmountScenario,
},
takerStateScenario: {
- traderAssetBalance: BalanceAmountScenario.Higher,
- traderAssetAllowance: AllowanceAmountScenario.Higher,
- zrxFeeBalance: BalanceAmountScenario.Higher,
- zrxFeeAllowance: AllowanceAmountScenario.Higher,
+ traderAssetBalance: fillScenarioArray[14] as BalanceAmountScenario,
+ traderAssetAllowance: fillScenarioArray[15] as AllowanceAmountScenario,
+ zrxFeeBalance: fillScenarioArray[16] as BalanceAmountScenario,
+ zrxFeeAllowance: fillScenarioArray[17] as AllowanceAmountScenario,
},
};
return fillScenario;