You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 3, 2019. It is now read-only.
If instance of Transaction is passed to Transaction.fromObject(), the method will crash. I believe this is a very rare use case, since nobody noticed it before. Better when it's fixed anyway :)
var _ = require('lodash');
var async = require('async');
var chai = require('chai');
var sinon = require('sinon');
var should = chai.should();
var log = require('npmlog');
log.debug = log.verbose;
log.level = 'info';
var Bitcore = require('bitcore-lib');
var Common = require('../../lib/common');
var Utils = Common.Utils;
var Constants = Common.Constants;
var Defaults = Common.Defaults;
var Model = require('../../lib/model');
var WalletService = require('../../lib/server');
var TestData = require('../testdata');
var helpers = require('./helpers');
var storage, blockchainExplorer, request;
describe('#getServiceVersion', function() {
it('should get version from package', function() {
WalletService.getServiceVersion().should.equal('bws-' + require('../../package').version);
});
});
describe('#getInstance', function() {
it('should get server instance', function() {
var server = WalletService.getInstance({
clientVersion: 'bwc-2.9.0',
});
server.clientVersion.should.equal('bwc-2.9.0');
});
it('should not get server instance for BWC lower than v1.2', function() {
var err;
try {
var server = WalletService.getInstance({
clientVersion: 'bwc-1.1.99',
});
} catch (ex) {
err = ex;
}
should.exist(err);
err.code.should.equal('UPGRADE_NEEDED');
});
it('should get server instance for non-BWC clients', function() {
var server = WalletService.getInstance({
clientVersion: 'dummy-1.0.0',
});
server.clientVersion.should.equal('dummy-1.0.0');
server = WalletService.getInstance({});
(server.clientVersion == null).should.be.true;
});
});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If instance of Transaction is passed to Transaction.fromObject(), the method will crash. I believe this is a very rare use case, since nobody noticed it before. Better when it's fixed anyway :)