aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 19:20:02 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 19:20:02 +0800
commit91101eb8ec4057617e644df4439c626093d4b3cc (patch)
treebf11f2534bd019e77a9211ab3739c93a120630c9 /src
parent9325bd8cb4d3b0f3bbf241a52bd60cda77972236 (diff)
downloaddexon-sol-tools-91101eb8ec4057617e644df4439c626093d4b3cc.tar
dexon-sol-tools-91101eb8ec4057617e644df4439c626093d4b3cc.tar.gz
dexon-sol-tools-91101eb8ec4057617e644df4439c626093d4b3cc.tar.bz2
dexon-sol-tools-91101eb8ec4057617e644df4439c626093d4b3cc.tar.lz
dexon-sol-tools-91101eb8ec4057617e644df4439c626093d4b3cc.tar.xz
dexon-sol-tools-91101eb8ec4057617e644df4439c626093d4b3cc.tar.zst
dexon-sol-tools-91101eb8ec4057617e644df4439c626093d4b3cc.zip
Add tests for batchCancelAsync
Diffstat (limited to 'src')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts2
-rw-r--r--src/utils/assert.ts4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index b0c4295f1..fec75e6df 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -212,7 +212,7 @@ export class ExchangeWrapper extends ContractWrapper {
orders: Array<Order|SignedOrder>, takerTokenCancelAmounts: BigNumber.BigNumber[]): Promise<void> {
const makers = _.map(orders, order => order.maker);
assert.isSameLength('orders', orders, 'takerTokenCancelAmounts', takerTokenCancelAmounts);
- assert.assert(_.isEmpty(orders), 'Can not cancel an empty batch');
+ assert.assert(!_.isEmpty(orders), 'Can not cancel an empty batch');
assert.assert(_.uniq(makers).length === 1, 'Can not cancel orders from multiple makers in a single batch');
const maker = makers[0];
// _.zip doesn't type check if values have different types :'(
diff --git a/src/utils/assert.ts b/src/utils/assert.ts
index 3842185bb..61b7527e6 100644
--- a/src/utils/assert.ts
+++ b/src/utils/assert.ts
@@ -45,8 +45,8 @@ export const assert = {
isSameLength(variableName1: string, value1: any[], variableName2: string, value2: any[]) {
const length1 = value1.length;
const length2 = value2.length;
- this.assert(length1 === length2, `${variableName1} and ${variableName2} length mismatch.
- ${length1} != ${length2}`);
+ this.assert(length1 === length2, `${variableName1} and ${variableName2} length mismatch. \
+${length1} != ${length2}`);
},
isNumber(variableName: string, value: number): void {
this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value));