fix test for hdkey cache
This commit is contained in:
parent
21266570d4
commit
56c1e8c000
@ -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);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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…
Reference in New Issue
Block a user