Make deployer tests run on inprocess ganache

This commit is contained in:
Fabio Berger
2018-04-04 09:50:24 +09:00
parent 5cfebd2680
commit 6c02722f56
4 changed files with 9 additions and 2 deletions

View File

@@ -47,6 +47,7 @@
}, },
"homepage": "https://github.com/0xProject/0x-monorepo/packages/deployer/README.md", "homepage": "https://github.com/0xProject/0x-monorepo/packages/deployer/README.md",
"devDependencies": { "devDependencies": {
"@0xproject/dev-utils": "^0.3.4",
"@0xproject/monorepo-scripts": "^0.1.16", "@0xproject/monorepo-scripts": "^0.1.16",
"@0xproject/tslint-config": "^0.4.14", "@0xproject/tslint-config": "^0.4.14",
"@types/require-from-string": "^1.2.0", "@types/require-from-string": "^1.2.0",

View File

@@ -8,6 +8,7 @@ import { CompilerOptions, ContractArtifact, ContractNetworkData, DoneCallback }
import { constructor_args, exchange_binary } from './fixtures/exchange_bin'; import { constructor_args, exchange_binary } from './fixtures/exchange_bin';
import { constants } from './util/constants'; import { constants } from './util/constants';
import { provider } from './util/provider';
const expect = chai.expect; const expect = chai.expect;
@@ -26,7 +27,7 @@ describe('#Deployer', () => {
const deployerOpts = { const deployerOpts = {
artifactsDir, artifactsDir,
networkId: constants.networkId, networkId: constants.networkId,
jsonrpcUrl: constants.jsonrpcUrl, web3Provider: provider,
defaults: { defaults: {
gasPrice: constants.gasPrice, gasPrice: constants.gasPrice,
}, },

View File

@@ -2,7 +2,6 @@ import { BigNumber } from '@0xproject/utils';
export const constants = { export const constants = {
networkId: 0, networkId: 0,
jsonrpcUrl: 'http://localhost:8545',
optimizerEnabled: false, optimizerEnabled: false,
gasPrice: new BigNumber(20000000000), gasPrice: new BigNumber(20000000000),
timeoutMs: 30000, timeoutMs: 30000,

View File

@@ -0,0 +1,6 @@
import { web3Factory } from '@0xproject/dev-utils';
import * as Web3 from 'web3';
const web3ProviderConfig = { shouldUseInProcessGanache: true };
const web3Instance = web3Factory.create(web3ProviderConfig);
export const provider = web3Instance.currentProvider;