diff --git a/src/hdnode.js b/src/hdnode.js index 33eb67c..576dff0 100644 --- a/src/hdnode.js +++ b/src/hdnode.js @@ -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 diff --git a/test/hdnode.js b/test/hdnode.js index a2e17d7..da0b697 100644 --- a/test/hdnode.js +++ b/test/hdnode.js @@ -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')