diff --git a/test/hdkeys.js b/test/hdkeys.js index 2ea1d51..36900a0 100644 --- a/test/hdkeys.js +++ b/test/hdkeys.js @@ -76,11 +76,6 @@ describe('BIP32 compliance', function() { publicKey.toString().should.equal(publicKey.xpubkey); }); - it('cache for xpubkey works for test vector 1', function() { - var pk = HDPrivateKey(vector1_m_private); - pk.xpubkey.should.equal(pk.xpubkey); - }); - it('should get the extended public key from the extended private key for test vector 1', function() { HDPrivateKey(vector1_m_private).xpubkey.should.equal(vector1_m_public); }); diff --git a/test/hdprivatekey.js b/test/hdprivatekey.js index bd54bbc..55782f4 100644 --- a/test/hdprivatekey.js +++ b/test/hdprivatekey.js @@ -100,6 +100,14 @@ describe('HDPrivate key interface', function() { testnetKey.publicKey.network.should.equal(Networks.testnet); livenetKey.publicKey.network.should.equal(Networks.livenet); }); + + it('cache for xpubkey works', function() { + var privateKey = new HDPrivateKey(xprivkey); + should.not.exist(privateKey._hdPublicKey); + privateKey.xpubkey.should.equal(privateKey.xpubkey); + should.exist(privateKey._hdPublicKey); + }); + }); it('inspect() displays correctly', function() {