Skip to content
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

Merged
merged 3 commits into from
Mar 20, 2015
Merged

Conversation

maraoz
Copy link
Contributor

@maraoz maraoz commented Mar 16, 2015

fixes #1147

@eordano
Copy link
Contributor

eordano commented Mar 16, 2015

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).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 97.52% when pulling 161528b on maraoz:lazy/xpubkey into f2ef86f on bitpay:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 97.52% when pulling 161528b on maraoz:lazy/xpubkey into f2ef86f on bitpay:master.

@@ -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);
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 97.65% when pulling 56c1e8c on maraoz:lazy/xpubkey into 1a0cb73 on bitpay:master.

eordano added a commit that referenced this pull request Mar 20, 2015
lazy calc for xpubkey in HDPrivateKey
@eordano eordano merged commit 56f3e9a into bitpay:master Mar 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance issue at HD Private Key
3 participants