aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/exchange_wrapper_test.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index 0dc67bb01..813afdddd 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -303,6 +303,21 @@ describe('ExchangeWrapper', () => {
)).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerFeeAllowance);
});
});
+ it('should throw when maker has balance to cover fees or transfer but not both', async () => {
+ const makerFee = new BigNumber(1);
+ const takerFee = new BigNumber(1);
+ const signedOrder = await fillScenarios.createFillableSignedOrderWithFeesAsync(
+ zrxTokenAddress, takerTokenAddress, makerFee, takerFee,
+ makerAddress, takerAddress, fillableAmount, feeRecipient,
+ );
+ const balanceToSubtractFromMaker = new BigNumber(1);
+ await zeroEx.token.transferAsync(
+ zrxTokenAddress, makerAddress, coinbase, balanceToSubtractFromMaker,
+ );
+ return expect(
+ zeroEx.exchange.fillOrderAsync(signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress),
+ ).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerBalance);
+ });
});
describe('successful fills', () => {
it('should fill a valid order', async () => {