diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index 024802029..990c688ef 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -5,9 +5,10 @@ var fs = require('../../core/fs.js'); var GethCommands = require('./geth_commands.js'); -var Blockchain = function(blockchainConfig, Client, env) { - this.blockchainConfig = blockchainConfig; - this.env = env || 'development'; +var Blockchain = function(options) { + this.blockchainConfig = options.blockchainConfig; + this.env = options.env || 'development'; + this.client = options.client; this.config = { geth_bin: this.blockchainConfig.geth_bin || 'geth', @@ -30,7 +31,7 @@ var Blockchain = function(blockchainConfig, Client, env) { vmdebug: this.blockchainConfig.vmdebug || false }; - this.client = new Client({config: this.config, env: this.env}); + this.client = new options.client({config: this.config, env: this.env}); }; Blockchain.prototype.runCommand = function(cmd) { @@ -80,7 +81,7 @@ Blockchain.prototype.initChainAndGetAddress = function() { var BlockchainClient = function(blockchainConfig, client, env) { if (client === 'geth') { - return new Blockchain(blockchainConfig, GethCommands, env); + return new Blockchain({blockchainConfig: blockchainConfig, client: GethCommands, env: env}); } else { throw new Error('unknown client'); }