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

Fix Network ID incorrectly using chainId value #256

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

jiexi
Copy link
Contributor

@jiexi jiexi commented Sep 7, 2023

Previously, the chainChanged event was being used as the network ID value. This is incorrect, as chain ID and network ID values may not match and are not guaranteed to be interchangeable. This PR fixes this issue by:

  • using the chainChanged event to update both chainId and networkId
  • listening to the networkChanged event to update both chainId and networkId
    • note that networkChanged is deprecated, but there is no other way to guarantee we don't miss a network ID change

Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

@jiexi jiexi merged commit 9110a96 into main Sep 8, 2023
3 checks passed
@jiexi jiexi deleted the jl/fix-network-id-updating branch September 8, 2023 20:17
@seaona seaona mentioned this pull request Oct 10, 2023
@adonesky1 adonesky1 mentioned this pull request Oct 10, 2023
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.

3 participants