Add tests for ropsten artifacts

This commit is contained in:
Leonid Logvinov
2017-09-28 14:42:48 +02:00
parent b537636b42
commit db419ffcc7
2 changed files with 19 additions and 1 deletions

View File

@@ -29,4 +29,21 @@ describe('Artifacts', () => {
await zeroEx.exchange.getContractAddressAsync(); await zeroEx.exchange.getContractAddressAsync();
}).timeout(TIMEOUT); }).timeout(TIMEOUT);
}); });
describe('contracts are deployed on ropsten', () => {
const ropstenRpcUrl = constants.ROPSTEN_RPC_URL;
const packageJSONContent = fs.readFileSync('package.json', 'utf-8');
const packageJSON = JSON.parse(packageJSONContent);
const mnemonic = packageJSON.config.mnemonic;
const web3Provider = new HDWalletProvider(mnemonic, ropstenRpcUrl);
const zeroEx = new ZeroEx(web3Provider);
it('token registry contract is deployed', async () => {
await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync();
}).timeout(TIMEOUT);
it('proxy contract is deployed', async () => {
await (zeroEx.token as any)._getTokenTransferProxyAddressAsync();
}).timeout(TIMEOUT);
it('exchange contract is deployed', async () => {
await zeroEx.exchange.getContractAddressAsync();
}).timeout(TIMEOUT);
});
}); });

View File

@@ -3,5 +3,6 @@ export const constants = {
RPC_HOST: 'localhost', RPC_HOST: 'localhost',
RPC_PORT: 8545, RPC_PORT: 8545,
TESTRPC_NETWORK_ID: 50, TESTRPC_NETWORK_ID: 50,
KOVAN_RPC_URL: 'https://kovan.0xproject.com', KOVAN_RPC_URL: 'https://kovan.infura.io',
ROPSTEN_RPC_URL: 'https://ropsten.infura.io',
}; };