Updating tests

This commit is contained in:
Richard Ramos 2018-06-11 16:26:32 -04:00
parent 16ab8136a2
commit 94de4c795a
2 changed files with 17 additions and 2 deletions

View File

@ -76,9 +76,12 @@ var Blockchain = function(options) {
}; };
Blockchain.prototype.setupProxy = function() { Blockchain.prototype.setupProxy = function() {
this.config.proxy = true;
if (this.blockchainConfig.proxy === false) { if (this.blockchainConfig.proxy === false) {
this.config.proxy = false;
return; return;
} }
const proxy = require('../../core/proxy'); const proxy = require('../../core/proxy');
const Ipc = require('../../core/ipc'); const Ipc = require('../../core/ipc');

View File

@ -1,5 +1,6 @@
/*globals describe, it*/ /*globals describe, it*/
const Blockchain = require('../lib/cmds/blockchain/blockchain'); const Blockchain = require('../lib/cmds/blockchain/blockchain');
const constants = require('../lib/constants.json');
const assert = require('assert'); const assert = require('assert');
@ -39,10 +40,15 @@ describe('embark.Blockchain', function () {
targetGasLimit: false, targetGasLimit: false,
fast: false, fast: false,
light: false, light: false,
verbosity: undefined verbosity: undefined,
proxy: true
}; };
let blockchain = new Blockchain(config, 'geth'); let blockchain = new Blockchain(config, 'geth');
if(config.proxy){
config.wsPort += constants.blockchain.servicePortOnProxy;
config.rpcPort += constants.blockchain.servicePortOnProxy;
}
assert.deepEqual(blockchain.config, config); assert.deepEqual(blockchain.config, config);
done(); done();
}); });
@ -77,10 +83,16 @@ describe('embark.Blockchain', function () {
targetGasLimit: false, targetGasLimit: false,
fast: false, fast: false,
light: false, light: false,
verbosity: undefined verbosity: undefined,
proxy: true
}; };
let blockchain = new Blockchain(config, 'geth'); let blockchain = new Blockchain(config, 'geth');
if(config.proxy){
config.wsPort += constants.blockchain.servicePortOnProxy;
config.rpcPort += constants.blockchain.servicePortOnProxy;
}
assert.deepEqual(blockchain.config, config); assert.deepEqual(blockchain.config, config);
done(); done();
}); });