fix: display non ETH native transactions in the native token detail page#28977
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: What changed: The old logic used Impact: This affects the transaction history display in the Token Details / Asset Overview screen. The Risk level: Low - this is a focused bug fix with accompanying unit tests. No architectural changes, no controller changes, no shared infrastructure changes. The fix is well-scoped and the new test file validates the corrected behavior. No other tags needed: The change doesn't touch confirmations, swaps, accounts, network management, or any other feature areas covered by other tags. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|



Description
This pull request refines the transaction filtering logic for native and token assets. It adds comprehensive unit tests for the
useTokenTransactionshook. The most important changes are:Filtering Logic:
useTokenTransactions.tsto use anisNativeTokencheck, ensuring that native tokens (including non-ETH chains) use the correct transaction filter. This prevents token-category transactions from appearing in native token views and vice versa.Testing:
useTokenTransactions.test.tsthat covers various scenarios for native tokens (ETH and non-ETH like MON), ERC20 tokens, cross-chain filtering, and edge cases (such as gas-sponsored native sends and exclusion of unrelated transactions). This ensures robust regression coverage and correct behavior for transaction filtering.These changes improve both the reliability of the
useTokenTransactionshook and confidence in its behavior through targeted unit tests.Changelog
CHANGELOG entry: add transactions in the token details for gas fees sponsored transactions
Related issues
Fixes: #27247 [Bug]: Gas Sponsored Send and Swap are not displayed on the Activity section of the Token details page
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
Medium Risk
Changes transaction filtering logic in
useTokenTransactionsfor native vs token assets, which can impact what users see in token detail activity across chains. Risk is mitigated by a new unit test suite covering native/non-native and cross-chain scenarios.Overview
Fixes
useTokenTransactionsfilter selection to treat any native asset (asset.isNativeorasset.isETH) as using the native/ethFilter, instead of keying off symbol/address (which could hide non-ETH native transactions).Adds a comprehensive
useTokenTransactions.test.tssuite that regression-tests native-token vs ERC20 filtering (including gas-sponsored/zero-fee native sends), exclusion of token-category txs from native views, and cross-chain exclusion.Reviewed by Cursor Bugbot for commit 49c9f74. Bugbot is set up for automated code reviews on this repo. Configure here.