settings: fix tests 3

This commit is contained in:
Manuel Araoz 2014-09-10 14:01:10 -07:00
parent 28dff691fd
commit d57e5e73e7
2 changed files with 4 additions and 4 deletions

View File

@ -339,7 +339,7 @@ WalletFactory.prototype.decodeSecret = function(secret) {
WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphrase, privateHex, cb) {
var self = this;
var decodedSecret = this.decodeSecret(secret);
if (!decodedSecret || !decodedSecret.networkName || !decodedSecret.pubkey) {
if (!decodedSecret || !decodedSecret.networkName || !decodedSecret.pubKey) {
return cb('badSecret');
}

View File

@ -411,15 +411,15 @@ describe('WalletFactory model', function() {
var wf = new WalletFactory(config, '0.0.1');
wf.networks.testnet.cleanUp = sinon.spy();
wf.networks.testnet.start = sinon.spy();
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test');
wf.network.start.calledOnce.should.equal(true);
wf.joinCreateSession('CA1e4HJpSmx9i97i2NigZ6j6F8C5pSaZX9XrAUwQERYAxNpQ4jsBEkr8iS', 'test');
wf.networks.testnet.start.calledOnce.should.equal(true);
});
it('should accept a priv key a input', function() {
var wf = new WalletFactory(config, '0.0.1');
var privHex = 'tprv8ZgxMBicQKsPf7MCvCjnhnr4uiR2Z2gyNC27vgd9KUu98F9mM1tbaRrWMyddVju36GxLbeyntuSadBAttriwGGMWUkRgVmUUCg5nFioGZsd';
wf.network.cleanUp = 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');
});
it('should call network.start with private key', function() {