From 871b706d769ff3495d948f8f5bb40c45ec0d6465 Mon Sep 17 00:00:00 2001 From: Prithpal Sooriya Date: Sat, 11 Jan 2025 00:11:39 +0000 Subject: [PATCH] fix (cherrypick): invoke_snap RPC requests inside the built-in browser (#12928) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Cherry-pick of https://github.com/MetaMask/metamask-mobile/commit/d35a2a0ea8f9ac7a084a684bb7e1c707cba6a43f (https://github.com/MetaMask/metamask-mobile/pull/12923) ## **Related issues** Fixes: https://infura.atlassian.net/issues/MDD-117 / https://consensys.slack.com/archives/C027M10HGEA/p1736428038068929 ## **Manual testing steps** 1. Visit this preview in the MM browser: https://metamask-docs-git-snap-debugging-branch-consensys-ddffed67.vercel.app/developer-tools/faucet/ 2. (optional) Press the "Debug Test" button, it should complete 3. Press the "Connect MetaMask" button, it should complete ## **Screenshots/Recordings** ### **Before** ### **After** ## **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 - [x] 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. ## **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. --- app/core/Engine/Engine.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/core/Engine/Engine.ts b/app/core/Engine/Engine.ts index 95c23de7ba2..69572aaecfc 100644 --- a/app/core/Engine/Engine.ts +++ b/app/core/Engine/Engine.ts @@ -190,6 +190,8 @@ import { import { snapKeyringBuilder } from '../SnapKeyring'; import { removeAccountsFromPermissions } from '../Permissions'; import { keyringSnapPermissionsBuilder } from '../SnapKeyring/keyringSnapsPermissions'; +///: END:ONLY_INCLUDE_IF +///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps) import { HandleSnapRequestArgs } from '../Snaps/types'; import { handleSnapRequest } from '../Snaps/utils'; ///: END:ONLY_INCLUDE_IF