Create indexes for all copayers
This commit is contained in:
parent
e9f20b5de6
commit
b02cb17989
4 changed files with 52 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ try {
|
|||
}
|
||||
var PublicKeyRing = copay.PublicKeyRing;
|
||||
var AddressIndex = copay.AddressIndex;
|
||||
var Structure = copay.Structure;
|
||||
|
||||
|
||||
var config = {
|
||||
|
|
@ -34,6 +35,18 @@ describe('AddressIndex model', function() {
|
|||
should.exist(i);
|
||||
});
|
||||
|
||||
it('should init indexes', function() {
|
||||
var is = AddressIndex.init(2);
|
||||
should.exist(is);
|
||||
is.length.should.equal(3);
|
||||
|
||||
var cosigners = is.map(function(i) { return i.cosigner; });
|
||||
cosigners.indexOf(Structure.SHARED_INDEX).should.not.equal(-1);
|
||||
cosigners.indexOf(0).should.not.equal(-1);
|
||||
cosigners.indexOf(1).should.not.equal(-1);
|
||||
cosigners.indexOf(2).should.equal(-1);
|
||||
});
|
||||
|
||||
it('show be able to store and read', function() {
|
||||
var i = createAI();
|
||||
var changeN = 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue