support multiple chains; load correct contracts depending on the command line option

This commit is contained in:
Iuri Matias 2019-05-22 15:27:44 -04:00
parent b30b2fb2e3
commit f145c5251b
61 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,6 @@ class Actions {
}
connect(url, cb) {
console.dir("chain: " + url);
console.dir("connecting to: " + url);
web3.setProvider(url);

View File

@ -8,11 +8,12 @@ class Contracts {
}
loadContracts() {
const LiquidPledgingJSONConfig = require("../dist/contracts/LiquidPledging.json");
console.dir("loading contracts for " + this.chain);
const LiquidPledgingJSONConfig = require(`../chains/${this.chain}/contracts/LiquidPledging.json`);
const LiquidPledging = new this.web3.eth.Contract(LiquidPledgingJSONConfig.abiDefinition, LiquidPledgingJSONConfig.address);
this.contracts.LiquidPledging = LiquidPledging;
const StandardTokenJSONConfig = require("../dist/contracts/StandardToken.json");
const StandardTokenJSONConfig = require(`../chains/${this.chain}/contracts/StandardToken.json`);
const StandardToken = new this.web3.eth.Contract(StandardTokenJSONConfig.abiDefinition, StandardTokenJSONConfig.address);
this.contracts.StandardToken = StandardToken;
}