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

Error with Toggle chain sample when you switch back to the original chain with Metamask on WebGL #1262

Open
juans-chainsafe opened this issue Dec 13, 2024 · 0 comments
Assignees
Labels
Priority: P0 Added to issues and PRs relating to a critical severity bugs. Type: Bug Added to issues and PRs if they are addressing a bug

Comments

@juans-chainsafe
Copy link
Contributor

Describe the bug
After you toggle the chain for second time, you get a new error using Metamask in WebGL

Steps
Steps to reproduce the behavior:

  1. Build on WebGL
  2. Connect to Metamask
  3. Click on Toggle chain button
  4. Click again on Toggle chain button

Expected behavior
Chain is switched back to primary user chain set on project settings

Console errors

inpage.js:1 MetaMask - RPC Error: nativeCurrency.symbol does not match currency symbol for a network the user already has added with the same chainId. Received:
ETH 
Object
Build.framework.js:3013 [Web3] Failed to add or switch to the network: nativeCurrency.symbol does not match currency symbol for a network the user already has added with the same chainId. Received:
ETH
Build.framework.js:3013 Web3Exception: nativeCurrency.symbol does not match currency symbol for a network the user already has added with the same chainId. Received:
ETH
Rethrow as InvalidOperationException: Failed to add or switch to the network.
  at ChainSafe.Gaming.Web3.Evm.Wallet.WalletProvider.SwitchChainAddIfMissing (ChainSafe.Gaming.Web3.IChainConfig config) [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as Web3Exception: Error occured while trying to switch wallet chain.
  at ChainSafe.Gaming.Web3.Evm.Wallet.WalletProvider.HandleChainSwitching () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as Web3Exception: One of the handlers thrown an exception. Reverted ChainManager to the previous chain configuration.
  at ChainSafe.Gaming.Web3.Core.Chains.ChainManager.SwitchChain (System.String newChainId) [0x00000] in <00000000000000000000000000000000>:0 

Desktop (please complete the following information):

  • Chainsafe SDK version: [dev]
  • Unity Version: [2022.3.44]
  • Operating System: [Mac]
  • Platfowm: [WebGL]
@juans-chainsafe juans-chainsafe added Priority: P0 Added to issues and PRs relating to a critical severity bugs. Type: Bug Added to issues and PRs if they are addressing a bug labels Dec 13, 2024
@creeppak creeppak self-assigned this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P0 Added to issues and PRs relating to a critical severity bugs. Type: Bug Added to issues and PRs if they are addressing a bug
Projects
None yet
Development

No branches or pull requests

2 participants