[pull] main from MetaMask:main#290
Merged
Merged
Conversation
…end flow (#21515) <!-- 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? --> Similarly what's being done in MetaMask/metamask-extension#37047 this PR implements a short living cache for `Name` component to use after send flow. ## **Changelog** <!-- 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: Show ENS name in the confirmation after picking ENS recipient in send flow ## **Related issues** Fixes: #19072 ## **Manual testing steps** 1. Go to send flow 2. Pick ENS recipient 3. Proceed into confirmation - you should be able to see ENS in the confirmation now ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/d74ee373-8df0-43d4-924a-5520eb203240 ## **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] > Adds a 5‑minute ENS resolution cache used post-send and surfaces cached ENS in Name display; integrates with validation and updates tests. > > - **ENS caching (5 min TTL)**: > - Add `useSendFlowEnsResolutions` with `setResolvedAddress` and `getResolvedENSName` to cache ENS per `chainId:address`. > - **Send flow integration**: > - Update `useNameValidation` to call `setResolvedAddress(chainId, ensName, resolvedAddress)` when `isEvmSendType` and ENS resolves. > - **Display name integration**: > - Update `useDisplayName` to read `ensName` via `getResolvedENSName(variation, value)` and prioritize it in `name` selection. > - **Tests**: > - New tests for cache storage, expiration, chain separation, overwrite behavior. > - Extend `useNameValidation` tests to assert cache writes only for EVM/ENS. > - Add `useDisplayName` test to verify ENS name is returned. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c5a24a9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!--
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 -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )