diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-05-30 04:42:32 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-05-30 04:42:32 +0800 |
commit | 7fea7119272a1dd7033719504433357e219847c2 (patch) | |
tree | 77be085b93b563b3dd47a88d4eb206659cebdb5a /src/contract_wrappers/exchange_wrapper.ts | |
parent | b46ad44856fd3744d90562426356283c90db4fc1 (diff) | |
download | dexon-sol-tools-7fea7119272a1dd7033719504433357e219847c2.tar dexon-sol-tools-7fea7119272a1dd7033719504433357e219847c2.tar.gz dexon-sol-tools-7fea7119272a1dd7033719504433357e219847c2.tar.bz2 dexon-sol-tools-7fea7119272a1dd7033719504433357e219847c2.tar.lz dexon-sol-tools-7fea7119272a1dd7033719504433357e219847c2.tar.xz dexon-sol-tools-7fea7119272a1dd7033719504433357e219847c2.tar.zst dexon-sol-tools-7fea7119272a1dd7033719504433357e219847c2.zip |
Add assertions for parameters
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 16 |
1 files changed, 15 insertions, 1 deletions
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(); |