Commit e7a93ce
authored
fix(bridge): cp-7.67.0 display block explorer tx link for Popular networks in transaction details (#26659)
## **Description**
`getBlockExplorerForChain()` in `TransactionDetails` only resolved block
explorer URLs for hardcoded built-in networks (Mainnet, Linea, Sepolia)
and user-added custom RPC networks. Popular networks (Arbitrum, Polygon,
BNB Chain, etc.) are neither — they aren't stored in
`networkConfigurations` — so the method fell through to
`NO_RPC_BLOCK_EXPLORER`, hiding the "View on X" link entirely.
The fix adds a `PopularList` lookup as a fallback, matching the pattern
already used correctly in useBlockExplorer.ts.
## **Changelog**
CHANGELOG entry: Fixed a bug where transactions on popular networks
(Arbitrum, Polygon, BNB Chain, etc.) were missing the block explorer
link in transaction details
## **Related issues**
Fixes: #26419
## **Manual testing steps**
```gherkin
Feature: Block explorer link in transaction details
Scenario: user views a transaction from a Popular network
Given the user has transactions on Arbitrum, Polygon, or BNB Chain
And the activity feed is filtered by "Popular networks"
When user taps a confirmed transaction from one of those networks
Then a "View on Arbiscan" / "View on Polygonscan" / "View on Bscscan" link appears
And tapping it opens the correct block explorer tx URL in the webview
Scenario: user views a transaction on Ethereum Mainnet
Given the user has transactions on Ethereum Mainnet
When user taps a confirmed transaction
Then a "View on Etherscan" link still appears (regression check)
```
## **Screenshots/Recordings**
`~`
### **Before**
https://github.com/user-attachments/assets/0b15c664-e62e-4811-94f6-e12687454025
### **After**
https://github.com/user-attachments/assets/8c71420a-f95a-4ebe-ba4c-dedd7cfebc0e
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk UI fix that only changes how the transaction details screen
resolves a block explorer URL, with added test coverage to prevent
regressions.
>
> **Overview**
> Fixes missing **“View on …”** links in `TransactionDetails` for
*popular networks* that aren’t present in `networkConfigurations` by
falling back to `PopularList` to resolve `rpcPrefs.blockExplorerUrl`.
>
> Adds unit tests ensuring the correct explorer link text/URL is
produced for Arbitrum, Polygon, and BNB Chain, alongside existing
mainnet/custom-network coverage.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0e7e142. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent d7b7f79 commit e7a93ce
2 files changed
Lines changed: 62 additions & 0 deletions
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
202 | 213 | | |
203 | 214 | | |
204 | 215 | | |
| |||
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
351 | 402 | | |
352 | 403 | | |
353 | 404 | | |
| |||
0 commit comments