Add assertions for parameters

This commit is contained in:
Leonid Logvinov 2017-05-29 22:42:32 +02:00
parent b46ad44856
commit 7fea711927
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4

View File

@ -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();