aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-04-17 13:06:57 +0800
committerGitHub <noreply@github.com>2018-04-17 13:06:57 +0800
commit2193d9ae6ef25d08d5524f6d2622f3371dbea3d1 (patch)
tree5a6dbbf7fcb1dced1ace80c03343ca789dc49b54
parentd263f7783fabe89cc9714b596068eccdc5babc1c (diff)
parent79d01fe2d7582266dafedefee2873c9d488f4a20 (diff)
downloaddexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.gz
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.bz2
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.lz
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.xz
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.zst
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.zip
Merge pull request #524 from 0xProject/feature/0x.js/remove-hd-wallet-from-test
Remove truffle-hdwallet from 0x.js tests
-rw-r--r--packages/0x.js/CHANGELOG.json8
-rw-r--r--packages/0x.js/package.json1
-rw-r--r--packages/0x.js/test/artifacts_test.ts12
-rw-r--r--packages/dev-utils/CHANGELOG.json9
-rw-r--r--packages/dev-utils/src/web3_factory.ts6
-rw-r--r--yarn.lock51
6 files changed, 30 insertions, 57 deletions
diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json
index 9b5c52d00..8be892215 100644
--- a/packages/0x.js/CHANGELOG.json
+++ b/packages/0x.js/CHANGELOG.json
@@ -1,5 +1,13 @@
[
{
+ "version": "0.36.1",
+ "changes": [
+ {
+ "note": "Internal changes and refactoring"
+ }
+ ]
+ },
+ {
"version": "0.36.0",
"changes": [
{
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index cd339e770..37a321dbd 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -89,7 +89,6 @@
"shx": "^0.2.2",
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
- "truffle-hdwallet-provider": "^0.0.3",
"tslint": "5.8.0",
"typedoc": "0xProject/typedoc",
"typescript": "2.7.1",
diff --git a/packages/0x.js/test/artifacts_test.ts b/packages/0x.js/test/artifacts_test.ts
index 17f068a2e..40c5983bd 100644
--- a/packages/0x.js/test/artifacts_test.ts
+++ b/packages/0x.js/test/artifacts_test.ts
@@ -1,5 +1,5 @@
+import { web3Factory } from '@0xproject/dev-utils';
import * as fs from 'fs';
-import HDWalletProvider = require('truffle-hdwallet-provider');
import { ZeroEx } from '../src';
@@ -14,10 +14,7 @@ const TIMEOUT = 10000;
describe('Artifacts', () => {
describe('contracts are deployed on kovan', () => {
const kovanRpcUrl = constants.KOVAN_RPC_URL;
- const packageJSONContent = fs.readFileSync('package.json', 'utf-8');
- const packageJSON = JSON.parse(packageJSONContent);
- const mnemonic = packageJSON.config.mnemonic;
- const provider = new HDWalletProvider(mnemonic, kovanRpcUrl);
+ const provider = web3Factory.create({ rpcUrl: kovanRpcUrl }).currentProvider;
const config = {
networkId: constants.KOVAN_NETWORK_ID,
};
@@ -34,10 +31,7 @@ describe('Artifacts', () => {
});
describe('contracts are deployed on ropsten', () => {
const ropstenRpcUrl = constants.ROPSTEN_RPC_URL;
- const packageJSONContent = fs.readFileSync('package.json', 'utf-8');
- const packageJSON = JSON.parse(packageJSONContent);
- const mnemonic = packageJSON.config.mnemonic;
- const provider = new HDWalletProvider(mnemonic, ropstenRpcUrl);
+ const provider = web3Factory.create({ rpcUrl: ropstenRpcUrl }).currentProvider;
const config = {
networkId: constants.ROPSTEN_NETWORK_ID,
};
diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json
index b5dd3732d..8faf71d6a 100644
--- a/packages/dev-utils/CHANGELOG.json
+++ b/packages/dev-utils/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "0.3.6",
+ "changes": [
+ {
+ "note": "Allow an rpcURL to be set in Web3Config (for testnet RPC endpoints)",
+ "pr": 524
+ }
+ ]
+ },
+ {
"timestamp": 1523462196,
"version": "0.3.5",
"changes": [
diff --git a/packages/dev-utils/src/web3_factory.ts b/packages/dev-utils/src/web3_factory.ts
index f45c36930..68348d671 100644
--- a/packages/dev-utils/src/web3_factory.ts
+++ b/packages/dev-utils/src/web3_factory.ts
@@ -26,6 +26,7 @@ import * as Web3 from 'web3';
export interface Web3Config {
hasAddresses?: boolean; // default: true
shouldUseInProcessGanache?: boolean; // default: false
+ rpcUrl?: string; // default: localhost:8545
}
export const web3Factory = {
@@ -53,6 +54,9 @@ export const web3Factory = {
};
const shouldUseInProcessGanache = !!config.shouldUseInProcessGanache;
if (shouldUseInProcessGanache) {
+ if (!_.isUndefined(config.rpcUrl)) {
+ throw new Error('Cannot use both GanacheSubrovider and RPCSubprovider');
+ }
provider.addProvider(
new GanacheSubprovider({
logger,
@@ -65,7 +69,7 @@ export const web3Factory = {
} else {
provider.addProvider(
new RpcSubprovider({
- rpcUrl: constants.RPC_URL,
+ rpcUrl: config.rpcUrl || constants.RPC_URL,
}),
);
}
diff --git a/yarn.lock b/yarn.lock
index 5bb47293f..e936833d4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1423,10 +1423,6 @@ big.js@^3.1.3:
version "3.2.0"
resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e"
-"bignumber.js@git+https://github.com/debris/bignumber.js#master":
- version "2.0.7"
- resolved "git+https://github.com/debris/bignumber.js#c7a38de919ed75e6fb6ba38051986e294b328df9"
-
"bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2":
version "2.0.7"
resolved "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2"
@@ -1451,7 +1447,7 @@ bintrees@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bintrees/-/bintrees-1.0.2.tgz#49f896d6e858a4a499df85c38fb399b9aff840f8"
-bip39@^2.2.0, bip39@^2.5.0:
+bip39@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.5.0.tgz#51cbd5179460504a63ea3c000db3f787ca051235"
dependencies:
@@ -3637,7 +3633,7 @@ ethereumjs-util@^4.0.1, ethereumjs-util@^4.3.0, ethereumjs-util@^4.4.0:
rlp "^2.0.0"
secp256k1 "^3.0.1"
-ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5:
+ethereumjs-util@^5.0.0, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5:
version "5.1.5"
resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.1.5.tgz#2f02575852627d45622426f25ee4a0b5f377f27a"
dependencies:
@@ -3665,7 +3661,7 @@ ethereumjs-vm@2.3.3, ethereumjs-vm@^2.0.2:
rustbn.js "~0.1.1"
safe-buffer "^5.1.1"
-ethereumjs-wallet@^0.6.0, ethereumjs-wallet@~0.6.0:
+ethereumjs-wallet@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.0.tgz#82763b1697ee7a796be7155da9dfb49b2f98cfdb"
dependencies:
@@ -5681,7 +5677,7 @@ isobject@^3.0.0, isobject@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
-isomorphic-fetch@^2.1.1, isomorphic-fetch@^2.2.0, isomorphic-fetch@^2.2.1:
+isomorphic-fetch@^2.1.1, isomorphic-fetch@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
dependencies:
@@ -10496,15 +10492,6 @@ truffle-contract@2.0.1:
truffle-contract-schema "0.0.5"
web3 "^0.18.0"
-truffle-hdwallet-provider@^0.0.3:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/truffle-hdwallet-provider/-/truffle-hdwallet-provider-0.0.3.tgz#0e1de02104b73d3875e1cf7093305b4ea8a2d843"
- dependencies:
- bip39 "^2.2.0"
- ethereumjs-wallet "^0.6.0"
- web3 "^0.18.2"
- web3-provider-engine "^8.4.0"
-
tslib@^1.0.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1:
version "1.9.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"
@@ -11341,25 +11328,6 @@ web3-provider-engine@^13.0.1, web3-provider-engine@^13.6.5:
xhr "^2.2.0"
xtend "^4.0.1"
-web3-provider-engine@^8.4.0:
- version "8.6.1"
- resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-8.6.1.tgz#4d86e19e30caaf97df351511ec0f60136e5b30eb"
- dependencies:
- async "^2.1.2"
- clone "^2.0.0"
- ethereumjs-block "^1.2.2"
- ethereumjs-tx "^1.2.0"
- ethereumjs-util "^5.0.1"
- ethereumjs-vm "^2.0.2"
- isomorphic-fetch "^2.2.0"
- request "^2.67.0"
- semaphore "^1.0.3"
- solc "^0.4.2"
- tape "^4.4.0"
- web3 "^0.16.0"
- xhr "^2.2.0"
- xtend "^4.0.1"
-
web3-providers-http@1.0.0-beta.33:
version "1.0.0-beta.33"
resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.33.tgz#3b35ae00ee7df5b96b4934962ad4a86f2a5599c1"
@@ -11410,16 +11378,7 @@ web3-utils@1.0.0-beta.33:
underscore "1.8.3"
utf8 "2.1.1"
-web3@^0.16.0:
- version "0.16.0"
- resolved "https://registry.yarnpkg.com/web3/-/web3-0.16.0.tgz#a4554175cd462943035b1f1d39432f741c6b6019"
- dependencies:
- bignumber.js "git+https://github.com/debris/bignumber.js#master"
- crypto-js "^3.1.4"
- utf8 "^2.1.1"
- xmlhttprequest "*"
-
-web3@^0.18.0, web3@^0.18.2:
+web3@^0.18.0:
version "0.18.4"
resolved "https://registry.yarnpkg.com/web3/-/web3-0.18.4.tgz#81ec1784145491f2eaa8955b31c06049e07c5e7d"
dependencies: