Make an RPC constructor param implicit
This commit is contained in:
		| @@ -11,7 +11,7 @@ import { chaiSetup } from './utils/chai_setup'; | |||||||
| import { constants } from './utils/constants'; | import { constants } from './utils/constants'; | ||||||
| import { TokenUtils } from './utils/token_utils'; | import { TokenUtils } from './utils/token_utils'; | ||||||
|  |  | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ import { TokenUtils } from './utils/token_utils'; | |||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | 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, | // 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 | // a small amount of ETH will be used to pay this gas cost. We therefore check that the difference between | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ import { constants } from './utils/constants'; | |||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('ExchangeTransferSimulator', () => { | describe('ExchangeTransferSimulator', () => { | ||||||
|     const web3 = web3Factory.create(); |     const web3 = web3Factory.create(); | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ import { TokenUtils } from './utils/token_utils'; | |||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| const NON_EXISTENT_ORDER_HASH = '0x79370342234e7acd6bbeac335bd3bb1d368383294b64b8160a00f4060e4d3777'; | const NON_EXISTENT_ORDER_HASH = '0x79370342234e7acd6bbeac335bd3bb1d368383294b64b8160a00f4060e4d3777'; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ import { TokenUtils } from './utils/token_utils'; | |||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('ExpirationWatcher', () => { | describe('ExpirationWatcher', () => { | ||||||
|     let web3: Web3; |     let web3: Web3; | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ const TIMEOUT_MS = 150; | |||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('OrderStateWatcher', () => { | describe('OrderStateWatcher', () => { | ||||||
|     let web3: Web3; |     let web3: Web3; | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ import { TokenUtils } from './utils/token_utils'; | |||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('OrderValidation', () => { | describe('OrderValidation', () => { | ||||||
|     let web3: Web3; |     let web3: Web3; | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ import { constants } from './utils/constants'; | |||||||
| import { assertNodeCallbackError } from './utils/report_callback_errors'; | import { assertNodeCallbackError } from './utils/report_callback_errors'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('SubscriptionTest', () => { | describe('SubscriptionTest', () => { | ||||||
|     let web3: Web3; |     let web3: Web3; | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ import { constants } from './utils/constants'; | |||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| const TOKEN_REGISTRY_SIZE_AFTER_MIGRATION = 7; | const TOKEN_REGISTRY_SIZE_AFTER_MIGRATION = 7; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ import { TokenUtils } from './utils/token_utils'; | |||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('TokenWrapper', () => { | describe('TokenWrapper', () => { | ||||||
|     let web3: Web3; |     let web3: Web3; | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('EtherToken', () => { | describe('EtherToken', () => { | ||||||
|     let account: string; |     let account: string; | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('Exchange', () => { | describe('Exchange', () => { | ||||||
|     let maker: string; |     let maker: string; | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ const expect = chai.expect; | |||||||
|  |  | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('Exchange', () => { | describe('Exchange', () => { | ||||||
|     let maker: string; |     let maker: string; | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('Exchange', () => { | describe('Exchange', () => { | ||||||
|     let maker: string; |     let maker: string; | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| import { LogWithDecodedArgs, ZeroEx } from '0x.js'; | 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 { AbiDecoder, BigNumber } from '@0xproject/utils'; | ||||||
| import { Web3Wrapper } from '@0xproject/web3-wrapper'; | import { Web3Wrapper } from '@0xproject/web3-wrapper'; | ||||||
| import * as chai from 'chai'; | import * as chai from 'chai'; | ||||||
| @@ -20,7 +20,7 @@ const expect = chai.expect; | |||||||
|  |  | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | 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 zeroEx = new ZeroEx(web3.currentProvider, { networkId: constants.TESTRPC_NETWORK_ID }); | ||||||
| const abiDecoder = new AbiDecoder([MULTI_SIG_ABI]); | const abiDecoder = new AbiDecoder([MULTI_SIG_ABI]); | ||||||
|  |  | ||||||
| @@ -40,7 +40,7 @@ describe('MultiSigWalletWithTimeLock', () => { | |||||||
|     let rpc: RPC; |     let rpc: RPC; | ||||||
|  |  | ||||||
|     before(async () => { |     before(async () => { | ||||||
|         rpc = new RPC(devConstants.RPC_URL); |         rpc = new RPC(); | ||||||
|     }); |     }); | ||||||
|     beforeEach(async () => { |     beforeEach(async () => { | ||||||
|         await blockchainLifecycle.startAsync(); |         await blockchainLifecycle.startAsync(); | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | 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]); | const abiDecoder = new AbiDecoder([MUTISIG_WALLET_WITH_TIME_LOCK_EXCEPT_REMOVE_AUTHORIZED_ADDRESS_ABI]); | ||||||
|  |  | ||||||
| describe('MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', () => { | describe('MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', () => { | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('TokenRegistry', () => { | describe('TokenRegistry', () => { | ||||||
|     let owner: string; |     let owner: string; | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('TokenTransferProxy', () => { | describe('TokenTransferProxy', () => { | ||||||
|     let owner: string; |     let owner: string; | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('TokenTransferProxy', () => { | describe('TokenTransferProxy', () => { | ||||||
|     let accounts: string[]; |     let accounts: string[]; | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ const web3 = web3Factory.create(); | |||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('UnlimitedAllowanceToken', () => { | describe('UnlimitedAllowanceToken', () => { | ||||||
|     let owner: string; |     let owner: string; | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('UnlimitedAllowanceTokenV2', () => { | describe('UnlimitedAllowanceTokenV2', () => { | ||||||
|     const config = { |     const config = { | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ chaiSetup.configure(); | |||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const web3 = web3Factory.create(); | const web3 = web3Factory.create(); | ||||||
| const web3Wrapper = new Web3Wrapper(web3.currentProvider); | const web3Wrapper = new Web3Wrapper(web3.currentProvider); | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|  |  | ||||||
| describe('ZRXToken', () => { | describe('ZRXToken', () => { | ||||||
|     let owner: string; |     let owner: string; | ||||||
|   | |||||||
| @@ -1,10 +1,11 @@ | |||||||
|  | import { constants } from './constants'; | ||||||
| import { RPC } from './rpc'; | import { RPC } from './rpc'; | ||||||
|  |  | ||||||
| export class BlockchainLifecycle { | export class BlockchainLifecycle { | ||||||
|     private _rpc: RPC; |     private _rpc: RPC; | ||||||
|     private _snapshotIdsStack: number[]; |     private _snapshotIdsStack: number[]; | ||||||
|     constructor(url: string) { |     constructor() { | ||||||
|         this._rpc = new RPC(url); |         this._rpc = new RPC(constants.RPC_URL); | ||||||
|         this._snapshotIdsStack = []; |         this._snapshotIdsStack = []; | ||||||
|     } |     } | ||||||
|     // TODO: In order to run these tests on an actual node, we should check if we are running against |     // TODO: In order to run these tests on an actual node, we should check if we are running against | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user