Add some test and refactor getCosigner

This commit is contained in:
Yemel Jardi 2014-07-04 09:45:02 -03:00
commit 7562c3f9e7
4 changed files with 54 additions and 18 deletions

View file

@ -47,6 +47,18 @@ describe('AddressIndex model', function() {
cosigners.indexOf(2).should.equal(-1);
});
it('should serialize to object list and back', function() {
var is = AddressIndex.init(3);
should.exist(is);
is.length.should.equal(4);
var list = AddressIndex.serialize(is);
list.length.should.equal(4);
var is2 = AddressIndex.fromList(list);
is2.length.should.equal(4);
});
it('show be able to store and read', function() {
var i = createAI();
var changeN = 2;