feat(transaction-controller): pass isInternal: true at internal call sites#29525
Draft
matthewwalsh0 wants to merge 1 commit intomainfrom
Draft
feat(transaction-controller): pass isInternal: true at internal call sites#29525matthewwalsh0 wants to merge 1 commit intomainfrom
isInternal: true at internal call sites#29525matthewwalsh0 wants to merge 1 commit intomainfrom
Conversation
…sites Adopts the new `isInternal` flag introduced in `@metamask/transaction-controller@65.0.0`. Every internal call site (Send, mUSD, Merkl, Card, Perps, Money, Stake, Predict, BridgeStatus, developer tools) now passes `isInternal: true` so the controller's internal-only validation behaviour is preserved without relying on `origin === 'metamask'` or `origin === MMM_ORIGIN`. Dapp-driven paths (BackgroundBridge, WalletConnect, deeplink handlers) keep the default `isInternal: false`. Also bumps `@metamask/messenger` to `^1.2.0` to match the version required by the new transaction-controller, fixes a latent generic type-arity issue in `ControllerMessenger`'s definition surfaced by the stricter typing in messenger 1.2, and adapts SnapsMethodMiddleware to the new `call`-overload-bound `this` typing.
Contributor
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
|
✅ E2E Fixture Validation — Schema is up to date |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adopts the new
isInternalflag introduced in@metamask/transaction-controller@65.0.0. The controller previously inferred internal vs external trust from the requestorigin(origin === ORIGIN_METAMASK⇒ internal). That coupling has been replaced with an explicit, optionalisInternal: booleanflag onaddTransaction/addTransactionBatch, defaulting tofalse. To keep current behaviour, every internal call site in mobile must opt in.This PR adopts
isInternal: trueat the internal entry points and leaves dapp-driven paths defaulting tofalse:confirmations/utils/send.ts)isInternal: trueEarn/utils/musdConversionTransaction.ts)isInternal: trueEarn/.../useMerklClaimTransaction.ts)isInternal: trueCard/hooks/useCardDelegation.ts)isInternal: trueMoney/hooks/useMoneyAccount.tsandMoney/utils/moneyAccountTransactions.ts)isInternal: truePerps/hooks/usePerpsWithdrawConfirmation.ts)isInternal: trueisInternal: truePredict/controllers/PredictController.ts)isInternal: trueisInternal: trueisInternal: trueBackgroundBridge(eth_sendTransaction,wallet_sendCalls)false)false)deeplink.ts,handleApproveUrl.ts)false)Incidental changes
@metamask/messengerto^1.2.0to match the version required by transaction-controller65.0.0. After dedupe, all packages resolve to1.2.0.app/core/Engine/types.ts'sControllerMessengeralias. Messenger1.2declaresMessengerwith four generic parameters (Namespace,Action,Event,Parent), and mobile's alias only provided three, soParentdefaulted tonever. Concrete controller messengers (which setParentexplicitly) were therefore not assignable toControllerMessenger. Widened toMessenger<string, ActionConstraint, EventConstraint, any>.SnapsMethodMiddlewareto messenger 1.2'scall-overload-boundthistyping. The pre-existingcontrollerMessenger.call.bind(controllerMessenger, ...)pattern no longer type-checks because eachcalloverload now declares its ownthis. A small typedcallMessengerwrapper restores partial application without changing runtime behaviour.Preview build
This PR depends on the unreleased core PR via
previewBuilds:These will be replaced with released versions before this PR merges.
Manual testing steps
submitted.eth_sendTransaction— confirmation flow should still display the dapp's origin and dapp-suggested gas fees.Pre-merge author checklist