-
Notifications
You must be signed in to change notification settings - Fork 2.2k
ECKey -D test and light cleanup #202
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
Conversation
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.
Our use of BigInteger is non-mutating in this instance, so there is no reason in taking a clone initially. (see num = num.multiply(BASE).
Undefined is treated as zero if it ever gets to this point anyway, so no value is added by having this default param here. A test fixture to verify this behaviour is added.
The encode/decode functions are also now similar syntactically.
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.
This will be necessary for parsing Script from binary data. Note it isn't used yet because all that code is currently in-lined inside Script.
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.
Why not adding it only when it's started being used?
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.
Well, in this case, it was more about completing the API.
A small enough PR, just some light fixes and cleanup before I submit the
ScriptandTransactionrefactor's.I'll just inline some comments on the commits for anything not immediately obvious from the commit message.