diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-23 18:03:40 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-23 18:03:40 +0800 |
commit | 3f962585e9924a88082e91153cf3347922046941 (patch) | |
tree | 9e779472da466b79cc3b0ff7680d64d0156d87b4 /test | |
parent | dcd08e40e61f5d98f03d71dc588e379f44817758 (diff) | |
download | dexon-sol-tools-3f962585e9924a88082e91153cf3347922046941.tar dexon-sol-tools-3f962585e9924a88082e91153cf3347922046941.tar.gz dexon-sol-tools-3f962585e9924a88082e91153cf3347922046941.tar.bz2 dexon-sol-tools-3f962585e9924a88082e91153cf3347922046941.tar.lz dexon-sol-tools-3f962585e9924a88082e91153cf3347922046941.tar.xz dexon-sol-tools-3f962585e9924a88082e91153cf3347922046941.tar.zst dexon-sol-tools-3f962585e9924a88082e91153cf3347922046941.zip |
Refactor KOVAN_URL to constants and fetch mnemonic from package.json
Diffstat (limited to 'test')
-rw-r--r-- | test/artifacts_test.ts | 8 | ||||
-rw-r--r-- | test/utils/constants.ts | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/test/artifacts_test.ts b/test/artifacts_test.ts index 937d2674d..74705a525 100644 --- a/test/artifacts_test.ts +++ b/test/artifacts_test.ts @@ -1,3 +1,4 @@ +import * as fs from 'fs'; import * as _ from 'lodash'; import * as chai from 'chai'; import * as BigNumber from 'bignumber.js'; @@ -6,6 +7,7 @@ import {chaiSetup} from './utils/chai_setup'; import {ZeroEx, Order} from '../src'; import {web3Factory} from './utils/web3_factory'; import {FillScenarios} from './utils/fill_scenarios'; +import {constants} from './utils/constants'; chaiSetup.configure(); const expect = chai.expect; @@ -15,8 +17,10 @@ const TIMEOUT = 10000; describe('Artifacts', () => { describe('contracts are deployed on kovan', () => { - const kovanRpcUrl = 'https://kovan.0xproject.com'; - const mnemonic = 'concert load couple harbor equip island argue ramp clarify fence smart topic'; + const kovanRpcUrl = constants.KOVAN_URL; + const packageJSONContent = fs.readFileSync('package.json', 'utf-8'); + const packageJSON = JSON.parse(packageJSONContent); + const mnemonic = packageJSON.config.mnemonic; const web3Provider = new HDWalletProvider(mnemonic, kovanRpcUrl); const zeroEx = new ZeroEx(web3Provider); it('token registry contract is deployed', async () => { diff --git a/test/utils/constants.ts b/test/utils/constants.ts index aa1967f88..8211eea00 100644 --- a/test/utils/constants.ts +++ b/test/utils/constants.ts @@ -2,4 +2,5 @@ export const constants = { NULL_ADDRESS: '0x0000000000000000000000000000000000000000', RPC_HOST: 'localhost', RPC_PORT: 8545, + KOVAN_URL: 'https://kovan.0xproject.com', }; |