fix: incorrect non-evm url in useActivityBlockExplorer#33396
fix: incorrect non-evm url in useActivityBlockExplorer#33396stanleyyconsensys wants to merge 4 commits into
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
| } | ||
|
|
||
| if (isEvmChainId(chainId)) { | ||
| const base = findBlockExplorerUrlForChain(chainId, networkConfigurations); |
There was a problem hiding this comment.
this only use when it is evm, so move it to evm block
| const url = buildNonEvmTxUrl(base, hash); | ||
| return { url, title: hostnameOf(url) }; | ||
| const url = getNonEvmTransactionUrl(hash, chainId); | ||
| return url ? { url, title: hostnameOf(url) } : undefined; |
There was a problem hiding this comment.
url can be empty, so align the undefined response
There was a problem hiding this comment.
Pull request overview
Fixes non‑EVM activity “View on explorer” links by switching the non‑EVM URL construction in useActivityBlockExplorer to use the shared multichain explorer URL formatter (core/Multichain/utils#getTransactionUrl), avoiding malformed/nonstandard /tx/ URL patterns for chains like Solana and Tron.
Changes:
- Update
useActivityBlockExplorerto usegetTransactionUrlfor non‑EVM chains while keeping the existing EVM explorer resolution path. - Update hook tests to validate non‑EVM URLs for Solana and Tron mainnet scopes and to return
undefinedfor unsupported non‑EVM chains.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/components/Views/ActivityDetails/hooks/useActivityBlockExplorer.ts | Uses multichain explorer URL utility for non‑EVM tx links; keeps EVM behavior via existing EVM explorer helpers. |
| app/components/Views/ActivityDetails/hooks/useActivityBlockExplorer.test.ts | Updates tests to cover Solana/Tron non‑EVM URLs and unsupported-chain behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
This is a contained refactor/bug fix with:
The change only affects the URL displayed when a user taps "View on block explorer" in the ActivityDetails screen for non-EVM transactions (Solana, Tron). This is a minor UI detail not covered by any smoke E2E test suite. No E2E tags are warranted. Performance Test Selection: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #33396 +/- ##
=======================================
Coverage 84.40% 84.40%
=======================================
Files 6132 6135 +3
Lines 163836 163813 -23
Branches 39995 39990 -5
=======================================
- Hits 138288 138269 -19
- Misses 16053 16054 +1
+ Partials 9495 9490 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|



Description
hook
useActivityBlockExploreris return a incorrect explorer url for non-evm, it assume every non-evm is using${baseURl}/tx/${hash}patternthe fix using the predefine function getTransactionUrl from multichain urls, which already done in a better sharp
@vinnyhoward
This useActivityBlockExplorer somehow is redundant from
useMultichainBlockExplorerTxUrl, but the PR is not going to make change to replaceuseActivityBlockExplorer, but we should consider to consolidate itChangelog
CHANGELOG entry: Fixed useActivityBlockExplorer return incorrect URL for non-evm
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Scoped change to activity explorer link resolution with existing multichain URL helpers; EVM path unchanged and tests cover the new behavior.
Overview
Activity details non-EVM “view on explorer” links were built with a one-size-fits-all
${baseUrl}/tx/${hash}(or simple template) rule, which produced wrong URLs for chains like Solana and Tron.Non-EVM resolution now delegates to multichain
getTransactionUrl, which uses the existing per-chain explorer URL formats. EVM behavior is unchanged: it still resolves the base URL from network configuration andgetBlockExplorerTxUrl. Unsupported non-EVM chain IDs return no link whengetTransactionUrlyields an empty URL.Tests were aligned to assert Solana and Tron mainnet URLs and to expect
undefinedfor unknown non-EVM chains instead of the old generic templating cases.Reviewed by Cursor Bugbot for commit 51676dc. Bugbot is set up for automated code reviews on this repo. Configure here.