Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/chain_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ var web3 = require('web3');
var sha3_256 = require('js-sha3').sha3_256;

ChainManager = function() {
this.chainManagerConfig = {};
this.currentChain = {};
this.file = "";
}

ChainManager.prototype.loadConfigFile = function(filename) {
this.file = filename;
try {
var obj = JSON.parse(fs.readFileSync(filename));
this.file = filename;
this.chainManagerConfig = obj;
} catch (e) {
throw new Error("error reading " + filename);
console.warn("error reading " + filename + "; defaulting to empty set");
}
return this;
};
Expand Down Expand Up @@ -51,4 +52,3 @@ ChainManager.prototype.save = function() {
}

module.exports = ChainManager;