Commit 42d139d
authored
fix(UnifiedTransactionsView): missing blockexplorer links (#21921)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
This PR fixes missing blockexplorer links by not relying only on network
config from NetworksController and getting it from `useBlockExplorer`
for networks without blockexplorer.
We should potentially fill the initial list somehow or use only one the
new method.
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fixed a bug that was preventing blockexplorer links to
appear on some networks (ie. Linea)
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: Show Linea transactions on blockexplorer
Scenario: user navigates to Linea blockexplorer
Given Linea is available on the networks list
When user goes to activity and chooses Linea as a network
Then "View full history on Lineascan" button is visible and working correctly
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<img width="407" height="911" alt="Screenshot 2025-10-30 at 14 14 49"
src="https://github.com/user-attachments/assets/f7b88a20-54bf-4d21-962f-66a7efb3f3e9"
/>
<!-- [screenshots/recordings] -->
### **After**
<img width="409" height="913" alt="Screenshot 2025-10-30 at 13 19 03"
src="https://github.com/user-attachments/assets/b57e0655-314d-42a7-89f3-dd6c5f202ca7"
/>
<!-- [screenshots/recordings] -->
## **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
- [x] 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**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] 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]
> Restores missing EVM block explorer links by preferring config URLs
and falling back to useBlockExplorer, adjusts footer logic, updates
tests, and changes Palm explorer URL.
>
> - **Transactions (UnifiedTransactionsView)**
> - Integrates `useBlockExplorer` and selects `blockExplorerUrl` from
`configBlockExplorerUrl` or `getBlockExplorerUrl(address)` when config
is absent.
> - Computes `configBlockExplorerUrl` respecting the
per-dapp/multiselect selector (only when exactly one EVM chain is
selected).
> - Updates `onViewBlockExplorer` to use `getBlockExplorerAddressUrl`
only when a config URL exists; otherwise navigates directly with
PopularList explorer URL and name.
> - Passes `providerType` to `TransactionsFooter` only when
`configBlockExplorerUrl` is defined.
> - Improves refresh handler to await `updateIncomingTransactions` and
manage `refreshing` state.
> - Enhances non‑EVM explorer resolution (uses CAIP `chainId` prop when
no non‑EVM networks are enabled).
> - **UI (TransactionsFooter)**
> - Safeguards provider comparison: only treat as non‑RPC when
`providerType` is defined and not `RPC`.
> - **Networks**
> - Updates Palm block explorer to `https://palm.chainlens.com`.
> - **Tests**
> - Adds mocks for `useBlockExplorer` and `selectProviderConfig`;
updates expectations for explorer URL selection and refresh behavior;
ensures no `getBlockExplorerAddressUrl` call when multiple EVM chains.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
db74123. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 4d7e238 commit 42d139d
File tree
4 files changed
+86
-19
lines changed- app
- components
- UI/Transactions
- Views/UnifiedTransactionsView
- util/networks
4 files changed
+86
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
Lines changed: 35 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
148 | 159 | | |
149 | 160 | | |
150 | 161 | | |
| |||
183 | 194 | | |
184 | 195 | | |
185 | 196 | | |
| 197 | + | |
186 | 198 | | |
187 | 199 | | |
188 | 200 | | |
| |||
292 | 304 | | |
293 | 305 | | |
294 | 306 | | |
| 307 | + | |
295 | 308 | | |
296 | 309 | | |
297 | 310 | | |
| |||
312 | 325 | | |
313 | 326 | | |
314 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
315 | 332 | | |
316 | 333 | | |
317 | 334 | | |
| |||
350 | 367 | | |
351 | 368 | | |
352 | 369 | | |
| 370 | + | |
| 371 | + | |
353 | 372 | | |
354 | 373 | | |
355 | 374 | | |
| |||
410 | 429 | | |
411 | 430 | | |
412 | 431 | | |
| 432 | + | |
413 | 433 | | |
414 | | - | |
| 434 | + | |
| 435 | + | |
415 | 436 | | |
416 | 437 | | |
417 | 438 | | |
| |||
583 | 604 | | |
584 | 605 | | |
585 | 606 | | |
| 607 | + | |
| 608 | + | |
586 | 609 | | |
587 | 610 | | |
588 | 611 | | |
| |||
599 | 622 | | |
600 | 623 | | |
601 | 624 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
608 | 628 | | |
609 | 629 | | |
610 | 630 | | |
| |||
635 | 655 | | |
636 | 656 | | |
637 | 657 | | |
| 658 | + | |
| 659 | + | |
638 | 660 | | |
639 | 661 | | |
640 | 662 | | |
| |||
682 | 704 | | |
683 | 705 | | |
684 | 706 | | |
| 707 | + | |
| 708 | + | |
685 | 709 | | |
686 | 710 | | |
687 | 711 | | |
| |||
720 | 744 | | |
721 | 745 | | |
722 | 746 | | |
| 747 | + | |
| 748 | + | |
723 | 749 | | |
724 | 750 | | |
725 | 751 | | |
| |||
754 | 780 | | |
755 | 781 | | |
756 | 782 | | |
| 783 | + | |
| 784 | + | |
757 | 785 | | |
758 | 786 | | |
759 | 787 | | |
| |||
Lines changed: 49 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
360 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
361 | 367 | | |
362 | 368 | | |
363 | 369 | | |
| |||
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
380 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
381 | 404 | | |
382 | 405 | | |
383 | 406 | | |
| |||
388 | 411 | | |
389 | 412 | | |
390 | 413 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
396 | 424 | | |
397 | | - | |
398 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
399 | 433 | | |
400 | 434 | | |
401 | 435 | | |
| |||
410 | 444 | | |
411 | 445 | | |
412 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
413 | 451 | | |
414 | 452 | | |
415 | 453 | | |
| |||
461 | 499 | | |
462 | 500 | | |
463 | 501 | | |
464 | | - | |
| 502 | + | |
465 | 503 | | |
466 | 504 | | |
467 | 505 | | |
| |||
494 | 532 | | |
495 | 533 | | |
496 | 534 | | |
| 535 | + | |
497 | 536 | | |
498 | 537 | | |
499 | 538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
0 commit comments