aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-01 20:46:09 +0800
committerFabio Berger <me@fabioberger.com>2017-06-01 20:46:09 +0800
commitc74b16eda9465104e1969b1635ac826835d203eb (patch)
treeecf750865f425d65a830fb786359ad07451a805c /src/contract_wrappers/exchange_wrapper.ts
parent0991191a9b6c00fac80cd9f5ffa8e76c62f82eb5 (diff)
downloaddexon-sol-tools-c74b16eda9465104e1969b1635ac826835d203eb.tar
dexon-sol-tools-c74b16eda9465104e1969b1635ac826835d203eb.tar.gz
dexon-sol-tools-c74b16eda9465104e1969b1635ac826835d203eb.tar.bz2
dexon-sol-tools-c74b16eda9465104e1969b1635ac826835d203eb.tar.lz
dexon-sol-tools-c74b16eda9465104e1969b1635ac826835d203eb.tar.xz
dexon-sol-tools-c74b16eda9465104e1969b1635ac826835d203eb.tar.zst
dexon-sol-tools-c74b16eda9465104e1969b1635ac826835d203eb.zip
Add convertToJSONSchemaCompatibleObject method
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 754210778..59e6c755e 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -14,6 +14,7 @@ import {ContractWrapper} from './contract_wrapper';
import * as ExchangeArtifacts from '../artifacts/Exchange.json';
import {ecSignatureSchema} from '../schemas/ec_signature_schema';
import {signedOrderSchema} from '../schemas/signed_order_schema';
+import {SchemaValidator} from '../utils/schema_validator';
import {ContractResponse} from '../types';
import {constants} from '../utils/constants';
@@ -56,7 +57,9 @@ export class ExchangeWrapper extends ContractWrapper {
}
public async fillOrderAsync(signedOrder: SignedOrder, fillAmount: BigNumber.BigNumber,
shouldCheckTransfer: boolean = true): Promise<void> {
- assert.doesConformToSchema('signedOrder', JSON.parse(JSON.stringify(signedOrder)), signedOrderSchema);
+ assert.doesConformToSchema('signedOrder',
+ SchemaValidator.convertToJSONSchemaCompatibleObject(signedOrder as object),
+ signedOrderSchema);
assert.isBigNumber('fillAmount', fillAmount);
assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer);