From 94de4c795a793f415e48a3fa4959ef09411e1ec0 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 11 Jun 2018 16:26:32 -0400 Subject: [PATCH] Updating tests --- lib/cmds/blockchain/blockchain.js | 3 +++ test/blockchain.js | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index f9b2a290..dc17da8b 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -76,9 +76,12 @@ var Blockchain = function(options) { }; Blockchain.prototype.setupProxy = function() { + this.config.proxy = true; if (this.blockchainConfig.proxy === false) { + this.config.proxy = false; return; } + const proxy = require('../../core/proxy'); const Ipc = require('../../core/ipc'); diff --git a/test/blockchain.js b/test/blockchain.js index e9dfc40d..4590236b 100644 --- a/test/blockchain.js +++ b/test/blockchain.js @@ -1,5 +1,6 @@ /*globals describe, it*/ const Blockchain = require('../lib/cmds/blockchain/blockchain'); +const constants = require('../lib/constants.json'); const assert = require('assert'); @@ -39,10 +40,15 @@ describe('embark.Blockchain', function () { targetGasLimit: false, fast: false, light: false, - verbosity: undefined + verbosity: undefined, + proxy: true }; let blockchain = new Blockchain(config, 'geth'); + if(config.proxy){ + config.wsPort += constants.blockchain.servicePortOnProxy; + config.rpcPort += constants.blockchain.servicePortOnProxy; + } assert.deepEqual(blockchain.config, config); done(); }); @@ -77,10 +83,16 @@ describe('embark.Blockchain', function () { targetGasLimit: false, fast: false, light: false, - verbosity: undefined + verbosity: undefined, + proxy: true }; let blockchain = new Blockchain(config, 'geth'); + if(config.proxy){ + config.wsPort += constants.blockchain.servicePortOnProxy; + config.rpcPort += constants.blockchain.servicePortOnProxy; + } + assert.deepEqual(blockchain.config, config); done(); });