aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange/fill_order.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-21 01:14:04 +0800
committerFabio Berger <me@fabioberger.com>2018-06-21 01:14:04 +0800
commit5bfdffda1155e306b17eee0a4e60320c3433d5c4 (patch)
tree10beed3fe27c6027378e9ef347fb8de59ed6d3df /packages/contracts/test/exchange/fill_order.ts
parent247f8c8557a501ea5081615d9b031c9e4b7aeec7 (diff)
downloaddexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.tar.gz
dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.tar.zst
dexon-0x-contracts-5bfdffda1155e306b17eee0a4e60320c3433d5c4.zip
Add support for approveAll in assetWrapper and fillOrderScenarios
Diffstat (limited to 'packages/contracts/test/exchange/fill_order.ts')
-rw-r--r--packages/contracts/test/exchange/fill_order.ts40
1 files changed, 39 insertions, 1 deletions
diff --git a/packages/contracts/test/exchange/fill_order.ts b/packages/contracts/test/exchange/fill_order.ts
index dc1dee91f..56d7510f4 100644
--- a/packages/contracts/test/exchange/fill_order.ts
+++ b/packages/contracts/test/exchange/fill_order.ts
@@ -228,7 +228,7 @@ describe('FillOrder Tests', () => {
},
takerAssetFillAmountScenario: TakerAssetFillAmountScenario.ExactlyRemainingFillableTakerAssetAmount,
};
- await coreCombinatorialUtils.testFillOrderScenarioAsync(provider, fillScenario);
+ await coreCombinatorialUtils.testFillOrderScenarioAsync(provider, fillScenario, true);
});
it('should successfully fill order when makerAsset is ERC20 and takerAsset is ERC721', async () => {
@@ -243,5 +243,43 @@ describe('FillOrder Tests', () => {
};
await coreCombinatorialUtils.testFillOrderScenarioAsync(provider, fillScenario);
});
+
+ it('should successfully fill order when makerAsset is ERC721 and approveAll is set for it', async () => {
+ const fillScenario = {
+ ...defaultFillScenario,
+ orderScenario: {
+ ...defaultFillScenario.orderScenario,
+ makerAssetDataScenario: AssetDataScenario.ERC721,
+ takerAssetDataScenario: AssetDataScenario.ERC20NonZRXEighteenDecimals,
+ },
+ takerAssetFillAmountScenario: TakerAssetFillAmountScenario.ExactlyRemainingFillableTakerAssetAmount,
+ makerStateScenario: {
+ ...defaultFillScenario.makerStateScenario,
+ traderAssetAllowance: AllowanceAmountScenario.Unlimited,
+ },
+ };
+ await coreCombinatorialUtils.testFillOrderScenarioAsync(provider, fillScenario);
+ });
+
+ it('should successfully fill order when makerAsset and takerAsset are ERC721 and approveAll is set for them', async () => {
+ const fillScenario = {
+ ...defaultFillScenario,
+ orderScenario: {
+ ...defaultFillScenario.orderScenario,
+ makerAssetDataScenario: AssetDataScenario.ERC721,
+ takerAssetDataScenario: AssetDataScenario.ERC721,
+ },
+ takerAssetFillAmountScenario: TakerAssetFillAmountScenario.ExactlyRemainingFillableTakerAssetAmount,
+ makerStateScenario: {
+ ...defaultFillScenario.makerStateScenario,
+ traderAssetAllowance: AllowanceAmountScenario.Unlimited,
+ },
+ takerStateScenario: {
+ ...defaultFillScenario.takerStateScenario,
+ traderAssetAllowance: AllowanceAmountScenario.Unlimited,
+ },
+ };
+ await coreCombinatorialUtils.testFillOrderScenarioAsync(provider, fillScenario);
+ });
});
});