Browse Source

fix test for hdkey cache

patch-2
Manuel Araoz 10 years ago
parent
commit
56c1e8c000
  1. 5
      test/hdkeys.js
  2. 8
      test/hdprivatekey.js

5
test/hdkeys.js

@ -76,11 +76,6 @@ describe('BIP32 compliance', function() {
publicKey.toString().should.equal(publicKey.xpubkey); 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() { 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); HDPrivateKey(vector1_m_private).xpubkey.should.equal(vector1_m_public);
}); });

8
test/hdprivatekey.js

@ -100,6 +100,14 @@ describe('HDPrivate key interface', function() {
testnetKey.publicKey.network.should.equal(Networks.testnet); testnetKey.publicKey.network.should.equal(Networks.testnet);
livenetKey.publicKey.network.should.equal(Networks.livenet); 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() { it('inspect() displays correctly', function() {

Loading…
Cancel
Save