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

Migrate from ethjs to ethers #29

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Feb 10, 2021

ethers is better maintained than ethjs, and we've been migrating many of our packages to use it. This should work equivalently.

This will be a breaking change because this will change public properties of the method registry class.

@Gudahtt Gudahtt requested a review from a team as a code owner February 10, 2021 19:07
@Gudahtt
Copy link
Member Author

Gudahtt commented Feb 10, 2021

I forgot to update the readme!

Edit: README has been updated; this should be good to go now.

`ethers` is better maintained than `ethjs`, and we've been migrating
many of our packages to use it. This should work equivalently.

This will be a breaking change because this will change public
properties of the method registry class.
@Gudahtt Gudahtt force-pushed the migrate-from-ethjs-to-ethers branch from 96ee678 to 9af43c5 Compare February 10, 2021 20:45
Gudahtt added a commit to MetaMask/core that referenced this pull request Feb 11, 2021
The version of `ethjs-query` we're using has an unlisted dependency
upon `babel-runtime`, and will crash if it's not present. Currently
it's working because `babel-runtime` is being brought in by another
dependency (`fetch-mock`), but that dependency is removed in another
PR (#340).

Until we can migrate away from using this version of `ethjs-query`,
`babel-runtime` has been added as an explicit dependency to ensure it
is present.

`ethjs-query` is a transitive dependency of `eth-method-registry` via
`ethjs`. There is a PR open on `eth-method-registry` to replace `ethjs`
altogether [1]. Once those are merged and released, we can update
`eth-method-registry` here and remove this `babel-runtime` dependency.

[1]: MetaMask/eth-method-registry#29
Gudahtt added a commit to MetaMask/core that referenced this pull request Feb 11, 2021
The version of `ethjs-query` we're using has an unlisted dependency
upon `babel-runtime`, and will crash if it's not present. Currently
it's working because `babel-runtime` is being brought in by another
dependency (`fetch-mock`), but that dependency is removed in another
PR (#340).

Until we can migrate away from using this version of `ethjs-query`,
`babel-runtime` has been added as an explicit dependency to ensure it
is present.

`ethjs-query` is a transitive dependency of `eth-method-registry` via
`ethjs`. There is a PR open on `eth-method-registry` to replace `ethjs`
altogether [1]. Once those are merged and released, we can update
`eth-method-registry` here and remove this `babel-runtime` dependency.

[1]: MetaMask/eth-method-registry#29

interface DeployedRegistryContract {
entries (bytes: string): string[];
provider: Provider;
Copy link
Member Author

Choose a reason for hiding this comment

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

It might be better to expect an EIP-1193 provider here rather than an ethers provider.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moving this back into draft until we come up with a better interface to use here.

@Gudahtt Gudahtt marked this pull request as draft May 10, 2021 14:31
@brad-decker
Copy link

@Gudahtt could this be revisted? I think removing ethjs across all the dependencies we maintain would be a solid move considering its staleness.

@brad-decker
Copy link

Happy to take this on, but i'd like more clarification on the issue you highlighted.

@Gudahtt
Copy link
Member Author

Gudahtt commented Mar 31, 2023

I think what we want here is a type that represents an EIP-1193 provider. Then we can pass a provider that implements that interface (e.g. an Ethers provider) without being tied to a specific version of that specific library

MajorLift pushed a commit to MetaMask/core that referenced this pull request Oct 11, 2023
The version of `ethjs-query` we're using has an unlisted dependency
upon `babel-runtime`, and will crash if it's not present. Currently
it's working because `babel-runtime` is being brought in by another
dependency (`fetch-mock`), but that dependency is removed in another
PR (#340).

Until we can migrate away from using this version of `ethjs-query`,
`babel-runtime` has been added as an explicit dependency to ensure it
is present.

`ethjs-query` is a transitive dependency of `eth-method-registry` via
`ethjs`. There is a PR open on `eth-method-registry` to replace `ethjs`
altogether [1]. Once those are merged and released, we can update
`eth-method-registry` here and remove this `babel-runtime` dependency.

[1]: MetaMask/eth-method-registry#29
MajorLift pushed a commit to MetaMask/core that referenced this pull request Oct 11, 2023
The version of `ethjs-query` we're using has an unlisted dependency
upon `babel-runtime`, and will crash if it's not present. Currently
it's working because `babel-runtime` is being brought in by another
dependency (`fetch-mock`), but that dependency is removed in another
PR (#340).

Until we can migrate away from using this version of `ethjs-query`,
`babel-runtime` has been added as an explicit dependency to ensure it
is present.

`ethjs-query` is a transitive dependency of `eth-method-registry` via
`ethjs`. There is a PR open on `eth-method-registry` to replace `ethjs`
altogether [1]. Once those are merged and released, we can update
`eth-method-registry` here and remove this `babel-runtime` dependency.

[1]: MetaMask/eth-method-registry#29
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.

2 participants