From 7fea7119272a1dd7033719504433357e219847c2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 29 May 2017 22:42:32 +0200 Subject: Add assertions for parameters --- src/contract_wrappers/exchange_wrapper.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/contract_wrappers') diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index ce5a7b8f2..691d465cc 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -52,7 +52,21 @@ export class ExchangeWrapper extends ContractWrapper { takerTokenAmount: BigNumber.BigNumber, makerFee: BigNumber.BigNumber, takerFee: BigNumber.BigNumber, expirationUnixTimestampSec: BigNumber.BigNumber, feeRecipient: string, fillAmount: BigNumber.BigNumber, - signatureData: ECSignature, salt: BigNumber.BigNumber) { + ecSignature: ECSignature, salt: BigNumber.BigNumber) { + assert.isBigNumber('salt', salt); + assert.isBigNumber('makerFee', makerFee); + assert.isBigNumber('takerFee', takerFee); + assert.isBigNumber('fillAmount', fillAmount); + assert.isBigNumber('makerTokenAmount', makerTokenAmount); + assert.isBigNumber('takerTokenAmount', takerTokenAmount); + assert.isBigNumber('expirationUnixTimestampSec', expirationUnixTimestampSec); + assert.isETHAddressHex('maker', maker); + assert.isETHAddressHex('taker', taker); + assert.isETHAddressHex('feeRecipient', feeRecipient); + assert.isETHAddressHex('makerTokenAddress', makerTokenAddress); + assert.isETHAddressHex('takerTokenAddress', takerTokenAddress); + assert.doesConformToSchema('ecSignature', ecSignature, ecSignatureSchema); + const senderAddress = await this.web3Wrapper.getSenderAddressOrThrowAsync(); const exchangeInstance = await this.getExchangeInstanceOrThrowAsync(); -- cgit v1.2.3