Browse Source

add tests for preservation of compressed in privkey2pubkey

patch-2
Ryan X. Charles 11 years ago
parent
commit
a80d512570
  1. 18
      test/test.key.js

18
test/test.key.js

@ -99,6 +99,24 @@ describe('Key', function() {
key.pubkey.toString().should.equal(pubhex);
});
it('should convert this known Privkey to known Pubkey and preserve compressed=true', function() {
var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff';
var key = new Key();
key.privkey = new Privkey(bn(new Buffer(privhex, 'hex')));
key.privkey.compressed = true;
key.privkey2pubkey();
key.pubkey.compressed.should.equal(true);
});
it('should convert this known Privkey to known Pubkey and preserve compressed=true', function() {
var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff';
var key = new Key();
key.privkey = new Privkey(bn(new Buffer(privhex, 'hex')));
key.privkey.compressed = false;
key.privkey2pubkey();
key.pubkey.compressed.should.equal(false);
});
});
describe("#toString()", function() {

Loading…
Cancel
Save