From 56c1e8c00087ce371c49a68d040ba2c331d3fcbe Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Fri, 20 Mar 2015 16:01:05 -0300 Subject: [PATCH] fix test for hdkey cache --- test/hdkeys.js | 5 ----- test/hdprivatekey.js | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) 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() {