• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KarpelesLab / libwallet / 24763430116
25%

Build:
DEFAULT BRANCH: master
Ran 22 Apr 2026 06:27AM UTC
Jobs 1
Files 99
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Apr 2026 06:18AM UTC coverage: 20.89% (-0.2%) from 21.108%
24763430116

push

github

MagicalTux
Web3: cross-chain detection + chain_switch approval

The injector already exposes window.ethereum / window.solana /
window.mpurse unconditionally — but action methods (sign, send,
connect) called against a chain family that doesn't match the
wallet's current network used to either silently mis-route to the
current network's RPC or fail mid-flight with bad accounts.

Detect the family at the top of Web3:request from the method
prefix (eth_/wallet_/personal_/net_/web3_ → evm, solana_ →
solana, mpurse_ → bitcoin). Read-only methods (eth_chainId,
eth_getBalance, etc.) keep the existing relay behaviour;
classified action methods that mismatch the current network
trigger a new chain_switch approval.

The approval request carries:
- requestedFamily, requestedMethod (UI copy)
- currentNetwork (context)
- candidateNetworks (every Network of the requested family —
  user picks the specific chain)
- candidateAccounts (every Account whose key curve fits —
  secp256k1 for evm/bitcoin, ed25519 for solana)

User picks (network, account) in one prompt; libwallet then
SetCurrent's the network AND saves a ConnectedSite for
(host, account). The original method continues against the new
state with the dApp already considered connected to the chosen
account, so subsequent sign / send calls land on the right chain.

Approve API gains a Network field carrying the chosen network id
(account id stays in Accounts[0]). Dart side adds
ChainSwitchRequest with typed accessors for the candidate
network / account lists and a docstring example of how to wire
the picker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

0 of 125 new or added lines in 3 files covered. (0.0%)

1 existing line in 1 file now uncovered.

2529 of 12106 relevant lines covered (20.89%)

64.85 hits per line

Uncovered Changes

Lines Coverage ∆ File
95
0.0
wltbase/web3_chainswitch.go
17
2.67
-0.11% wltbase/request.go
13
0.6
-0.01% wltbase/web3.go

Coverage Regressions

Lines Coverage ∆ File
1
2.67
-0.11% wltbase/request.go
Jobs
ID Job ID Ran Files Coverage
1 24763430116.1 22 Apr 2026 06:27AM UTC 99
20.89
GitHub Action Run
Source Files on build 24763430116
  • Tree
  • List 99
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24763430116
  • 934bf82c on github
  • Prev Build on master (#24759374762)
  • Next Build on master (#24764409942)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc