From db419ffcc76eb4e11f84aad3a51efe7fa900ef57 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 28 Sep 2017 14:42:48 +0200 Subject: Add tests for ropsten artifacts --- test/artifacts_test.ts | 17 +++++++++++++++++ test/utils/constants.ts | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/artifacts_test.ts b/test/artifacts_test.ts index bd34a6b91..b2866a1d6 100644 --- a/test/artifacts_test.ts +++ b/test/artifacts_test.ts @@ -29,4 +29,21 @@ describe('Artifacts', () => { await zeroEx.exchange.getContractAddressAsync(); }).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); + }); }); diff --git a/test/utils/constants.ts b/test/utils/constants.ts index b677d7361..c7d3aebca 100644 --- a/test/utils/constants.ts +++ b/test/utils/constants.ts @@ -3,5 +3,6 @@ export const constants = { RPC_HOST: 'localhost', RPC_PORT: 8545, 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', }; -- cgit v1.2.3