diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-04 08:50:24 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-04-04 08:50:24 +0800 |
commit | 6c02722f56dd37dd4237248e73d070755f86f318 (patch) | |
tree | eaa9cc4ff755a86573a8227c9a0073db3072397d | |
parent | 5cfebd2680d9fb103a15381e4c2847934f9f2e42 (diff) | |
download | dexon-sol-tools-6c02722f56dd37dd4237248e73d070755f86f318.tar dexon-sol-tools-6c02722f56dd37dd4237248e73d070755f86f318.tar.gz dexon-sol-tools-6c02722f56dd37dd4237248e73d070755f86f318.tar.bz2 dexon-sol-tools-6c02722f56dd37dd4237248e73d070755f86f318.tar.lz dexon-sol-tools-6c02722f56dd37dd4237248e73d070755f86f318.tar.xz dexon-sol-tools-6c02722f56dd37dd4237248e73d070755f86f318.tar.zst dexon-sol-tools-6c02722f56dd37dd4237248e73d070755f86f318.zip |
Make deployer tests run on inprocess ganache
-rw-r--r-- | packages/deployer/package.json | 1 | ||||
-rw-r--r-- | packages/deployer/test/deployer_test.ts | 3 | ||||
-rw-r--r-- | packages/deployer/test/util/constants.ts | 1 | ||||
-rw-r--r-- | packages/deployer/test/util/provider.ts | 6 |
4 files changed, 9 insertions, 2 deletions
diff --git a/packages/deployer/package.json b/packages/deployer/package.json index f6eff9973..97c2f15b1 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -47,6 +47,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/deployer/README.md", "devDependencies": { + "@0xproject/dev-utils": "^0.3.4", "@0xproject/monorepo-scripts": "^0.1.16", "@0xproject/tslint-config": "^0.4.14", "@types/require-from-string": "^1.2.0", diff --git a/packages/deployer/test/deployer_test.ts b/packages/deployer/test/deployer_test.ts index 9c34d74aa..eadb535ab 100644 --- a/packages/deployer/test/deployer_test.ts +++ b/packages/deployer/test/deployer_test.ts @@ -8,6 +8,7 @@ import { CompilerOptions, ContractArtifact, ContractNetworkData, DoneCallback } import { constructor_args, exchange_binary } from './fixtures/exchange_bin'; import { constants } from './util/constants'; +import { provider } from './util/provider'; const expect = chai.expect; @@ -26,7 +27,7 @@ describe('#Deployer', () => { const deployerOpts = { artifactsDir, networkId: constants.networkId, - jsonrpcUrl: constants.jsonrpcUrl, + web3Provider: provider, defaults: { gasPrice: constants.gasPrice, }, diff --git a/packages/deployer/test/util/constants.ts b/packages/deployer/test/util/constants.ts index 5385b8d17..b93081a80 100644 --- a/packages/deployer/test/util/constants.ts +++ b/packages/deployer/test/util/constants.ts @@ -2,7 +2,6 @@ import { BigNumber } from '@0xproject/utils'; export const constants = { networkId: 0, - jsonrpcUrl: 'http://localhost:8545', optimizerEnabled: false, gasPrice: new BigNumber(20000000000), timeoutMs: 30000, diff --git a/packages/deployer/test/util/provider.ts b/packages/deployer/test/util/provider.ts new file mode 100644 index 000000000..bc0f55028 --- /dev/null +++ b/packages/deployer/test/util/provider.ts @@ -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; |