diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-28 22:47:49 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-28 22:49:57 +0800 |
commit | 96da2c26dceca03340a213baae5a490df2f7183c (patch) | |
tree | 6c984b77c1cd5ca312310d7f72ad4b512ecb9df5 /test/token_registry_wrapper_test.ts | |
parent | 0afc95982b195378653e15697f65d4ad3bf48e66 (diff) | |
download | dexon-0x-contracts-96da2c26dceca03340a213baae5a490df2f7183c.tar.gz dexon-0x-contracts-96da2c26dceca03340a213baae5a490df2f7183c.tar.zst dexon-0x-contracts-96da2c26dceca03340a213baae5a490df2f7183c.zip |
Use 0x-json-schemas
Diffstat (limited to 'test/token_registry_wrapper_test.ts')
-rw-r--r-- | test/token_registry_wrapper_test.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/token_registry_wrapper_test.ts b/test/token_registry_wrapper_test.ts index e1702cd45..6b5dd517e 100644 --- a/test/token_registry_wrapper_test.ts +++ b/test/token_registry_wrapper_test.ts @@ -1,13 +1,11 @@ import * as _ from 'lodash'; import 'mocha'; import * as chai from 'chai'; +import {SchemaValidator, schemas} from '0x-json-schemas'; import {chaiSetup} from './utils/chai_setup'; import {web3Factory} from './utils/web3_factory'; import {ZeroEx, Token} from '../src'; import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; -import {SchemaValidator} from '../src/utils/schema_validator'; -import {tokenSchema} from '../src/schemas/token_schema'; -import {addressSchema} from '../src/schemas/basic_type_schemas'; chaiSetup.configure(); const expect = chai.expect; @@ -49,7 +47,7 @@ describe('TokenRegistryWrapper', () => { const schemaValidator = new SchemaValidator(); _.each(tokens, token => { - const validationResult = schemaValidator.validate(token, tokenSchema); + const validationResult = schemaValidator.validate(token, schemas.tokenSchema); expect(validationResult.errors).to.have.lengthOf(0); }); }); @@ -61,7 +59,7 @@ describe('TokenRegistryWrapper', () => { const schemaValidator = new SchemaValidator(); _.each(tokenAddresses, tokenAddress => { - const validationResult = schemaValidator.validate(tokenAddress, addressSchema); + const validationResult = schemaValidator.validate(tokenAddress, schemas.addressSchema); expect(validationResult.errors).to.have.lengthOf(0); expect(tokenAddress).to.not.be.equal(ZeroEx.NULL_ADDRESS); }); @@ -113,7 +111,7 @@ describe('TokenRegistryWrapper', () => { const token = await zeroEx.tokenRegistry.getTokenIfExistsAsync(aToken.address); const schemaValidator = new SchemaValidator(); - const validationResult = schemaValidator.validate(token, tokenSchema); + const validationResult = schemaValidator.validate(token, schemas.tokenSchema); expect(validationResult.errors).to.have.lengthOf(0); }); it('should return return undefined when passed a token address not in the tokenRegistry', async () => { |