HDNode: adds getPublicKeyBuffer
This commit is contained in:
parent
923266672b
commit
57d0ea84a2
2 changed files with 13 additions and 0 deletions
|
@ -136,6 +136,10 @@ HDNode.prototype.getFingerprint = function () {
|
||||||
return this.getIdentifier().slice(0, 4)
|
return this.getIdentifier().slice(0, 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HDNode.prototype.getPublicKeyBuffer = function () {
|
||||||
|
return this.keyPair.getPublicKeyBuffer()
|
||||||
|
}
|
||||||
|
|
||||||
HDNode.prototype.neutered = function () {
|
HDNode.prototype.neutered = function () {
|
||||||
var neuteredKeyPair = new ECPair(null, this.keyPair.Q, {
|
var neuteredKeyPair = new ECPair(null, this.keyPair.Q, {
|
||||||
network: this.keyPair.network
|
network: this.keyPair.network
|
||||||
|
|
|
@ -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 () {
|
describe('sign', function () {
|
||||||
it('wraps keyPair.sign', sinon.test(function () {
|
it('wraps keyPair.sign', sinon.test(function () {
|
||||||
this.mock(keyPair).expects('sign')
|
this.mock(keyPair).expects('sign')
|
||||||
|
|
Loading…
Add table
Reference in a new issue