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 { TokenUtils } from './utils/token_utils';
|
||||
|
||||
const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user