Skip to content

clients/js: Don't throw on eth_chainId request on non-sapphire chain #584

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

Merged
merged 3 commits into from
May 18, 2025

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented May 10, 2025

Fixes #583

lukaw3d added 3 commits May 10, 2025 03:53
I think do we want to crash if user tries to make an encrypted transaction
using our wrapper while metamask is connected to non-sapphire chains. But we
shouldn't crash on non-sensitive methods that are needed to switch chains.
`eth_call` to 0x0100000000000000000000000000000000000103 returns 0x instead of
throwing. So if metamask was connected to a non-sapphire chain and sdk tried to
fetch public key, then it was throwing 'too short' in parseAbiEncodedUintBytes.
@lukaw3d lukaw3d requested review from matevz, buberdds and lubej May 10, 2025 02:04
Copy link

netlify bot commented May 10, 2025

Deploy Preview for oasisprotocol-sapphire-paratime canceled.

Name Link
🔨 Latest commit 01451a2
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-sapphire-paratime/deploys/681eb4283b08cd00088f4e8e

Copy link
Contributor

@lubej lubej left a comment

Choose a reason for hiding this comment

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

Code wise, looks good to me. Not sure why contracts-tests are failing.

@lukaw3d
Copy link
Member Author

lukaw3d commented May 11, 2025

@lukaw3d
Copy link
Member Author

lukaw3d commented May 11, 2025

Seems to affect https://0x2fa.com/

@lukaw3d lukaw3d merged commit bfc0d00 into main May 18, 2025
15 checks passed
@lukaw3d lukaw3d deleted the lw/fix-nonsapphire branch May 18, 2025 22:48
github-actions bot added a commit that referenced this pull request May 18, 2025
…/fix-nonsapphire

clients/js: Don't throw on eth_chainId request on non-sapphire chain bfc0d00
github-actions bot added a commit that referenced this pull request May 18, 2025
…w/fix-nonsapphire

clients/js: Don't throw on eth_chainId request on non-sapphire chain bfc0d00
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.

Injected wallet will fail if sapphire based chain is not selected in metamask
2 participants