From 5e92ca039c593028694a1453b39e55c127e96ba5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 11:01:33 +0200 Subject: Add validateOrderFillableThrowIfNotFillableAsync to public methods in order to validate orders in an orderbook without a specific taker in mind --- src/contract_wrappers/exchange_wrapper.ts | 19 +++++++++++++++++++ src/types.ts | 10 ++++++++++ src/utils/order_validation_utils.ts | 21 +++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index 54d7f62d5..b56431082 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -28,6 +28,7 @@ import { LogCancelContractEventArgs, LogWithDecodedArgs, MethodOpts, + ValidateOrderFillableOpts, } from '../types'; import {assert} from '../utils/assert'; import {utils} from '../utils/utils'; @@ -623,6 +624,24 @@ export class ExchangeWrapper extends ContractWrapper { const exchangeAddress = exchangeInstance.address; return exchangeAddress; } + /** + * Checks if order is still fillable and throws an error otherwise. + * @param signedOrder An object that conforms to the SignedOrder interface. The + * signedOrder you wish to validate. + * @param opts An object that conforms to the ValidateOrderFillableOpts + * interface. Allows specifying a specific fillTakerTokenAmount + * to validate for. + */ + public async validateOrderFillableThrowIfNotFillableAsync( + signedOrder: SignedOrder, opts: ValidateOrderFillableOpts, + ): Promise { + assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema); + const zrxTokenAddress = await this._getZRXTokenAddressAsync(); + const expectedFillTakerTokenAmount = !_.isUndefined(opts) ? opts.expectedFillTakerTokenAmount : undefined; + await this._orderValidationUtils.validateOrderFillableThrowIfNotFillableAsync( + signedOrder, zrxTokenAddress, expectedFillTakerTokenAmount, + ); + } /** * Checks if order fill will succeed and throws an error otherwise. * @param signedOrder An object that conforms to the SignedOrder interface. The diff --git a/src/types.ts b/src/types.ts index 29fb40e73..92d1e51f6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -433,6 +433,16 @@ export interface Artifact { }}; } +/* + * expectedFillTakerTokenAmount: If specified, the validation method will ensure that the + * supplied order's maker has a sufficient allowance/balance to fill this amount of the order's + * takerTokenAmount. If not specified, the validation method ensures that the maker has a sufficient + * allowance/balance to fill the entire remaining order. + */ +export interface ValidateOrderFillableOpts { + expectedFillTakerTokenAmount?: BigNumber.BigNumber; +} + /* * defaultBlock: The block up to which to query the blockchain state. Setting this to a historical block number * let's the user query the blockchain's state at an arbitrary point in time. In order for this to work, the diff --git a/src/utils/order_validation_utils.ts b/src/utils/order_validation_utils.ts index 815cd0115..27fc72dca 100644 --- a/src/utils/order_validation_utils.ts +++ b/src/utils/order_validation_utils.ts @@ -1,3 +1,4 @@ +import * as _ from 'lodash'; import {ExchangeContractErrs, SignedOrder, Order, ZeroExError} from '../types'; import {ZeroEx} from '../0x'; import {TokenWrapper} from '../contract_wrappers/token_wrapper'; @@ -12,6 +13,26 @@ export class OrderValidationUtils { this.tokenWrapper = tokenWrapper; this.exchangeWrapper = exchangeWrapper; } + public async validateOrderFillableThrowIfNotFillableAsync( + signedOrder: SignedOrder, zrxTokenAddress: string, expectedFillTakerTokenAmount?: BigNumber.BigNumber, + ): Promise { + const orderHash = utils.getOrderHashHex(signedOrder); + const unavailableTakerTokenAmount = await this.exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); + if (signedOrder.makerTokenAmount.eq(unavailableTakerTokenAmount)) { + throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero); + } + const currentUnixTimestampSec = utils.getCurrentUnixTimestamp(); + if (signedOrder.expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) { + throw new Error(ExchangeContractErrs.OrderFillExpired); + } + let fillTakerTokenAmount = signedOrder.takerTokenAmount.minus(unavailableTakerTokenAmount); + if (!_.isUndefined(expectedFillTakerTokenAmount)) { + fillTakerTokenAmount = expectedFillTakerTokenAmount; + } + await this.validateFillOrderMakerBalancesAllowancesThrowIfInvalidAsync( + signedOrder, fillTakerTokenAmount, zrxTokenAddress, + ); + } public async validateFillOrderThrowIfInvalidAsync(signedOrder: SignedOrder, fillTakerTokenAmount: BigNumber.BigNumber, takerAddress: string, -- cgit From 5e6c4e0ec37e7fb6b4214f331761690943552fd3 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 11:38:37 +0200 Subject: improve comment --- src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index 92d1e51f6..2d069f596 100644 --- a/src/types.ts +++ b/src/types.ts @@ -435,9 +435,9 @@ export interface Artifact { /* * expectedFillTakerTokenAmount: If specified, the validation method will ensure that the - * supplied order's maker has a sufficient allowance/balance to fill this amount of the order's + * supplied order maker has a sufficient allowance/balance to fill this amount of the order's * takerTokenAmount. If not specified, the validation method ensures that the maker has a sufficient - * allowance/balance to fill the entire remaining order. + * allowance/balance to fill the entire remaining order amount. */ export interface ValidateOrderFillableOpts { expectedFillTakerTokenAmount?: BigNumber.BigNumber; -- cgit From 9effd572298a9e758078c512eabacc4573524efe Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 11:51:51 +0200 Subject: Fix bug where we were accidentally comparing a makerTokenAmount to a takerTokenAmount --- src/utils/order_validation_utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/order_validation_utils.ts b/src/utils/order_validation_utils.ts index 27fc72dca..a7c487cf2 100644 --- a/src/utils/order_validation_utils.ts +++ b/src/utils/order_validation_utils.ts @@ -18,7 +18,7 @@ export class OrderValidationUtils { ): Promise { const orderHash = utils.getOrderHashHex(signedOrder); const unavailableTakerTokenAmount = await this.exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); - if (signedOrder.makerTokenAmount.eq(unavailableTakerTokenAmount)) { + if (signedOrder.takerTokenAmount.eq(unavailableTakerTokenAmount)) { throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero); } const currentUnixTimestampSec = utils.getCurrentUnixTimestamp(); @@ -45,7 +45,7 @@ export class OrderValidationUtils { throw new Error(ZeroExError.InvalidSignature); } const unavailableTakerTokenAmount = await this.exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); - if (signedOrder.makerTokenAmount.eq(unavailableTakerTokenAmount)) { + if (signedOrder.takerTokenAmount.eq(unavailableTakerTokenAmount)) { throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero); } if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== takerAddress) { -- cgit From d3f729dd7197b9c6c64c41740803a73488977ebc Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 11:55:07 +0200 Subject: rename validateOrderFillableThrowIfNotFillableAsync to validateOrderFillableOrThrowAsync --- src/contract_wrappers/exchange_wrapper.ts | 4 ++-- src/utils/order_validation_utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index b56431082..a53d33ca9 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -632,13 +632,13 @@ export class ExchangeWrapper extends ContractWrapper { * interface. Allows specifying a specific fillTakerTokenAmount * to validate for. */ - public async validateOrderFillableThrowIfNotFillableAsync( + public async validateOrderFillableOrThrowAsync( signedOrder: SignedOrder, opts: ValidateOrderFillableOpts, ): Promise { assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema); const zrxTokenAddress = await this._getZRXTokenAddressAsync(); const expectedFillTakerTokenAmount = !_.isUndefined(opts) ? opts.expectedFillTakerTokenAmount : undefined; - await this._orderValidationUtils.validateOrderFillableThrowIfNotFillableAsync( + await this._orderValidationUtils.validateOrderFillableOrThrowAsync( signedOrder, zrxTokenAddress, expectedFillTakerTokenAmount, ); } diff --git a/src/utils/order_validation_utils.ts b/src/utils/order_validation_utils.ts index a7c487cf2..ba02390d5 100644 --- a/src/utils/order_validation_utils.ts +++ b/src/utils/order_validation_utils.ts @@ -13,7 +13,7 @@ export class OrderValidationUtils { this.tokenWrapper = tokenWrapper; this.exchangeWrapper = exchangeWrapper; } - public async validateOrderFillableThrowIfNotFillableAsync( + public async validateOrderFillableOrThrowAsync( signedOrder: SignedOrder, zrxTokenAddress: string, expectedFillTakerTokenAmount?: BigNumber.BigNumber, ): Promise { const orderHash = utils.getOrderHashHex(signedOrder); -- cgit From 2148eb6d9901bbc34210df2e96542f71eef215f9 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 12:32:49 +0200 Subject: make opts optional --- src/contract_wrappers/exchange_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index a53d33ca9..809bdebc5 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -633,7 +633,7 @@ export class ExchangeWrapper extends ContractWrapper { * to validate for. */ public async validateOrderFillableOrThrowAsync( - signedOrder: SignedOrder, opts: ValidateOrderFillableOpts, + signedOrder: SignedOrder, opts?: ValidateOrderFillableOpts, ): Promise { assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema); const zrxTokenAddress = await this._getZRXTokenAddressAsync(); -- cgit From 25116940c0f3df4431e16d050da9b5d4f301b9d8 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 12:39:05 +0200 Subject: Refactor our logic checking fillAmountNotZero and expiry --- src/utils/order_validation_utils.ts | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/utils/order_validation_utils.ts b/src/utils/order_validation_utils.ts index ba02390d5..6f7522c41 100644 --- a/src/utils/order_validation_utils.ts +++ b/src/utils/order_validation_utils.ts @@ -18,13 +18,10 @@ export class OrderValidationUtils { ): Promise { const orderHash = utils.getOrderHashHex(signedOrder); const unavailableTakerTokenAmount = await this.exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); - if (signedOrder.takerTokenAmount.eq(unavailableTakerTokenAmount)) { - throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero); - } - const currentUnixTimestampSec = utils.getCurrentUnixTimestamp(); - if (signedOrder.expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) { - throw new Error(ExchangeContractErrs.OrderFillExpired); - } + this.validateRemainingFillAmountNotZeroOrThrow( + signedOrder.takerTokenAmount, unavailableTakerTokenAmount, + ); + this.validateOrderNotExpiredOrThrow(signedOrder.expirationUnixTimestampSec); let fillTakerTokenAmount = signedOrder.takerTokenAmount.minus(unavailableTakerTokenAmount); if (!_.isUndefined(expectedFillTakerTokenAmount)) { fillTakerTokenAmount = expectedFillTakerTokenAmount; @@ -45,16 +42,13 @@ export class OrderValidationUtils { throw new Error(ZeroExError.InvalidSignature); } const unavailableTakerTokenAmount = await this.exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); - if (signedOrder.takerTokenAmount.eq(unavailableTakerTokenAmount)) { - throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero); - } + this.validateRemainingFillAmountNotZeroOrThrow( + signedOrder.takerTokenAmount, unavailableTakerTokenAmount, + ); if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== takerAddress) { throw new Error(ExchangeContractErrs.TransactionSenderIsNotFillOrderTaker); } - const currentUnixTimestampSec = utils.getCurrentUnixTimestamp(); - if (signedOrder.expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) { - throw new Error(ExchangeContractErrs.OrderFillExpired); - } + this.validateOrderNotExpiredOrThrow(signedOrder.expirationUnixTimestampSec); await this.validateFillOrderBalancesAllowancesThrowIfInvalidAsync( signedOrder, fillTakerTokenAmount, takerAddress, zrxTokenAddress, ); @@ -168,4 +162,17 @@ export class OrderValidationUtils { } } } + private validateRemainingFillAmountNotZeroOrThrow( + takerTokenAmount: BigNumber.BigNumber, unavailableTakerTokenAmount: BigNumber.BigNumber, + ) { + if (takerTokenAmount.eq(unavailableTakerTokenAmount)) { + throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero); + } + } + private validateOrderNotExpiredOrThrow(expirationUnixTimestampSec: BigNumber.BigNumber) { + const currentUnixTimestampSec = utils.getCurrentUnixTimestamp(); + if (expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) { + throw new Error(ExchangeContractErrs.OrderFillExpired); + } + } } -- cgit From e704aea64379e95edc4e40e7b280d6997ada3e4a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 12:39:17 +0200 Subject: Add tests for validateOrderFillableOrThrowAsync --- test/order_validation_test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/order_validation_test.ts b/test/order_validation_test.ts index 9a621555c..4748ec5a5 100644 --- a/test/order_validation_test.ts +++ b/test/order_validation_test.ts @@ -54,6 +54,27 @@ describe('OrderValidation', () => { afterEach(async () => { await blockchainLifecycle.revertAsync(); }); + describe('validateOrderFillableOrThrowAsync', () => { + 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.validateOrderFillableOrThrowAsync( + signedOrder, + )).to.be.rejectedWith(ExchangeContractErrs.OrderRemainingFillAmountZero); + }); + it('should throw when order is expired', async () => { + const expirationInPast = new BigNumber(1496826058); // 7th Jun 2017 + const signedOrder = await fillScenarios.createFillableSignedOrderAsync( + makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, + fillableAmount, expirationInPast, + ); + return expect(zeroEx.exchange.validateOrderFillableOrThrowAsync( + signedOrder, + )).to.be.rejectedWith(ExchangeContractErrs.OrderFillExpired); + }); + }); describe('validateFillOrderAndThrowIfInvalidAsync', () => { it('should throw when the fill amount is zero', async () => { const signedOrder = await fillScenarios.createFillableSignedOrderAsync( -- cgit From 5bea6ff581dddd03ff99da69688fe8fb9c467b82 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 15:27:59 +0200 Subject: Add success test and regression test for previous bug where comparing makerTokenAmount with a takerTokenAmount --- test/order_validation_test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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, -- cgit From 98863836381ad56f4c7c3357baeaa57b96712732 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 15:28:07 +0200 Subject: Fix linter issue --- test/utils/fill_scenarios.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/utils/fill_scenarios.ts b/test/utils/fill_scenarios.ts index 563415a48..e305759f6 100644 --- a/test/utils/fill_scenarios.ts +++ b/test/utils/fill_scenarios.ts @@ -62,7 +62,9 @@ export class FillScenarios { fillableAmount, fillableAmount, ); const shouldThrowOnInsufficientBalanceOrAllowance = false; - await this.zeroEx.exchange.fillOrderAsync(signedOrder, partialFillAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress); + await this.zeroEx.exchange.fillOrderAsync( + signedOrder, partialFillAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, + ); return signedOrder; } private async createAsymmetricFillableSignedOrderWithFeesAsync( -- cgit From fbac611337593b9bf03552637e709c45bdeee4ed Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 15:29:08 +0200 Subject: improve comment --- src/contract_wrappers/exchange_wrapper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index 809bdebc5..c81e7919f 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -625,7 +625,8 @@ export class ExchangeWrapper extends ContractWrapper { return exchangeAddress; } /** - * Checks if order is still fillable and throws an error otherwise. + * Checks if order is still fillable and throws an error otherwise. Useful for orderbook + * pruning where you want to remove stale orders without knowing who the taker will be. * @param signedOrder An object that conforms to the SignedOrder interface. The * signedOrder you wish to validate. * @param opts An object that conforms to the ValidateOrderFillableOpts -- cgit From 9ee88ba06dfd874feb4fdf54b0fb09b7c1951dfd Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 15:30:54 +0200 Subject: Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c0d0cb88..add5714e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG v0.17.0 - _September 26, 2017_ + * Added `zeroEx.exchange.validateOrderFillableOrThrowAsync` to simplify orderbook pruning (#170) * Made `zeroEx.exchange.getZRXTokenAddressAsync` public (#171) v0.16.0 - _September 20, 2017_ -- cgit From ad6e84882146af1164e4729db3bf43c4d8cde5db Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 15:37:14 +0200 Subject: fix merge issue --- src/contract_wrappers/exchange_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index d2a3bcfa3..6d4d90441 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -637,7 +637,7 @@ export class ExchangeWrapper extends ContractWrapper { signedOrder: SignedOrder, opts?: ValidateOrderFillableOpts, ): Promise { assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema); - const zrxTokenAddress = await this._getZRXTokenAddressAsync(); + const zrxTokenAddress = await this.getZRXTokenAddressAsync(); const expectedFillTakerTokenAmount = !_.isUndefined(opts) ? opts.expectedFillTakerTokenAmount : undefined; await this._orderValidationUtils.validateOrderFillableOrThrowAsync( signedOrder, zrxTokenAddress, expectedFillTakerTokenAmount, -- cgit From f8d5b72367bcd5e934e9c535b6cbd18b6de1fb81 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 15:57:36 +0200 Subject: fix test --- test/order_validation_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/order_validation_test.ts b/test/order_validation_test.ts index 022a39dd1..c88ae81ac 100644 --- a/test/order_validation_test.ts +++ b/test/order_validation_test.ts @@ -65,7 +65,7 @@ describe('OrderValidation', () => { }); it('should succeed if the order is asymmetric and fillable', async () => { const makerFillableAmount = fillableAmount; - const takerFillableAmount = fillableAmount.minus(5000); + const takerFillableAmount = fillableAmount.minus(2); const signedOrder = await fillScenarios.createAsymmetricFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, makerFillableAmount, takerFillableAmount, -- cgit From 5f7afce49d0c2367fc2a7b2f45334d64469ef32f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Sep 2017 15:58:08 +0200 Subject: fix test --- test/order_validation_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/order_validation_test.ts b/test/order_validation_test.ts index c88ae81ac..f625433eb 100644 --- a/test/order_validation_test.ts +++ b/test/order_validation_test.ts @@ -65,7 +65,7 @@ describe('OrderValidation', () => { }); it('should succeed if the order is asymmetric and fillable', async () => { const makerFillableAmount = fillableAmount; - const takerFillableAmount = fillableAmount.minus(2); + const takerFillableAmount = fillableAmount.minus(4); const signedOrder = await fillScenarios.createAsymmetricFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, makerFillableAmount, takerFillableAmount, -- cgit