Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Commit

Permalink
Adds fix to testnet options bug
Browse files Browse the repository at this point in the history
  • Loading branch information
toschdev committed May 3, 2017
1 parent 11bbc62 commit 3d95e19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/liskApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function LiskAPI (options) {
this.testnet = options.testnet || false;
this.bannedPeers = [];
this.currentPeer = options.node || this.selectNode();
this.port = (options.port === '' || options.port) ? options.port : 8000;
this.port = (options.port === '' || options.port) ? options.port : (options.testnet) ? 7000 : 8000;
this.parseOfflineRequests = parseOfflineRequest;
this.nethash = this.getNethash(options.nethash);
}
Expand Down
8 changes: 8 additions & 0 deletions test/api/liskApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ describe('Lisk.api()', function () {
it('new lisk.api() should be Object', function () {
(LSK).should.be.type('object');
});

it('should use testnet peer for testnet settings', function () {
var TESTLSK = lisk.api({ testnet: true });

(TESTLSK.port).should.be.equal(7000);
(TESTLSK.testnet).should.be.equal(true);
});

});

describe('#listPeers', function () {
Expand Down

0 comments on commit 3d95e19

Please sign in to comment.