diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-30 01:51:24 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-30 01:51:24 +0800 |
commit | 5e5acdc56e6a60da9e352044c38c071d73bf8f3e (patch) | |
tree | 04553ba5520be30e5ada68a96eebd9aeb5037a8a /src | |
parent | b896a723c250fbb70b067416fbcf2067593d74b9 (diff) | |
download | dexon-0x-contracts-5e5acdc56e6a60da9e352044c38c071d73bf8f3e.tar.gz dexon-0x-contracts-5e5acdc56e6a60da9e352044c38c071d73bf8f3e.tar.zst dexon-0x-contracts-5e5acdc56e6a60da9e352044c38c071d73bf8f3e.zip |
Move schema assertion up to prevent the _.map failure
Diffstat (limited to 'src')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index 7d2d976fb..ff1e755fc 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -517,6 +517,8 @@ export class ExchangeWrapper extends ContractWrapper { */ @decorators.contractCallErrorHandler public async batchCancelOrderAsync(orderCancellationRequests: OrderCancellationRequest[]): Promise<void> { + assert.doesConformToSchema('orderCancellationRequests', orderCancellationRequests, + orderCancellationRequestsSchema); const exchangeContractAddresses = _.map( orderCancellationRequests, orderCancellationRequest => orderCancellationRequest.order.exchangeContractAddress, @@ -527,8 +529,6 @@ export class ExchangeWrapper extends ContractWrapper { assert.hasAtMostOneUniqueValue(makers, ExchangeContractErrs.MULTIPLE_MAKERS_IN_SINGLE_CANCEL_BATCH_DISALLOWED); const maker = makers[0]; await assert.isSenderAddressAsync('maker', maker, this._web3Wrapper); - assert.doesConformToSchema('orderCancellationRequests', orderCancellationRequests, - orderCancellationRequestsSchema); for (const cancellationRequest of orderCancellationRequests) { await this._validateCancelOrderAndThrowIfInvalidAsync( cancellationRequest.order, cancellationRequest.takerTokenCancelAmount, |