diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-09 21:20:30 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-09 21:20:30 +0800 |
commit | b46ebc76ea727056b3fa15ad814ee9dea511f225 (patch) | |
tree | b4cf214c25245cb35c5d9f7b84fb9ce4eb9f419d /src | |
parent | 44f8d189624281b3f97926aa821faf99ad314ae5 (diff) | |
download | dexon-sol-tools-b46ebc76ea727056b3fa15ad814ee9dea511f225.tar dexon-sol-tools-b46ebc76ea727056b3fa15ad814ee9dea511f225.tar.gz dexon-sol-tools-b46ebc76ea727056b3fa15ad814ee9dea511f225.tar.bz2 dexon-sol-tools-b46ebc76ea727056b3fa15ad814ee9dea511f225.tar.lz dexon-sol-tools-b46ebc76ea727056b3fa15ad814ee9dea511f225.tar.xz dexon-sol-tools-b46ebc76ea727056b3fa15ad814ee9dea511f225.tar.zst dexon-sol-tools-b46ebc76ea727056b3fa15ad814ee9dea511f225.zip |
Add tests for TokenSchema
Diffstat (limited to 'src')
-rw-r--r-- | src/schemas/token_schema.ts | 7 | ||||
-rw-r--r-- | src/utils/schema_validator.ts | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/schemas/token_schema.ts b/src/schemas/token_schema.ts index 01702af68..383c28490 100644 --- a/src/schemas/token_schema.ts +++ b/src/schemas/token_schema.ts @@ -4,8 +4,11 @@ export const tokenSchema = { name: {type: 'string'}, symbol: {type: 'string'}, decimals: {type: 'number'}, - address: {type: 'string'}, - url: {type: 'string'}, + address: {$ref: '/addressSchema'}, + url: { + type: 'string', + format: 'uri', + }, }, required: ['name', 'symbol', 'decimals', 'address', 'url'], type: 'object', diff --git a/src/utils/schema_validator.ts b/src/utils/schema_validator.ts index 72f6afffa..755f6e715 100644 --- a/src/utils/schema_validator.ts +++ b/src/utils/schema_validator.ts @@ -1,5 +1,5 @@ import {Validator, ValidatorResult} from 'jsonschema'; -import {ecSignatureSchema, ecSignatureParameter} from '../schemas/ec_signature_schema'; +import {ecSignatureSchema, ecSignatureParameterSchema} from '../schemas/ec_signature_schema'; import {orderSchema, signedOrderSchema} from '../schemas/order_schemas'; import {addressSchema, numberSchema} from '../schemas/basic_type_schemas'; import {tokenSchema} from '../schemas/token_schema'; @@ -22,7 +22,7 @@ export class SchemaValidator { this.validator.addSchema(addressSchema, addressSchema.id); this.validator.addSchema(ecSignatureSchema, ecSignatureSchema.id); this.validator.addSchema(signedOrderSchema, signedOrderSchema.id); - this.validator.addSchema(ecSignatureParameter, ecSignatureParameter.id); + this.validator.addSchema(ecSignatureParameterSchema, ecSignatureParameterSchema.id); this.validator.addSchema(orderFillOrKillRequestsSchema, orderFillOrKillRequestsSchema.id); } public validate(instance: object, schema: Schema): ValidatorResult { |