|
@ -263,16 +263,14 @@ describe('PrivateKey', function() { |
|
|
|
|
|
|
|
|
it('should convert this known PrivateKey to known PublicKey and preserve compressed=true', function() { |
|
|
it('should convert this known PrivateKey to known PublicKey and preserve compressed=true', function() { |
|
|
var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff'; |
|
|
var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff'; |
|
|
var privkey = new PrivateKey(BN(new Buffer(privhex, 'hex'))); |
|
|
var privkey = new PrivateKey(BN(new Buffer(privhex, 'hex')), 'livenet', true); |
|
|
privkey.compressed = true; |
|
|
|
|
|
var pubkey = privkey.toPublicKey(); |
|
|
var pubkey = privkey.toPublicKey(); |
|
|
pubkey.compressed.should.equal(true); |
|
|
pubkey.compressed.should.equal(true); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it('should convert this known PrivateKey to known PublicKey and preserve compressed=true', function() { |
|
|
it('should convert this known PrivateKey to known PublicKey and preserve compressed=true', function() { |
|
|
var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff'; |
|
|
var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff'; |
|
|
var privkey = new PrivateKey(BN(new Buffer(privhex, 'hex'))); |
|
|
var privkey = new PrivateKey(BN(new Buffer(privhex, 'hex')), 'livenet', false); |
|
|
privkey.compressed = false; |
|
|
|
|
|
var pubkey = privkey.toPublicKey(); |
|
|
var pubkey = privkey.toPublicKey(); |
|
|
pubkey.compressed.should.equal(false); |
|
|
pubkey.compressed.should.equal(false); |
|
|
}); |
|
|
}); |
|
|