add test to SIN

This commit is contained in:
Matias Alejo Garcia 2014-07-24 01:52:17 -03:00
parent 71f992138b
commit 3d828df063

View File

@ -37,7 +37,7 @@ describe('SIN', function() {
describe('#SIN', function() { describe('#SIN', function() {
it('should be able to create a new SIN with a version byte', function() { it('should be able to create a new SIN with a version byte', function() {
var myhash = bitcore.util.sha256ripe160('test'); var myhash = new Buffer('1ab59a0fd1d5fc446d38746ee033c8af57ed6bc0', 'hex');
var sin = new SIN(SIN.SIN_EPHEM, myhash); var sin = new SIN(SIN.SIN_EPHEM, myhash);
should.exist(sin); should.exist(sin);
}); });
@ -48,6 +48,13 @@ describe('SIN', function() {
}).should.throw(); }).should.throw();
}); });
it('should fail with wrong sized hash', function() {
var myhash = new Buffer('111ab59a0fd1d5fc446d38746ee033c8af57ed6bc0', 'hex');
( function (){
var sin = new SIN(SIN.SIN_EPHEM, myhash);
}).should.throw();
});
}); });
describe('#fromPubKey', function() { describe('#fromPubKey', function() {
it('should fail to create a new SIN not using a pub key', function() { it('should fail to create a new SIN not using a pub key', function() {