aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-09 00:33:19 +0800
committerGitHub <noreply@github.com>2017-06-09 00:33:19 +0800
commitc94485dfbba388f481ca6c10bd62b863d7429223 (patch)
tree1faaa6e52e941831034469c9bc56a47bfc9a6a19 /src/utils
parent7f6a6dd18983980c08c53b2b561ec57dfaed755f (diff)
parent743ba29918715e21c7891b3c7426dcb5fdc14e17 (diff)
downloaddexon-sol-tools-c94485dfbba388f481ca6c10bd62b863d7429223.tar
dexon-sol-tools-c94485dfbba388f481ca6c10bd62b863d7429223.tar.gz
dexon-sol-tools-c94485dfbba388f481ca6c10bd62b863d7429223.tar.bz2
dexon-sol-tools-c94485dfbba388f481ca6c10bd62b863d7429223.tar.lz
dexon-sol-tools-c94485dfbba388f481ca6c10bd62b863d7429223.tar.xz
dexon-sol-tools-c94485dfbba388f481ca6c10bd62b863d7429223.tar.zst
dexon-sol-tools-c94485dfbba388f481ca6c10bd62b863d7429223.zip
Merge branch 'master' into fillOrderUpToAsync
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/schema_validator.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/utils/schema_validator.ts b/src/utils/schema_validator.ts
index 932ddf62a..72f6afffa 100644
--- a/src/utils/schema_validator.ts
+++ b/src/utils/schema_validator.ts
@@ -1,7 +1,9 @@
import {Validator, ValidatorResult} from 'jsonschema';
import {ecSignatureSchema, ecSignatureParameter} from '../schemas/ec_signature_schema';
-import {addressSchema, numberSchema, orderSchema, signedOrderSchema} from '../schemas/order_schemas';
+import {orderSchema, signedOrderSchema} from '../schemas/order_schemas';
+import {addressSchema, numberSchema} from '../schemas/basic_type_schemas';
import {tokenSchema} from '../schemas/token_schema';
+import {orderFillOrKillRequestsSchema} from '../schemas/order_fill_or_kill_requests_schema';
export class SchemaValidator {
private validator: Validator;
@@ -9,7 +11,7 @@ export class SchemaValidator {
// sub-types (e.g BigNumber) with a simpler string representation. Since BigNumber and other
// complex types implement the `toString` method, we can stringify the object and
// then parse it. The resultant object can then be checked using jsonschema.
- public static convertToJSONSchemaCompatibleObject(obj: object): object {
+ public static convertToJSONSchemaCompatibleObject(obj: any): any {
return JSON.parse(JSON.stringify(obj));
}
constructor() {
@@ -21,6 +23,7 @@ export class SchemaValidator {
this.validator.addSchema(ecSignatureSchema, ecSignatureSchema.id);
this.validator.addSchema(signedOrderSchema, signedOrderSchema.id);
this.validator.addSchema(ecSignatureParameter, ecSignatureParameter.id);
+ this.validator.addSchema(orderFillOrKillRequestsSchema, orderFillOrKillRequestsSchema.id);
}
public validate(instance: object, schema: Schema): ValidatorResult {
return this.validator.validate(instance, schema);