aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer
diff options
context:
space:
mode:
Diffstat (limited to 'packages/deployer')
-rw-r--r--packages/deployer/CHANGELOG.json3
-rw-r--r--packages/deployer/CHANGELOG.md4
-rw-r--r--packages/deployer/package.json20
-rw-r--r--packages/deployer/src/cli.ts4
-rw-r--r--packages/deployer/src/deployer.ts12
-rw-r--r--packages/deployer/test/deployer_test.ts3
-rw-r--r--packages/deployer/test/util/constants.ts1
-rw-r--r--packages/deployer/test/util/provider.ts9
8 files changed, 35 insertions, 21 deletions
diff --git a/packages/deployer/CHANGELOG.json b/packages/deployer/CHANGELOG.json
index f9691466b..b130405dc 100644
--- a/packages/deployer/CHANGELOG.json
+++ b/packages/deployer/CHANGELOG.json
@@ -6,7 +6,8 @@
"note": "Changed the config key `web3Provider` to `provider` to be consistent with other tools",
"pr": 501
}
- ]
+ ],
+ "timestamp": 1523462196
},
{
"version": "0.3.5",
diff --git a/packages/deployer/CHANGELOG.md b/packages/deployer/CHANGELOG.md
index b11aa988c..4b49092ae 100644
--- a/packages/deployer/CHANGELOG.md
+++ b/packages/deployer/CHANGELOG.md
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v0.4.0 - _April 11, 2018_
+
+ * Changed the config key `web3Provider` to `provider` to be consistent with other tools (#501)
+
## v0.3.5 - _April 2, 2018_
* Don't try to write contract artifact if an error occured (#485)
diff --git a/packages/deployer/package.json b/packages/deployer/package.json
index 34d27081b..1050c095f 100644
--- a/packages/deployer/package.json
+++ b/packages/deployer/package.json
@@ -1,6 +1,6 @@
{
"name": "@0xproject/deployer",
- "version": "0.3.5",
+ "version": "0.4.0",
"description": "Smart contract deployer of 0x protocol",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
@@ -8,7 +8,7 @@
"build:watch": "tsc -w",
"build": "yarn clean && copyfiles 'test/fixtures/contracts/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"test": "run-s build run_mocha",
- "run_mocha": "mocha lib/test/*_test.js",
+ "run_mocha": "mocha lib/test/*_test.js --bail --exit",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"compile": "npm run build; node lib/src/cli.js compile",
@@ -47,9 +47,9 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/deployer/README.md",
"devDependencies": {
- "@0xproject/dev-utils": "^0.2.1",
- "@0xproject/monorepo-scripts": "^0.1.16",
- "@0xproject/tslint-config": "^0.4.14",
+ "@0xproject/dev-utils": "^0.3.4",
+ "@0xproject/monorepo-scripts": "^0.1.17",
+ "@0xproject/tslint-config": "^0.4.15",
"@types/require-from-string": "^1.2.0",
"@types/semver": "^5.5.0",
"@types/yargs": "^11.0.0",
@@ -68,11 +68,11 @@
"web3-typescript-typings": "^0.10.2"
},
"dependencies": {
- "@0xproject/json-schemas": "^0.7.19",
- "@0xproject/types": "^0.5.0",
- "@0xproject/typescript-typings": "^0.0.3",
- "@0xproject/utils": "^0.5.0",
- "@0xproject/web3-wrapper": "^0.5.0",
+ "@0xproject/json-schemas": "^0.7.20",
+ "@0xproject/types": "^0.6.0",
+ "@0xproject/typescript-typings": "^0.1.0",
+ "@0xproject/utils": "^0.5.1",
+ "@0xproject/web3-wrapper": "^0.6.0",
"ethereumjs-util": "^5.1.1",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.4",
diff --git a/packages/deployer/src/cli.ts b/packages/deployer/src/cli.ts
index 62afe0d4c..7b32187c4 100644
--- a/packages/deployer/src/cli.ts
+++ b/packages/deployer/src/cli.ts
@@ -41,8 +41,8 @@ async function onCompileCommandAsync(argv: CliOptions): Promise<void> {
*/
async function onDeployCommandAsync(argv: CliOptions): Promise<void> {
const url = argv.jsonrpcUrl;
- const web3Provider = new Web3.providers.HttpProvider(url);
- const web3Wrapper = new Web3Wrapper(web3Provider);
+ const provider = new Web3.providers.HttpProvider(url);
+ const web3Wrapper = new Web3Wrapper(provider);
const networkId = await web3Wrapper.getNetworkIdAsync();
const compilerOpts: CompilerOptions = {
contractDirs: getContractDirectoriesFromList(argv.contractDirs),
diff --git a/packages/deployer/src/deployer.ts b/packages/deployer/src/deployer.ts
index 84392997c..ad05417b1 100644
--- a/packages/deployer/src/deployer.ts
+++ b/packages/deployer/src/deployer.ts
@@ -38,17 +38,17 @@ export class Deployer {
this._artifactsDir = opts.artifactsDir;
this._networkId = opts.networkId;
this._defaults = opts.defaults;
- let web3Provider: Provider;
+ let provider: Provider;
if (_.isUndefined((opts as ProviderDeployerOptions).provider)) {
const jsonrpcUrl = (opts as UrlDeployerOptions).jsonrpcUrl;
if (_.isUndefined(jsonrpcUrl)) {
- throw new Error(`Deployer options don't contain web3Provider nor jsonrpcUrl. Please pass one of them`);
+ throw new Error(`Deployer options don't contain provider nor jsonrpcUrl. Please pass one of them`);
}
- web3Provider = new Web3.providers.HttpProvider(jsonrpcUrl);
+ provider = new Web3.providers.HttpProvider(jsonrpcUrl);
} else {
- web3Provider = (opts as ProviderDeployerOptions).provider;
+ provider = (opts as ProviderDeployerOptions).provider;
}
- this.web3Wrapper = new Web3Wrapper(web3Provider, this._defaults);
+ this.web3Wrapper = new Web3Wrapper(provider, this._defaults);
}
/**
* Loads a contract's corresponding artifacts and deploys it with the supplied constructor arguments.
@@ -170,7 +170,7 @@ export class Deployer {
const contractArtifact: ContractArtifact = require(artifactPath);
return contractArtifact;
} catch (err) {
- throw new Error(`Artifact not found for contract: ${contractName}`);
+ throw new Error(`Artifact not found for contract: ${contractName} at ${artifactPath}`);
}
}
/**
diff --git a/packages/deployer/test/deployer_test.ts b/packages/deployer/test/deployer_test.ts
index 050cf7d02..a213932f9 100644
--- a/packages/deployer/test/deployer_test.ts
+++ b/packages/deployer/test/deployer_test.ts
@@ -14,6 +14,7 @@ import {
import { constructor_args, exchange_binary } from './fixtures/exchange_bin';
import { constants } from './util/constants';
+import { provider } from './util/provider';
const expect = chai.expect;
@@ -36,7 +37,7 @@ describe('#Deployer', () => {
const deployerOpts = {
artifactsDir,
networkId: constants.networkId,
- jsonrpcUrl: constants.jsonrpcUrl,
+ 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..e0fcb362a
--- /dev/null
+++ b/packages/deployer/test/util/provider.ts
@@ -0,0 +1,9 @@
+import { web3Factory } from '@0xproject/dev-utils';
+import { Provider } from '@0xproject/types';
+import * as Web3 from 'web3';
+
+const providerConfigs = { shouldUseInProcessGanache: true };
+const web3Instance = web3Factory.create(providerConfigs);
+const provider: Provider = web3Instance.currentProvider;
+
+export { provider };