From cd602856cfcb0c84381be9ef5d4b42a451420d5f Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Thu, 8 Mar 2018 12:08:47 -0500 Subject: [PATCH] bump version for kovan redeploy. separate port from url in config (#131) --- README.md | 3 ++- config/default.json | 3 ++- lib/utils.ts | 4 ++-- package.json | 2 +- test/config.js | 8 ++++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1b2a8e023..cf6a953a5 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,8 @@ The default configuration settings for Arc.js can be found in its `config/defaul ```json { - "providerUrl": "http://127.0.0.0:8545", + "providerUrl": "http://127.0.0.0", + "providerUrl": 8545, "network": "ganache", "gasLimit_runtime": 6015000 } diff --git a/config/default.json b/config/default.json index d36689c4b..5dc0f8a76 100644 --- a/config/default.json +++ b/config/default.json @@ -4,5 +4,6 @@ "gasLimit_deployment": 6300000, "gasLimit_runtime": 4543760, "network": "ganache", - "providerUrl": "http://127.0.0.1:8545" + "providerUrl": "http://127.0.0.1", + "providerPort": 8545 } diff --git a/lib/utils.ts b/lib/utils.ts index 7cd27497e..5e5612bcb 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -63,10 +63,10 @@ export class Utils { // then avoid time-consuming and futile retry throw new Error("already tried and failed"); } else { - // No web3 is injected, look for a provider at providerUrl (which defaults to localhost) + // No web3 is injected, look for a provider at providerUrl:providerPort (which defaults to localhost) // This happens when running tests, or in a browser that is not running MetaMask preWeb3 = new Web3( - new Web3.providers.HttpProvider(Config.get("providerUrl")) + new Web3.providers.HttpProvider(`${Config.get("providerUrl")}:${Config.get("providerPort")}`) ); } diff --git a/package.json b/package.json index b7738ef33..8df5739ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@daostack/arc.js", - "version": "0.0.0-alpha.33", + "version": "0.0.0-alpha.34", "description": "A JavaScript library for interacting with @daostack/arc ethereum smart contracts", "main": "dist/arc.js", "types": "index.d.ts", diff --git a/test/config.js b/test/config.js index 87c1874a5..695b83e72 100644 --- a/test/config.js +++ b/test/config.js @@ -5,14 +5,14 @@ import "./helpers"; describe("Config", () => { it("can get and set configuration values", () => { - assert.equal(Config.get("providerUrl"), "http://127.0.0.1:8545"); - Config.set("providerUrl", "http://localhost:8545"); - assert.equal(Config.get("providerUrl"), "http://localhost:8545"); + assert.equal(Config.get("providerUrl"), "http://127.0.0.1"); + Config.set("providerUrl", "http://localhost"); + assert.equal(Config.get("providerUrl"), "http://localhost"); }); it("doesn't reload default values when imported again", () => { const Config = require("../test-dist/config").Config; - assert.equal(Config.get("providerUrl"), "http://localhost:8545"); + assert.equal(Config.get("providerUrl"), "http://localhost"); }); });