HDNode: adds getPublicKeyBuffer

This commit is contained in:
Daniel Cousens 2015-09-21 16:44:53 +10:00
parent 923266672b
commit 57d0ea84a2
2 changed files with 13 additions and 0 deletions

View file

@ -136,6 +136,10 @@ HDNode.prototype.getFingerprint = function () {
return this.getIdentifier().slice(0, 4)
}
HDNode.prototype.getPublicKeyBuffer = function () {
return this.keyPair.getPublicKeyBuffer()
}
HDNode.prototype.neutered = function () {
var neuteredKeyPair = new ECPair(null, this.keyPair.Q, {
network: this.keyPair.network

View file

@ -121,6 +121,15 @@ describe('HDNode', function () {
}))
})
describe('getPublicKeyBuffer', function () {
it('wraps keyPair.getPublicKeyBuffer', sinon.test(function () {
this.mock(keyPair).expects('getPublicKeyBuffer')
.once().withArgs().returns('pubKeyBuffer')
assert.strictEqual(hd.getPublicKeyBuffer(), 'pubKeyBuffer')
}))
})
describe('sign', function () {
it('wraps keyPair.sign', sinon.test(function () {
this.mock(keyPair).expects('sign')