From 6d560f1be1f317cbf4352e37d5a7259b2218065c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 8 Jun 2017 11:36:40 +0200 Subject: Address old feedback --- src/contract_wrappers/exchange_wrapper.ts | 5 +++-- src/utils/assert.ts | 6 ------ 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index 107a8f618..57becde24 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -181,7 +181,7 @@ export class ExchangeWrapper extends ContractWrapper { public async batchFillOrderAsync(orderFillRequests: OrderFillRequest[], shouldCheckTransfer: boolean, takerAddress: string): Promise { if (_.isEmpty(orderFillRequests)) { - return; + return; // no-op } assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer); await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper); @@ -205,10 +205,11 @@ export class ExchangeWrapper extends ContractWrapper { orderFillRequest.signedOrder.ecSignature.s, ]; }); - // _.unzip doesn't type check if values have different types :'( + // We use _.unzip because _.unzip doesn't type check if values have different types :'( const [orderAddressesArray, orderValuesArray, takerTokenFillAmountArray, vArray, rArray, sArray] = _.unzip( orderAddressesValuesAmountsAndSignatureArray, ); + const gas = await exchangeInstance.batchFill.estimateGas( orderAddressesArray, orderValuesArray, diff --git a/src/utils/assert.ts b/src/utils/assert.ts index 61b7527e6..4dc6945a2 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -42,12 +42,6 @@ export const assert = { const availableAddresses = await web3Wrapper.getAvailableAddressesAsync(); this.assert(!_.isEmpty(availableAddresses), 'No addresses were available on the provided web3 instance'); }, - 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}`); - }, isNumber(variableName: string, value: number): void { this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value)); }, -- cgit