remove remaning of accounts config in blockchain

This commit is contained in:
Jonathan Rainville 2018-05-18 09:34:59 -04:00
parent 6c8653ef09
commit a1e3c741a0
4 changed files with 12 additions and 13 deletions

View File

@ -7,7 +7,6 @@ var GethCommands = require('./geth_commands.js');
/*eslint complexity: ["error", 35]*/
var Blockchain = function(options) {
this.blockchainConfig = options.blockchainConfig;
this.accountsConfig = options.accountsConfig;
this.env = options.env || 'development';
this.client = options.client;
this.isDev = options.isDev;
@ -42,8 +41,7 @@ var Blockchain = function(options) {
vmdebug: this.blockchainConfig.vmdebug || false,
targetGasLimit: this.blockchainConfig.targetGasLimit || false,
light: this.blockchainConfig.light || false,
fast: this.blockchainConfig.fast || false,
accountsConfig: this.accountsConfig
fast: this.blockchainConfig.fast || false
};
if (this.blockchainConfig === {} || JSON.stringify(this.blockchainConfig) === '{"enabled":true}') {
@ -126,9 +124,9 @@ Blockchain.prototype.initChainAndGetAddress = function() {
return address;
};
var BlockchainClient = function(blockchainConfig, accountsConfig, client, env, isDev) {
var BlockchainClient = function(blockchainConfig, client, env, isDev) {
if (client === 'geth') {
return new Blockchain({blockchainConfig, accountsConfig, client: GethCommands, env, isDev});
return new Blockchain({blockchainConfig, client: GethCommands, env, isDev});
} else {
throw new Error('unknown client');
}

View File

@ -101,5 +101,8 @@
"downloading {{packageName}} {{version}}....": "downloading {{packageName}} {{version}}....",
"Swarm node is offline...": "Swarm node is offline...",
"Swarm node detected...": "Swarm node detected...",
"Ethereum node (version unknown)": "Ethereum node (version unknown)"
"Ethereum node (version unknown)": "Ethereum node (version unknown)",
"No Blockchain node found": "No Blockchain node found",
"Couldn't connect to an Ethereum node are you sure it's on?": "Couldn't connect to an Ethereum node are you sure it's on?",
"make sure you have an Ethereum node or simulator running. e.g '%s'": "make sure you have an Ethereum node or simulator running. e.g '%s'"
}

View File

@ -61,7 +61,7 @@ class Embark {
if(webServerConfig) blockchainConfig.wsOrigins = `http://${webServerConfig.host}:${webServerConfig.port}`;
if(storageConfig) blockchainConfig.wsOrigins += `${blockchainConfig.wsOrigins.length ? ',' : ''}${storageConfig.protocol}://${storageConfig.host}:${storageConfig.port}`;
}
return require('./cmds/blockchain/blockchain.js')(blockchainConfig, this.config.contractsConfig.deployment.accounts, client, env, this.isDev(env)).run();
return require('./cmds/blockchain/blockchain.js')(blockchainConfig, client, env, this.isDev(env)).run();
}
simulator(options) {

View File

@ -15,7 +15,6 @@ describe('embark.Blockchain', function () {
let config = {
networkType: 'custom',
genesisBlock: false,
accountsConfig: {},
geth_bin: 'geth',
datadir: false,
mineWhenNeeded: false,
@ -32,7 +31,7 @@ describe('embark.Blockchain', function () {
whisper: true,
account: {},
bootnodes: "",
wsApi: [ "eth", "web3", "net", "shh" ],
wsApi: ["eth", "web3", "net", "shh"],
wsHost: "localhost",
wsOrigins: false,
wsPort: 8546,
@ -41,7 +40,7 @@ describe('embark.Blockchain', function () {
fast: false,
light: false
};
let blockchain = new Blockchain(config, {}, 'geth');
let blockchain = new Blockchain(config, 'geth');
assert.deepEqual(blockchain.config, config);
done();
@ -55,7 +54,6 @@ describe('embark.Blockchain', function () {
genesisBlock: 'foo/bar/genesis.json',
geth_bin: 'geth',
datadir: '/foo/datadir/',
accountsConfig: {},
mineWhenNeeded: true,
rpcHost: 'someserver',
rpcPort: 12345,
@ -70,7 +68,7 @@ describe('embark.Blockchain', function () {
whisper: false,
account: {},
bootnodes: "",
wsApi: [ "eth", "web3", "net", "shh" ],
wsApi: ["eth", "web3", "net", "shh"],
wsHost: "localhost",
wsOrigins: false,
wsPort: 8546,
@ -79,7 +77,7 @@ describe('embark.Blockchain', function () {
fast: false,
light: false
};
let blockchain = new Blockchain(config, {}, 'geth');
let blockchain = new Blockchain(config, 'geth');
assert.deepEqual(blockchain.config, config);
done();