From 87470de22f688e310080c30d9de6c2998e884187 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Thu, 7 May 2015 11:22:07 +1000 Subject: [PATCH] tests: check that HDNode pubKey/privKey is initialized --- test/hdnode.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/hdnode.js b/test/hdnode.js index 996f9a7..b786746 100644 --- a/test/hdnode.js +++ b/test/hdnode.js @@ -24,6 +24,7 @@ describe('HDNode', function () { it('calculates the publicKey from a BigInteger', function () { var hd = new HDNode(d, chainCode) + assert.equal(hd.privKey.d, d) assert(hd.pubKey.Q.equals(Q)) }) @@ -32,12 +33,14 @@ describe('HDNode', function () { var hd = new HDNode(ek, chainCode) assert.equal(hd.privKey, ek) + assert.equal(hd.pubKey, ek.pub) }) it('allows initialization directly from an ECPubKey', function () { var ek = new ECPubKey(Q) var hd = new HDNode(ek, chainCode) + assert.equal(hd.privKey, null) assert.equal(hd.pubKey, ek) })