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

✨ Allow optional chainId or short network name into getNetwork #122

Closed
wants to merge 3 commits into from

Conversation

arimgibson
Copy link
Contributor

Closes #85

  • Added new type Networkish
  • getNetwork process chainId number
  • getNetwork process short network name
  • getNetwork process deep equality on full network object

@vercel
Copy link

vercel bot commented May 14, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
essential-eth ✅ Ready (Inspect) Visit Preview May 15, 2022 at 11:09PM (UTC)

if (network) {
[eeNetwork, ethersNetwork] = await Promise.all([
essentialEth.getNetwork(network),
ethers.providers.getNetwork(network),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dawsbot you'll notice on here, comparing to the test below, that ethers actually has two separate getNetwork functions: one called on a provider to get the network that provider is using, and another more util-like function to get the information about a specified network. Given this, I'm thinking that it'd be better for us to split them up as well. If that plan makes sense, it seems like the easiest approach is to add this as a new util fn, instead of how ethers exports their providers package

Thoughts?

Copy link
Owner

Choose a reason for hiding this comment

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

Aha, yes yes, this is a great point.

Soon this package too should split into utils and provider. I will do this with #105, and then this PR can continue. Let's put this task to a "blocked" column for now on the task board (I've just made a new column for that)

@dawsbot
Copy link
Owner

dawsbot commented Mar 10, 2023

Closing for now since I've left this stale and didn't improve anything here 🙏

@dawsbot dawsbot closed this Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getNetwork allow optional chainId and network name
2 participants