aboutsummaryrefslogtreecommitdiffstats
path: root/test/order_validation_test.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-08-24 00:50:51 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-08-24 15:55:02 +0800
commit8d6045c1d5737ff2e62f6f3b906cf639da1aa2ba (patch)
treeb6fc54d6a328cc4c307bcf95deea36a609c88b94 /test/order_validation_test.ts
parentdc3756bc992b2db4eb26935f8861123ed76189e6 (diff)
downloaddexon-sol-tools-8d6045c1d5737ff2e62f6f3b906cf639da1aa2ba.tar
dexon-sol-tools-8d6045c1d5737ff2e62f6f3b906cf639da1aa2ba.tar.gz
dexon-sol-tools-8d6045c1d5737ff2e62f6f3b906cf639da1aa2ba.tar.bz2
dexon-sol-tools-8d6045c1d5737ff2e62f6f3b906cf639da1aa2ba.tar.lz
dexon-sol-tools-8d6045c1d5737ff2e62f6f3b906cf639da1aa2ba.tar.xz
dexon-sol-tools-8d6045c1d5737ff2e62f6f3b906cf639da1aa2ba.tar.zst
dexon-sol-tools-8d6045c1d5737ff2e62f6f3b906cf639da1aa2ba.zip
Add validation for the case where the order is fully filled or canceled and a test
Diffstat (limited to 'test/order_validation_test.ts')
-rw-r--r--test/order_validation_test.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/order_validation_test.ts b/test/order_validation_test.ts
index 8982a9304..8a6303f3a 100644
--- a/test/order_validation_test.ts
+++ b/test/order_validation_test.ts
@@ -62,6 +62,15 @@ describe('OrderValidation', () => {
const zeroFillAmount = new BigNumber(0);
return expect(zeroEx.exchange.validateFillOrderThrowIfInvalidAsync(
signedOrder, zeroFillAmount, takerAddress,
+ )).to.be.rejectedWith(ExchangeContractErrs.OrderFillAmountZero);
+ });
+ it('should throw when the order is fully filled or cancelled', async () => {
+ const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
+ makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
+ );
+ await zeroEx.exchange.cancelOrderAsync(signedOrder, fillableAmount);
+ return expect(zeroEx.exchange.validateFillOrderThrowIfInvalidAsync(
+ signedOrder, fillableAmount, takerAddress,
)).to.be.rejectedWith(ExchangeContractErrs.OrderRemainingFillAmountZero);
});
it('should throw when sender is not a taker', async () => {