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

[WIP] Remove eth-lib package and replace with ethereumjs-utils functions #4101

Closed

Conversation

akshatamohanty
Copy link

Description

Fixes #4095

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.

@akshatamohanty akshatamohanty mentioned this pull request Jun 3, 2021
@GregTheGreek
Copy link
Contributor

Hey @akshatamohanty thanks for the contirbution, just a heads up you should be targeting ethereumjs/util not ethereumjs-util

@akshatamohanty
Copy link
Author

akshatamohanty commented Jun 3, 2021

@GregTheGreek using this from the ethereumjs/ethereumjs-monorepo. The README seems to point back to npm install ethereumjs-util. What am I missing?

@GregTheGreek
Copy link
Contributor

Sorry you're correct, looks like they haven't cut a new release yet

@GregTheGreek
Copy link
Contributor

So my pr #4083 actually could benefit from this PR. The final thing is tackling the Account package (which is what I need). LMK if you need help

@@ -42,6 +39,49 @@ var isNot = function(value) {
return (_.isUndefined(value) || _.isNull(value));
};

var flattenBytes = function(a) {
Copy link
Author

@akshatamohanty akshatamohanty Jun 6, 2021

Choose a reason for hiding this comment

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

@GregTheGreek Yes, I'm getting stuck with the Account package. There don't seem to be direct mappings in ethereumjs-utils for most of it. I've added the functions from eth-lib inline, within the file as helpers (has missing references right now) and planning to cleanup each function to use internal utils instead. If they don't exist already, will add them to web3-utils (eg, Bytes.flatten, Bytes.slice etc). Does that sound like the right approach?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think a lot of the functions you want might be here to remove code in hashMessage?

Also for the recoverTransaction you're going to run into some problems becasue of berlin support, maybe @luu-alex can make a gist for you showing how it should be supported?

@lgtm-com
Copy link

lgtm-com bot commented Jun 6, 2021

This pull request introduces 1 alert when merging 701fc12 into 1ed3c68 - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@GregTheGreek
Copy link
Contributor

We covered this in the berlin hardfork

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.

Remove eth-lib
2 participants