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

NetworkController: Fix chain IDs in tests #1307

Merged
merged 1 commit into from
May 2, 2023
Merged

NetworkController: Fix chain IDs in tests #1307

merged 1 commit into from
May 2, 2023

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented May 2, 2023

Description

When we replace web3-provider-engine, we will intercept eth_chainId to return a static result, which, for custom RPC endpoints, will come from the chain ID in the provider config. This means that this chain ID must be convertable to a 0x-prefixed hex string. However, when we specify chain IDs in the NetworkController tests, we sometimes use fake hex numbers. So this commit fixes various references in the tests to fulfill this requirement and generally make chain IDs match what we would expect them to be in reality.

Changes

N/A

References

Reduces the scope of #1116.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation for new or updated code as appropriate (note: this will usually be JSDoc)
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@mcmire mcmire requested a review from a team as a code owner May 2, 2023 21:45
When we replace `web3-provider-engine`, we will intercept `eth_chainId`
to return a static result, which, for custom RPC endpoints, will come
from the chain ID in the provider config. This means that this chain ID
must be convertable to a 0x-prefixed hex string. However, when we
specify chain IDs in the NetworkController tests, we sometimes use
fake hex numbers. So this commit fixes various references in the tests
to fulfill this requirement and generally make chain IDs match what we
would expect them to be in reality.
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@mcmire mcmire merged commit dd21800 into main May 2, 2023
@mcmire mcmire deleted the fix-chain-ids branch May 2, 2023 22:14
Gudahtt added a commit that referenced this pull request May 3, 2023
…-rebased

* origin/main:
  docs: update controller-utils/isValidHexAddress to match reality (#1308)
  keyring-controller: validate from-address in signTypedMessage (#1293)
  NetworkController: Fix chain IDs in tests (#1307)
  NetworkController: Normalize INFURA_NETWORKS array (#1306)
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
When we replace `web3-provider-engine`, we will intercept `eth_chainId`
to return a static result, which, for custom RPC endpoints, will come
from the chain ID in the provider config. This means that this chain ID
must be convertable to a 0x-prefixed hex string. However, when we
specify chain IDs in the NetworkController tests, we sometimes use
fake hex numbers. So this commit fixes various references in the tests
to fulfill this requirement and generally make chain IDs match what we
would expect them to be in reality.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
When we replace `web3-provider-engine`, we will intercept `eth_chainId`
to return a static result, which, for custom RPC endpoints, will come
from the chain ID in the provider config. This means that this chain ID
must be convertable to a 0x-prefixed hex string. However, when we
specify chain IDs in the NetworkController tests, we sometimes use
fake hex numbers. So this commit fixes various references in the tests
to fulfill this requirement and generally make chain IDs match what we
would expect them to be in reality.
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