aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 01:27:31 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 01:27:31 +0800
commitb1c7291d3cfffb11a13c50a518f2b895bcdc9fc5 (patch)
tree72fe9bb7fc42e4dc3ec6c55483d7acb1406da8eb /src/contract_wrappers
parent5611df82f9f276fb161fa268f7ab468a6c1d7784 (diff)
downloaddexon-0x-contracts-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.tar.gz
dexon-0x-contracts-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.tar.zst
dexon-0x-contracts-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.zip
Use orderHashSchema to validate order hash
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index c249248f6..6a85e2592 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -43,7 +43,7 @@ import {signedOrdersSchema} from '../schemas/signed_orders_schema';
import {orderFillRequestsSchema} from '../schemas/order_fill_requests_schema';
import {orderCancellationRequestsSchema} from '../schemas/order_cancel_schema';
import {orderFillOrKillRequestsSchema} from '../schemas/order_fill_or_kill_requests_schema';
-import {signedOrderSchema, orderSchema} from '../schemas/order_schemas';
+import {signedOrderSchema, orderSchema, orderHashSchema} from '../schemas/order_schemas';
import {constants} from '../utils/constants';
import {TokenWrapper} from './token_wrapper';
import {decorators} from '../utils/decorators';
@@ -105,7 +105,7 @@ export class ExchangeWrapper extends ContractWrapper {
*/
public async getUnavailableTakerAmountAsync(orderHash: string,
exchangeContractAddress: string): Promise<BigNumber.BigNumber> {
- assert.isValidOrderHash('orderHash', orderHash);
+ assert.doesConformToSchema('orderHash', orderHash, orderHashSchema);
const exchangeContract = await this._getExchangeContractAsync(exchangeContractAddress);
let unavailableAmountInBaseUnits = await exchangeContract.getUnavailableValueT.call(orderHash);
@@ -121,7 +121,7 @@ export class ExchangeWrapper extends ContractWrapper {
*/
public async getFilledTakerAmountAsync(orderHash: string,
exchangeContractAddress: string): Promise<BigNumber.BigNumber> {
- assert.isValidOrderHash('orderHash', orderHash);
+ assert.doesConformToSchema('orderHash', orderHash, orderHashSchema);
const exchangeContract = await this._getExchangeContractAsync(exchangeContractAddress);
let fillAmountInBaseUnits = await exchangeContract.filled.call(orderHash);
@@ -138,7 +138,7 @@ export class ExchangeWrapper extends ContractWrapper {
*/
public async getCanceledTakerAmountAsync(orderHash: string,
exchangeContractAddress: string): Promise<BigNumber.BigNumber> {
- assert.isValidOrderHash('orderHash', orderHash);
+ assert.doesConformToSchema('orderHash', orderHash, orderHashSchema);
const exchangeContract = await this._getExchangeContractAsync(exchangeContractAddress);
let cancelledAmountInBaseUnits = await exchangeContract.cancelled.call(orderHash);