Skip to content

Commit

Permalink
bump version for kovan redeploy. separate port from url in config (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkent600 authored Mar 8, 2018
1 parent 87b08d6 commit cd60285
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")}`)
);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions test/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});

});

0 comments on commit cd60285

Please sign in to comment.