Cherry-picking commits from main to release/7.76.3-ota for PR #29914#29996
Merged
chloeYue merged 1 commit intoMay 12, 2026
Merged
Conversation
## **Description**
This PR adds minimal Predict confirmation hook plumbing needed by the
upcoming Polymarket Deposit Wallet migration.
It wires TransactionController confirmation lifecycle hooks to
PredictController while keeping Predict behavior as passthrough by
default:
- `beforePublish` delegates to `PredictController.beforePublish`, which
currently returns `true`.
- `publish` delegates to `PredictController.publish` before Transaction
Pay / 7702 / Smart Transactions, and continues normal publishing when
Predict returns no transaction hash.
- If a future Predict publish implementation returns `{ transactionHash,
isIntentComplete: true }`, TransactionController marks the latest
transaction meta as `isIntentComplete` before returning the hash.
This PR intentionally contains no Polymarket Deposit Wallet business
logic. It is a small foundation PR for confirmation-team review.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: N/A — preparatory plumbing for the Predict Deposit Wallet
migration.
## **Manual testing steps**
```gherkin
Feature: Predict confirmation hook plumbing
Scenario: non-Predict transactions continue through the normal publish flow
Given a transaction is published through TransactionController
And PredictController.publish returns no transaction hash
When the publish hook runs
Then Transaction Pay / 7702 / Smart Transaction publishing continues as before
Scenario: Predict publish can complete a transaction intent
Given PredictController.publish returns a transaction hash and isIntentComplete
When the publish hook runs
Then normal publishing is short-circuited
And the latest TransactionController transaction meta is marked intent complete
```
Local validation run:
```bash
yarn jest app/core/Engine/controllers/transaction-controller/transaction-controller-init.test.ts app/components/UI/Predict/controllers/PredictController.test.ts --runInBand
yarn lint:tsc
```
## **Screenshots/Recordings**
N/A — no UI changes.
### **Before**
N/A
### **After**
N/A
## **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
- [ ] 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.
#### Performance checks (if applicable)
- [x] I've tested on Android
- N/A — hook plumbing only, no UI/runtime performance path manually
exercised.
- [x] I've tested with a power user scenario
- N/A — hook plumbing only, no account/token rendering path changed.
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- N/A — this PR only adds passthrough hook plumbing.
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **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]
> **Medium Risk**
> Touches transaction publishing lifecycle by adding new hooks and a
short-circuit path, which could affect submission ordering and
integration with Pay/7702/Smart Transactions if miswired. Default
behavior remains passthrough, reducing blast radius.
>
> **Overview**
> Adds Predict-specific confirmation hook plumbing into the transaction
submission lifecycle. TransactionController init now calls
`PredictController:beforePublish` as a new `hooks.beforePublish`, and
calls `PredictController:publish` at the start of `hooks.publish`,
**short-circuiting** the rest of the publish pipeline when Predict
returns a `transactionHash`.
>
> Updates PredictController to expose new messenger methods
(`beforePublish`, `publish`) with default passthrough implementations,
extends messenger action typings/permissions accordingly, and adds unit
tests verifying delegation, call ordering, and the short-circuit
behavior.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3f9d618. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Contributor
|
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release branch (release/*) All E2E tests pre-selected. |
|
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.



Description
This PR adds minimal Predict confirmation hook plumbing needed by the
upcoming Polymarket Deposit Wallet migration.
It wires TransactionController confirmation lifecycle hooks to
PredictController while keeping Predict behavior as passthrough by
default:
beforePublishdelegates toPredictController.beforePublish, whichcurrently returns
true.publishdelegates toPredictController.publishbefore TransactionPay / 7702 / Smart Transactions, and continues normal publishing when
Predict returns no transaction hash.
{ transactionHash, isIntentComplete: true }, TransactionController marks the latesttransaction meta as
isIntentCompletebefore returning the hash.This PR intentionally contains no Polymarket Deposit Wallet business
logic. It is a small foundation PR for confirmation-team review.
Changelog
CHANGELOG entry: null
Related issues
Fixes: N/A — preparatory plumbing for the Predict Deposit Wallet
migration.
Manual testing steps
Local validation run:
Screenshots/Recordings
N/A — no UI changes.
Before
N/A
After
N/A
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
exercised.
performance metrics
For performance guidelines and tooling, see the Performance
Guide.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Touches transaction publishing lifecycle by adding new hooks and a
short-circuit path, which could affect submission ordering and
integration with Pay/7702/Smart Transactions if miswired. Default
behavior remains passthrough, reducing blast radius.
Overview
Adds Predict-specific confirmation hook plumbing into the transaction
submission lifecycle. TransactionController init now calls
PredictController:beforePublishas a newhooks.beforePublish, andcalls
PredictController:publishat the start ofhooks.publish,short-circuiting the rest of the publish pipeline when Predict
returns a
transactionHash.Updates PredictController to expose new messenger methods
(
beforePublish,publish) with default passthrough implementations,extends messenger action typings/permissions accordingly, and adds unit
tests verifying delegation, call ordering, and the short-circuit
behavior.
Reviewed by Cursor Bugbot for commit
3f9d618. Bugbot is set up for automated
code reviews on this repo. Configure
here.