all tests BUT hardcoded imports working

This commit is contained in:
Matias Alejo Garcia 2014-07-29 13:09:47 -03:00
commit 578d05e638
5 changed files with 135 additions and 134 deletions

View file

@ -118,8 +118,8 @@ describe('PublicKeyRing model', function() {
}).should.throw();
}
w2.getIndex(k.pub).getChangeIndex().should.equal(changeN);
w2.getIndex(k.pub).getReceiveIndex().should.equal(addressN);
w2.getHDParams(k.pub).getChangeIndex().should.equal(changeN);
w2.getHDParams(k.pub).getReceiveIndex().should.equal(addressN);
});
@ -174,8 +174,8 @@ describe('PublicKeyRing model', function() {
for (var i = 0; i < 2; i++)
w.generateAddress(false, k.pub);
w.getIndex(k.pub).getChangeIndex().should.equal(3);
w.getIndex(k.pub).getReceiveIndex().should.equal(2);
w.getHDParams(k.pub).getChangeIndex().should.equal(3);
w.getHDParams(k.pub).getReceiveIndex().should.equal(2);
});
it('should set backup ready', function() {
@ -251,8 +251,8 @@ describe('PublicKeyRing model', function() {
w2.merge(w).should.equal(true);
w2.requiredCopayers.should.equal(3);
w2.totalCopayers.should.equal(5);
w2.getIndex(k.pub).getChangeIndex().should.equal(2);
w2.getIndex(k.pub).getReceiveIndex().should.equal(3);
w2.getHDParams(k.pub).getChangeIndex().should.equal(2);
w2.getHDParams(k.pub).getReceiveIndex().should.equal(3);
w2.merge(w).should.equal(false);
});
@ -440,24 +440,24 @@ describe('PublicKeyRing model', function() {
});
it('#getIndex should return the right one', function() {
it('#getHDParams should return the right one', function() {
var config = {
networkName: 'livenet',
};
var p = new PublicKeyRing(config);
var i = p.getIndex(HDPath.SHARED_INDEX);
var i = p.getHDParams(HDPath.SHARED_INDEX);
should.exist(i);
i.copayerIndex.should.equal(HDPath.SHARED_INDEX);
});
it('#getIndex should throw error', function() {
it('#getHDParams should throw error', function() {
var config = {
networkName: 'livenet',
};
var p = new PublicKeyRing(config);
(function badCosigner() {
return p.getIndex(54);
return p.getHDParams(54);
}).should.throw();
});