aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/order_validation_test.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/order_validation_test.ts b/test/order_validation_test.ts
index 4748ec5a5..022a39dd1 100644
--- a/test/order_validation_test.ts
+++ b/test/order_validation_test.ts
@@ -55,6 +55,25 @@ describe('OrderValidation', () => {
await blockchainLifecycle.revertAsync();
});
describe('validateOrderFillableOrThrowAsync', () => {
+ it('should succeed if the order is fillable', async () => {
+ const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
+ makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
+ );
+ await zeroEx.exchange.validateOrderFillableOrThrowAsync(
+ signedOrder,
+ );
+ });
+ it('should succeed if the order is asymmetric and fillable', async () => {
+ const makerFillableAmount = fillableAmount;
+ const takerFillableAmount = fillableAmount.minus(5000);
+ const signedOrder = await fillScenarios.createAsymmetricFillableSignedOrderAsync(
+ makerTokenAddress, takerTokenAddress, makerAddress, takerAddress,
+ makerFillableAmount, takerFillableAmount,
+ );
+ await zeroEx.exchange.validateOrderFillableOrThrowAsync(
+ signedOrder,
+ );
+ });
it('should throw when the order is fully filled or cancelled', async () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,