diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-30 21:03:54 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-30 23:01:37 +0800 |
commit | 6205209fbbb5dbebbf225e1cef76c3e86117d356 (patch) | |
tree | f9b352e759ff030686c532c3b6e37c320907813a | |
parent | 6ebf8a57d18f273a9f1b04c7d2d5d8f7171eea96 (diff) | |
download | dexon-sol-tools-6205209fbbb5dbebbf225e1cef76c3e86117d356.tar dexon-sol-tools-6205209fbbb5dbebbf225e1cef76c3e86117d356.tar.gz dexon-sol-tools-6205209fbbb5dbebbf225e1cef76c3e86117d356.tar.bz2 dexon-sol-tools-6205209fbbb5dbebbf225e1cef76c3e86117d356.tar.lz dexon-sol-tools-6205209fbbb5dbebbf225e1cef76c3e86117d356.tar.xz dexon-sol-tools-6205209fbbb5dbebbf225e1cef76c3e86117d356.tar.zst dexon-sol-tools-6205209fbbb5dbebbf225e1cef76c3e86117d356.zip |
Make an RPC constructor param implicit
23 files changed, 27 insertions, 26 deletions
diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts index 6f8c4139a..5ebb68c8c 100644 --- a/packages/0x.js/test/0x.js_test.ts +++ b/packages/0x.js/test/0x.js_test.ts @@ -11,7 +11,7 @@ import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; import { TokenUtils } from './utils/token_utils'; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/0x.js/test/ether_token_wrapper_test.ts b/packages/0x.js/test/ether_token_wrapper_test.ts index e0f18f26f..6069b42bf 100644 --- a/packages/0x.js/test/ether_token_wrapper_test.ts +++ b/packages/0x.js/test/ether_token_wrapper_test.ts @@ -27,7 +27,7 @@ import { TokenUtils } from './utils/token_utils'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); // Since the address depositing/withdrawing ETH/WETH also needs to pay gas costs for the transaction, // a small amount of ETH will be used to pay this gas cost. We therefore check that the difference between diff --git a/packages/0x.js/test/exchange_transfer_simulator_test.ts b/packages/0x.js/test/exchange_transfer_simulator_test.ts index 4bbdecb60..e85a1640f 100644 --- a/packages/0x.js/test/exchange_transfer_simulator_test.ts +++ b/packages/0x.js/test/exchange_transfer_simulator_test.ts @@ -11,7 +11,7 @@ import { constants } from './utils/constants'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('ExchangeTransferSimulator', () => { const web3 = web3Factory.create(); diff --git a/packages/0x.js/test/exchange_wrapper_test.ts b/packages/0x.js/test/exchange_wrapper_test.ts index 016ef08ce..c15cd65a9 100644 --- a/packages/0x.js/test/exchange_wrapper_test.ts +++ b/packages/0x.js/test/exchange_wrapper_test.ts @@ -28,7 +28,7 @@ import { TokenUtils } from './utils/token_utils'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); const NON_EXISTENT_ORDER_HASH = '0x79370342234e7acd6bbeac335bd3bb1d368383294b64b8160a00f4060e4d3777'; diff --git a/packages/0x.js/test/expiration_watcher_test.ts b/packages/0x.js/test/expiration_watcher_test.ts index 90fb20a52..b49dee8e5 100644 --- a/packages/0x.js/test/expiration_watcher_test.ts +++ b/packages/0x.js/test/expiration_watcher_test.ts @@ -19,7 +19,7 @@ import { TokenUtils } from './utils/token_utils'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('ExpirationWatcher', () => { let web3: Web3; diff --git a/packages/0x.js/test/order_state_watcher_test.ts b/packages/0x.js/test/order_state_watcher_test.ts index 79b43f433..9e2ad89e1 100644 --- a/packages/0x.js/test/order_state_watcher_test.ts +++ b/packages/0x.js/test/order_state_watcher_test.ts @@ -27,7 +27,7 @@ const TIMEOUT_MS = 150; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('OrderStateWatcher', () => { let web3: Web3; diff --git a/packages/0x.js/test/order_validation_test.ts b/packages/0x.js/test/order_validation_test.ts index 23fe957fe..934e2e51f 100644 --- a/packages/0x.js/test/order_validation_test.ts +++ b/packages/0x.js/test/order_validation_test.ts @@ -16,7 +16,7 @@ import { TokenUtils } from './utils/token_utils'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('OrderValidation', () => { let web3: Web3; diff --git a/packages/0x.js/test/subscription_test.ts b/packages/0x.js/test/subscription_test.ts index 60a4f7ec9..f485bf84b 100644 --- a/packages/0x.js/test/subscription_test.ts +++ b/packages/0x.js/test/subscription_test.ts @@ -13,7 +13,7 @@ import { constants } from './utils/constants'; import { assertNodeCallbackError } from './utils/report_callback_errors'; chaiSetup.configure(); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('SubscriptionTest', () => { let web3: Web3; diff --git a/packages/0x.js/test/token_registry_wrapper_test.ts b/packages/0x.js/test/token_registry_wrapper_test.ts index 396de5193..fefb99b16 100644 --- a/packages/0x.js/test/token_registry_wrapper_test.ts +++ b/packages/0x.js/test/token_registry_wrapper_test.ts @@ -11,7 +11,7 @@ import { constants } from './utils/constants'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); const TOKEN_REGISTRY_SIZE_AFTER_MIGRATION = 7; diff --git a/packages/0x.js/test/token_wrapper_test.ts b/packages/0x.js/test/token_wrapper_test.ts index 8b8f19297..070d6ec47 100644 --- a/packages/0x.js/test/token_wrapper_test.ts +++ b/packages/0x.js/test/token_wrapper_test.ts @@ -25,7 +25,7 @@ import { TokenUtils } from './utils/token_utils'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('TokenWrapper', () => { let web3: Web3; diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index 2bcc0e2c5..4c70534ee 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -14,7 +14,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('EtherToken', () => { let account: string; diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index f2e330507..0db4be830 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -27,7 +27,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('Exchange', () => { let maker: string; diff --git a/packages/contracts/test/exchange/helpers.ts b/packages/contracts/test/exchange/helpers.ts index a4707452e..047ab899a 100644 --- a/packages/contracts/test/exchange/helpers.ts +++ b/packages/contracts/test/exchange/helpers.ts @@ -18,7 +18,7 @@ const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('Exchange', () => { let maker: string; diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index c749c016e..43cb622ac 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -19,7 +19,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('Exchange', () => { let maker: string; diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index eee923020..bd64be1ba 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -1,5 +1,5 @@ import { LogWithDecodedArgs, ZeroEx } from '0x.js'; -import { BlockchainLifecycle, devConstants, RPC, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle, RPC, web3Factory } from '@0xproject/dev-utils'; import { AbiDecoder, BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; @@ -20,7 +20,7 @@ const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); const zeroEx = new ZeroEx(web3.currentProvider, { networkId: constants.TESTRPC_NETWORK_ID }); const abiDecoder = new AbiDecoder([MULTI_SIG_ABI]); @@ -40,7 +40,7 @@ describe('MultiSigWalletWithTimeLock', () => { let rpc: RPC; before(async () => { - rpc = new RPC(devConstants.RPC_URL); + rpc = new RPC(); }); beforeEach(async () => { await blockchainLifecycle.startAsync(); diff --git a/packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts b/packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts index 826815265..06f30ffdc 100644 --- a/packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts +++ b/packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts @@ -22,7 +22,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); const abiDecoder = new AbiDecoder([MUTISIG_WALLET_WITH_TIME_LOCK_EXCEPT_REMOVE_AUTHORIZED_ADDRESS_ABI]); describe('MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', () => { diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts index f84a99e8f..2a270dc2f 100644 --- a/packages/contracts/test/token_registry.ts +++ b/packages/contracts/test/token_registry.ts @@ -17,7 +17,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('TokenRegistry', () => { let owner: string; diff --git a/packages/contracts/test/token_transfer_proxy/auth.ts b/packages/contracts/test/token_transfer_proxy/auth.ts index 52e7d3f02..b2bfc6b65 100644 --- a/packages/contracts/test/token_transfer_proxy/auth.ts +++ b/packages/contracts/test/token_transfer_proxy/auth.ts @@ -12,7 +12,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('TokenTransferProxy', () => { let owner: string; diff --git a/packages/contracts/test/token_transfer_proxy/transfer_from.ts b/packages/contracts/test/token_transfer_proxy/transfer_from.ts index 3e88d9432..bd7adcfae 100644 --- a/packages/contracts/test/token_transfer_proxy/transfer_from.ts +++ b/packages/contracts/test/token_transfer_proxy/transfer_from.ts @@ -13,7 +13,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('TokenTransferProxy', () => { let accounts: string[]; diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index 1c66c39b8..7f4fef987 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -15,7 +15,7 @@ const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('UnlimitedAllowanceToken', () => { let owner: string; diff --git a/packages/contracts/test/unlimited_allowance_token_v2.ts b/packages/contracts/test/unlimited_allowance_token_v2.ts index a36e44154..440cc11ac 100644 --- a/packages/contracts/test/unlimited_allowance_token_v2.ts +++ b/packages/contracts/test/unlimited_allowance_token_v2.ts @@ -15,7 +15,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('UnlimitedAllowanceTokenV2', () => { const config = { diff --git a/packages/contracts/test/zrx_token.ts b/packages/contracts/test/zrx_token.ts index 2caef7da8..1844a67af 100644 --- a/packages/contracts/test/zrx_token.ts +++ b/packages/contracts/test/zrx_token.ts @@ -15,7 +15,7 @@ chaiSetup.configure(); const expect = chai.expect; const web3 = web3Factory.create(); const web3Wrapper = new Web3Wrapper(web3.currentProvider); -const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); +const blockchainLifecycle = new BlockchainLifecycle(); describe('ZRXToken', () => { let owner: string; diff --git a/packages/dev-utils/src/blockchain_lifecycle.ts b/packages/dev-utils/src/blockchain_lifecycle.ts index 18f5d5c61..bb4908a0d 100644 --- a/packages/dev-utils/src/blockchain_lifecycle.ts +++ b/packages/dev-utils/src/blockchain_lifecycle.ts @@ -1,10 +1,11 @@ +import { constants } from './constants'; import { RPC } from './rpc'; export class BlockchainLifecycle { private _rpc: RPC; private _snapshotIdsStack: number[]; - constructor(url: string) { - this._rpc = new RPC(url); + constructor() { + this._rpc = new RPC(constants.RPC_URL); this._snapshotIdsStack = []; } // TODO: In order to run these tests on an actual node, we should check if we are running against |