diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-22 22:15:10 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-22 22:15:10 +0800 |
commit | 894ade168d5ff09a0b6a9b9a04a0a6b58dcc58ce (patch) | |
tree | 9ecf2e0df53080fe6e9818779f344bebcdf3fef2 /test/order_validation_test.ts | |
parent | df274591f735d73fc1dc58ade30d46f6b14d4525 (diff) | |
download | dexon-sol-tools-894ade168d5ff09a0b6a9b9a04a0a6b58dcc58ce.tar dexon-sol-tools-894ade168d5ff09a0b6a9b9a04a0a6b58dcc58ce.tar.gz dexon-sol-tools-894ade168d5ff09a0b6a9b9a04a0a6b58dcc58ce.tar.bz2 dexon-sol-tools-894ade168d5ff09a0b6a9b9a04a0a6b58dcc58ce.tar.lz dexon-sol-tools-894ade168d5ff09a0b6a9b9a04a0a6b58dcc58ce.tar.xz dexon-sol-tools-894ade168d5ff09a0b6a9b9a04a0a6b58dcc58ce.tar.zst dexon-sol-tools-894ade168d5ff09a0b6a9b9a04a0a6b58dcc58ce.zip |
Rename shouldCheckTransfer to shouldThrowOnInsufficientBalanceOrAllowance in tests
Diffstat (limited to 'test/order_validation_test.ts')
-rw-r--r-- | test/order_validation_test.ts | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/order_validation_test.ts b/test/order_validation_test.ts index 773a23aa7..826b44077 100644 --- a/test/order_validation_test.ts +++ b/test/order_validation_test.ts @@ -30,7 +30,7 @@ describe('OrderValidationUtils', () => { let feeRecipient: string; const fillableAmount = new BigNumber(5); const fillTakerAmount = new BigNumber(5); - const shouldCheckTransfer = true; + const shouldThrowOnInsufficientBalanceOrAllowance = false; before(async () => { web3 = web3Factory.create(); zeroEx = new ZeroEx(web3.currentProvider); @@ -66,7 +66,7 @@ describe('OrderValidationUtils', () => { takerTokenAddress, takerAddress, coinbase, balanceToSubtractFromMaker, ); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerBalance); }); it('should throw when taker allowance is less than fill amount', async () => { @@ -74,7 +74,7 @@ describe('OrderValidationUtils', () => { await zeroEx.token.setProxyAllowanceAsync(takerTokenAddress, takerAddress, newAllowanceWhichIsLessThanFillAmount); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerAllowance); }); it('should throw when maker balance is less than maker fill amount', async () => { @@ -82,7 +82,7 @@ describe('OrderValidationUtils', () => { makerTokenAddress, makerAddress, coinbase, balanceToSubtractFromMaker, ); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerBalance); }); it('should throw when maker allowance is less than maker fill amount', async () => { @@ -90,7 +90,7 @@ describe('OrderValidationUtils', () => { await zeroEx.token.setProxyAllowanceAsync(makerTokenAddress, makerAddress, newAllowanceWhichIsLessThanFillAmount); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerAllowance); }); }); @@ -110,7 +110,7 @@ describe('OrderValidationUtils', () => { zrxTokenAddress, makerAddress, coinbase, balanceToSubtractFromMaker, ); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerFeeBalance); }); it('should throw when maker doesn\'t have enough allowance to pay fees', async () => { @@ -118,7 +118,7 @@ describe('OrderValidationUtils', () => { await zeroEx.token.setProxyAllowanceAsync(zrxTokenAddress, makerAddress, newAllowanceWhichIsLessThanFees); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerFeeAllowance); }); it('should throw when taker doesn\'t have enough balance to pay fees', async () => { @@ -127,7 +127,7 @@ describe('OrderValidationUtils', () => { zrxTokenAddress, takerAddress, coinbase, balanceToSubtractFromTaker, ); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerFeeBalance); }); it('should throw when taker doesn\'t have enough allowance to pay fees', async () => { @@ -135,7 +135,7 @@ describe('OrderValidationUtils', () => { await zeroEx.token.setProxyAllowanceAsync(zrxTokenAddress, takerAddress, newAllowanceWhichIsLessThanFees); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerFeeAllowance); }); }); @@ -156,7 +156,7 @@ describe('OrderValidationUtils', () => { zrxTokenAddress, makerAddress, coinbase, balanceToSubtractFromMaker, ); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerBalance); }); it('should throw on insufficient allowance when makerToken is ZRX', async () => { @@ -165,7 +165,7 @@ describe('OrderValidationUtils', () => { await zeroEx.token.setProxyAllowanceAsync( zrxTokenAddress, makerAddress, newAllowanceWhichIsInsufficient); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerAllowance); }); }); @@ -186,7 +186,7 @@ describe('OrderValidationUtils', () => { zrxTokenAddress, takerAddress, coinbase, balanceToSubtractFromTaker, ); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerBalance); }); it('should throw on insufficient allowance when takerToken is ZRX', async () => { @@ -195,7 +195,7 @@ describe('OrderValidationUtils', () => { await zeroEx.token.setProxyAllowanceAsync( zrxTokenAddress, takerAddress, newAllowanceWhichIsInsufficient); return expect(zeroEx.exchange.fillOrderAsync( - signedOrder, fillTakerAmount, shouldCheckTransfer, takerAddress, + signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerAllowance); }); }); |