aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 19:27:48 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 19:27:48 +0800
commit282219a70723351a681ac3c20156eeef14a758c9 (patch)
tree185049816b0625e7676bba645040dc56c49e1f10
parent9fd128c47636e991ce2cf10cbb22c4b8fe79cc1b (diff)
downloaddexon-sol-tools-282219a70723351a681ac3c20156eeef14a758c9.tar
dexon-sol-tools-282219a70723351a681ac3c20156eeef14a758c9.tar.gz
dexon-sol-tools-282219a70723351a681ac3c20156eeef14a758c9.tar.bz2
dexon-sol-tools-282219a70723351a681ac3c20156eeef14a758c9.tar.lz
dexon-sol-tools-282219a70723351a681ac3c20156eeef14a758c9.tar.xz
dexon-sol-tools-282219a70723351a681ac3c20156eeef14a758c9.tar.zst
dexon-sol-tools-282219a70723351a681ac3c20156eeef14a758c9.zip
Add assertion for empty batch
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 11cfd134f..1ae5b260b 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -142,6 +142,7 @@ export class ExchangeWrapper extends ContractWrapper {
public async batchFillOrderAsync(signedOrders: SignedOrder[], fillTakerAmounts: BigNumber.BigNumber[],
shouldCheckTransfer: boolean, takerAddress: string): Promise<void> {
assert.isSameLength('signedOrders', signedOrders, 'fillTakerAmounts', fillTakerAmounts);
+ assert.assert(!_.isEmpty(signedOrders), 'Can not cancel an empty batch');
assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper);
// _.zip doesn't type check if values have different types :'(