mirror of https://github.com/BTCPrivate/copay.git
add test for priv key import
This commit is contained in:
parent
2fbbd2a53a
commit
ca23aed70f
|
@ -404,9 +404,17 @@ describe('WalletFactory model', function() {
|
||||||
var wf = new WalletFactory(config, '0.0.1');
|
var wf = new WalletFactory(config, '0.0.1');
|
||||||
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, undefined);
|
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test');
|
||||||
wf.network.start.calledOnce.should.equal(true);
|
wf.network.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.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() {
|
||||||
var wf = new WalletFactory(config, '0.0.1');
|
var wf = new WalletFactory(config, '0.0.1');
|
||||||
wf.network.cleanUp = sinon.spy();
|
wf.network.cleanUp = sinon.spy();
|
||||||
|
|
Loading…
Reference in New Issue