Skip to content

Commit

Permalink
fix test for hdkey cache
Browse files Browse the repository at this point in the history
  • Loading branch information
maraoz committed Mar 20, 2015
1 parent 2126657 commit 56c1e8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 0 additions & 5 deletions test/hdkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
8 changes: 8 additions & 0 deletions test/hdprivatekey.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 56c1e8c

Please sign in to comment.