refactor(activity): migrate non-EVM transaction mapping - #34682
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Pick up shared mapper exports and treat missing token amounts with symbol/assetId as 0 in getHumanReadableTokenAmount. Co-authored-by: Cursor <cursoragent@cursor.com>
…ctly Remove the mobile keyring mapper wrapper. Call sites import mapKeyringTransaction from @metamask/client-utils and attach mobile raw plus bridge enrichment at the call site, matching extension. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop stale account-tree-controller descriptor range so yarn --immutable succeeds in CI. Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
24bf7c0 to
2429c81
Compare
Prettier-fix call sites, allow optional bridge.from for enrichment, and default missing transaction.fees before mapKeyringTransaction so tests and incomplete fixtures do not crash in client-utils getFees. Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Address flaky-test bot feedback on MultichainTransactionsView by resetting fake timers after each test, and align activityTokenFormat with the client-utils missing-amount-as-zero display. Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Match extension: re-export Status/Fee/FiatAmount and base ActivityItem from client-utils, keep only mobile transition extras (raw, isEarliestNonce, isUnlimitedApproval, stake/unstake/swapIncomplete, perps order kinds). Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
| * Produces ActivityListItem[] from API EVM and non-EVM transaction sources. | ||
| * Local EVM transactions are handled separately by useLocalActivityItems. | ||
| */ | ||
| import { mapKeyringTransaction } from '@metamask/client-utils'; |
75cd117 to
c45456a
Compare
c45456a to
04724d3
Compare
|
ff90a94 to
b7914ce
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b7914ce. Configure here.
b7914ce to
812cb3a
Compare
🧪 Flaky unit test detectionRun history flaky detectionHistorical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow. Failures / runs sampled per window:
AI-detected flaky patterns
|




Description
Migrate call sites to import
mapKeyringTransactiondirectly from@metamask/client-utils(same as extension)Call sites apply the bridge quote for cross-chain bridge history as needed.
Related PRs:
Changelog
CHANGELOG entry: null
Related issues
Refs: #34655
Manual testing steps
Screenshots/Recordings
N/A — mapper refactor; no UI design changes
Before
N/A
After
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Note
Medium Risk
Touches unified and multichain activity pipelines and bridge pending/success semantics; dependency bump on client-utils, but behavior is covered by new and updated tests.
Overview
Non-EVM activity rows now use
mapKeyringTransactionfrom@metamask/client-utils(v2.0.1) instead of the removed mobile vendored mapper.ActivityListItem/ActivityKindare aligned with client-utils types, with a thin mobile layer for perps/stake and similar kinds.Cross-chain bridge enrichment is no longer inside the keyring mapper. A new
applyBridgeQuotehelper rewrites mapped items tobridgewith quote-derived tokens and status (pending until the dest leg completes).mapNonEvmTransactions,ActivityList, andMultichainTransactionsViewcall it when bridge history is cross-chain; same-chain swaps stay swaps.Multichain asset-detail rows take a pre-built
ActivityListItemand resolve the raw keyring tx from Redux only for analytics and legacy sheets.rampBuy/rampSellget buy/sell titles and icons. Token display treats missing amounts with a symbol as0(e.g.-0 ETH) in list/details formatting.Reviewed by Cursor Bugbot for commit 812cb3a. Bugbot is set up for automated code reviews on this repo. Configure here.