aboutsummaryrefslogtreecommitdiffstats
path: root/test/token_registry_wrapper_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/token_registry_wrapper_test.ts')
-rw-r--r--test/token_registry_wrapper_test.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/token_registry_wrapper_test.ts b/test/token_registry_wrapper_test.ts
index 6b5640c6c..2b0873245 100644
--- a/test/token_registry_wrapper_test.ts
+++ b/test/token_registry_wrapper_test.ts
@@ -7,6 +7,7 @@ import {ZeroEx} 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;
@@ -38,6 +39,19 @@ describe('TokenRegistryWrapper', () => {
});
});
});
+ describe('#getTokenAddressesAsync', () => {
+ it('should return all the token addresses added to the tokenRegistry during the migration', async () => {
+ const tokenAddresses = await zeroEx.tokenRegistry.getTokenAddressesAsync();
+ expect(tokenAddresses).to.have.lengthOf(TOKEN_REGISTRY_SIZE_AFTER_MIGRATION);
+
+ const schemaValidator = new SchemaValidator();
+ _.each(tokenAddresses, tokenAddress => {
+ const validationResult = schemaValidator.validate(tokenAddress, addressSchema);
+ expect(validationResult.errors).to.have.lengthOf(0);
+ expect(tokenAddress).to.not.be.equal(ZeroEx.NULL_ADDRESS);
+ });
+ });
+ });
describe('#getTokenIfExistsAsync', () => {
it('should return the token added to the tokenRegistry during the migration', async () => {
const tokens = await zeroEx.tokenRegistry.getTokensAsync();