Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Replace uses of deprecated new Buffer with Buffer.from #60

Merged
merged 1 commit into from
Dec 7, 2018

Conversation

whymarrh
Copy link
Contributor

@whymarrh whymarrh commented Dec 7, 2018

See also ethereumjs/ethereumjs-blockchain#80

This PR removes usages of the deprecated new Buffer API.

    sed -i.bak 's/new Buffer/Buffer.from/' *.js test/*.js && \
    find . -name '*.bak' -delete
Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Again here: please work directly on the main repo if possible.

@holgerd77 holgerd77 merged commit f255f80 into ethereumjs:master Dec 7, 2018
Copy link
Member

@axic axic left a comment

Choose a reason for hiding this comment

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

Need to use required('safe-buffer') for this to work on all Node versions.

@holgerd77
Copy link
Member

This should not be needed any more since we have dropped Node 4 (and 5) support with EOL being reached.

@axic
Copy link
Member

axic commented Dec 7, 2018

Didn't know that. Does it make sense removing that workaround from the codebase then?

@whymarrh
Copy link
Contributor Author

whymarrh commented Dec 7, 2018

@axic yup, safe-buffer isn't needed and can be removed

@whymarrh whymarrh deleted the buffer-from branch December 7, 2018 22:41
@holgerd77
Copy link
Member

Have opened a PR ethereumjs/organization#45 to add a note on this to the docs, together with an additional table on Node.js distribution version support, @whymarrh can you directly do a review on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants