-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lazy calc for xpubkey in HDPrivateKey #1149
Conversation
Looks great, but is the test specific enough? Maybe it would be better to check for the internal property... (for starters, the test would pass before this PR as well). |
@@ -76,6 +76,11 @@ 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this line before please: expect(pk._hdPublicKey).to.be.undefined
; so this test fails before the commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lazy calc for xpubkey in HDPrivateKey
fixes #1147