-
Notifications
You must be signed in to change notification settings - Fork 773
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
util: rename bnToRlp to bnToUnpaddedBuffer #1293
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Thanks, nice, yes this is actually a lot more readable. 😄
Please always use @deprectated
for the code docs on such deprecations, otherwise e.g. Visual Studio is not picking this up by striking through. Have added on a review-commit.
Unrelated to PR: I think these two/three methods bnToHex()
, bnToUnpaddedBuffer()
(and bnToRlp()
) are very much misplaced in the types
module and should rather go to bytes
. Have added to the v6 notes (let me know if you disagree).
@holgerd77 sounds good, ah thanks for the I think we can go ahead and move those methods to the |
@ryanio hmm, I would prefer to rather be cautious here and only do on next breaking release, also absolutely no urgency here. In the README these modules are stated very explicitly and it is as valid to import from the respective modules (can be even seen as a bit more clean) than from the top level. So I guess this can't really be foreseen if people are doing this or not. |
This PR renames
bnToRlp
tobnToUnpaddedBuffer
to better describe its function (closes ethereumjs/ethereumjs-util#284)It also converts some uses of
unpadBuffer(toBuffer(bn))
to the function, and adds a test for it in the util package.bnToRlp
is kept as a deprecated alias that can be removed in a future major version.