-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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(18709): fix error when switching to linea testnet using wallet_sw… #18710
fix(18709): fix error when switching to linea testnet using wallet_sw… #18710
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…itchEthereumChain
2a9c9b6
to
158d487
Compare
This error message is coming from a change we made recently where we moved custom networks from PreferencesController to NetworkController: #17421 I'm trying to understand why this bug exists. Is Linea testnet a network we regard as "built-in", or is something that users need to add themselves? |
This bug exits because we are not getting the network info using this function We regard Linea testnet as "built-in" as "Sepolia" and "Goerli". The difference is that we use the network type My PR fixed this issue :) |
app/scripts/lib/rpc-method-middleware/handlers/switch-ethereum-chain.js
Outdated
Show resolved
Hide resolved
This conversation is highlighting why "built-in network" is not a great term 😅 We have this unfortunate split between certain built-in Infura networks and all other networks that affects how we interact with the network controller. Built-in Infura networks require calling Ideally we'd remove this split at some point, but that's the purpose of these conditions that are being changed in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Explanation
Fixed the error when we use the MM API wallet_switchEthereumChain endpoint to switch to linea testnet network.
A new condition has been added in
app/scripts/lib/rpc-method-middleware/handlers/switch-ethereum-chain.js
file infindExistingNetwork
function.Screenshots/Screencaps
Before
After
Manual Testing Steps
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.