aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-01 05:04:24 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-01 05:04:24 +0800
commita85c2b61ceac198e822074e1670140924aa0e9f5 (patch)
treeebe5bc28c2fe57fbd0e1c4bb84385f04d0e5228e /src/contract_wrappers
parent0c07490ae566f6be4126d0ea499c1498a0489dc9 (diff)
downloaddexon-sol-tools-a85c2b61ceac198e822074e1670140924aa0e9f5.tar
dexon-sol-tools-a85c2b61ceac198e822074e1670140924aa0e9f5.tar.gz
dexon-sol-tools-a85c2b61ceac198e822074e1670140924aa0e9f5.tar.bz2
dexon-sol-tools-a85c2b61ceac198e822074e1670140924aa0e9f5.tar.lz
dexon-sol-tools-a85c2b61ceac198e822074e1670140924aa0e9f5.tar.xz
dexon-sol-tools-a85c2b61ceac198e822074e1670140924aa0e9f5.tar.zst
dexon-sol-tools-a85c2b61ceac198e822074e1670140924aa0e9f5.zip
Move schema assertion up to prevent the _.map failure
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 1dd83b763..744720c3a 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -218,6 +218,7 @@ export class ExchangeWrapper extends ContractWrapper {
@decorators.contractCallErrorHandler
public async fillOrdersUpToAsync(signedOrders: SignedOrder[], takerTokenFillAmount: BigNumber.BigNumber,
shouldCheckTransfer: boolean, takerAddress: string): Promise<BigNumber.BigNumber> {
+ assert.doesConformToSchema('signedOrders', signedOrders, signedOrdersSchema);
const takerTokenAddresses = _.map(signedOrders, signedOrder => signedOrder.takerTokenAddress);
assert.hasAtMostOneUniqueValue(takerTokenAddresses,
ExchangeContractErrs.MULTIPLE_TAKER_TOKENS_IN_FILL_UP_TO_DISALLOWED);
@@ -226,7 +227,6 @@ export class ExchangeWrapper extends ContractWrapper {
ExchangeContractErrs.BATCH_ORDERS_MUST_HAVE_SAME_EXCHANGE_ADDRESS);
assert.isBigNumber('takerTokenFillAmount', takerTokenFillAmount);
assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer);
- assert.doesConformToSchema('signedOrders', signedOrders, signedOrdersSchema);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
for (const signedOrder of signedOrders) {
await this._validateFillOrderAndThrowIfInvalidAsync(