fix test for hdkey cache

This commit is contained in:
Manuel Araoz 2015-03-20 16:01:05 -03:00
parent 21266570d4
commit 56c1e8c000
2 changed files with 8 additions and 5 deletions

View File

@ -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);
});

View File

@ -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() {