refactor(confirmations): use canonical transaction approval preparation - #35754
refactor(confirmations): use canonical transaction approval preparation#35754pedronfigueiredo wants to merge 2 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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
The change is a refactoring that delegates sponsorship normalization to an upstream library function. While the intent is equivalent behavior, the new Performance Test Selection: |
🧪 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
|
Related pull requests
Description
Moves Mobile's pre-approval sponsorship and
isExternalSignnormalization to the canonicalprepareTransactionForApprovalAPI in@metamask/transaction-controller.Mobile continues to own capability discovery and all client-specific behavior: signer-versus-payer handling,
waitForResult, Smart Transaction fee-token batch construction, fee-token EIP-7702 external signing, hardware send deferral, ApprovalController acceptance, fiat branching, network enablement, and product navigation.Characterization coverage was strengthened before the migration for hardware payer/software signer behavior, stale external signing, existing Smart Transaction batches, ignored fee tokens, and metadata passed to hardware signing.
Important
This PR is intentionally a draft and marked
DO-NOT-MERGE. The Core implementation is not released yet, so the production dependency bump is not included. The branch was validated using an uncommitted localfile:link to the Core worktree. Once Core publishes the API, this PR needs the released/preview dependency version and a final clean-install validation.Changelog
CHANGELOG entry: null
Related issues
Refs: https://github.com/MetaMask/core
Cross-repository canonical transaction approval preparation handoff; the corresponding Core PR is pending.
Manual testing steps
Automated local-integration validation completed against the Core worktree:
useTransactionConfirm.test.ts: 54 passeduseConfirmActions.test.ts: 16 passeduseApprovalRequest.test.ts: 10 passedFull
yarn lint:tscis currently blocked by the pre-existing missingapp/util/termsOfUse/termsOfUseContentmodule.Screenshots/Recordings
N/A — headless transaction metadata refactor with no UI changes.
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleN/A — this refactor does not add runtime instrumentation or alter rendering/performance-sensitive UI.
Pre-merge reviewer checklist