settings: fix tests 3
This commit is contained in:
parent
28dff691fd
commit
d57e5e73e7
2 changed files with 4 additions and 4 deletions
|
|
@ -339,7 +339,7 @@ WalletFactory.prototype.decodeSecret = function(secret) {
|
||||||
WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphrase, privateHex, cb) {
|
WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphrase, privateHex, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var decodedSecret = this.decodeSecret(secret);
|
var decodedSecret = this.decodeSecret(secret);
|
||||||
if (!decodedSecret || !decodedSecret.networkName || !decodedSecret.pubkey) {
|
if (!decodedSecret || !decodedSecret.networkName || !decodedSecret.pubKey) {
|
||||||
return cb('badSecret');
|
return cb('badSecret');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -411,15 +411,15 @@ describe('WalletFactory model', function() {
|
||||||
var wf = new WalletFactory(config, '0.0.1');
|
var wf = new WalletFactory(config, '0.0.1');
|
||||||
wf.networks.testnet.cleanUp = sinon.spy();
|
wf.networks.testnet.cleanUp = sinon.spy();
|
||||||
wf.networks.testnet.start = sinon.spy();
|
wf.networks.testnet.start = sinon.spy();
|
||||||
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test');
|
wf.joinCreateSession('CA1e4HJpSmx9i97i2NigZ6j6F8C5pSaZX9XrAUwQERYAxNpQ4jsBEkr8iS', 'test');
|
||||||
wf.network.start.calledOnce.should.equal(true);
|
wf.networks.testnet.start.calledOnce.should.equal(true);
|
||||||
});
|
});
|
||||||
it('should accept a priv key a input', function() {
|
it('should accept a priv key a input', function() {
|
||||||
var wf = new WalletFactory(config, '0.0.1');
|
var wf = new WalletFactory(config, '0.0.1');
|
||||||
var privHex = 'tprv8ZgxMBicQKsPf7MCvCjnhnr4uiR2Z2gyNC27vgd9KUu98F9mM1tbaRrWMyddVju36GxLbeyntuSadBAttriwGGMWUkRgVmUUCg5nFioGZsd';
|
var privHex = 'tprv8ZgxMBicQKsPf7MCvCjnhnr4uiR2Z2gyNC27vgd9KUu98F9mM1tbaRrWMyddVju36GxLbeyntuSadBAttriwGGMWUkRgVmUUCg5nFioGZsd';
|
||||||
wf.network.cleanUp = sinon.spy();
|
wf.network.cleanUp = sinon.spy();
|
||||||
wf.network.start = sinon.spy();
|
wf.network.start = sinon.spy();
|
||||||
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test', null, privHex);
|
wf.joinCreateSession('CA1e4HJpSmx9i97i2NigZ6j6F8C5pSaZX9XrAUwQERYAxNpQ4jsBEkr8iS', 'test', null, privHex);
|
||||||
wf.network.start.getCall(0).args[0].privkey.should.equal('ddc2fa8c583a73c4b2a24630ec7c283df4e7c230a02c4e48bc36ec61687afd7d');
|
wf.network.start.getCall(0).args[0].privkey.should.equal('ddc2fa8c583a73c4b2a24630ec7c283df4e7c230a02c4e48bc36ec61687afd7d');
|
||||||
});
|
});
|
||||||
it('should call network.start with private key', function() {
|
it('should call network.start with private key', function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue