From d125ee5ecf24598edb2f992d66871bf38759bb29 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 20 Sep 2024 13:36:11 -0500 Subject: [PATCH] remove methods from array used to determine which requests should be enqueued because they can be safely passed through --- app/scripts/metamask-controller.js | 7 ++----- shared/constants/methods-tags.ts | 15 --------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 5513b043ce4e..dc18782c8055 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -155,10 +155,7 @@ import { NotificationServicesPushController, NotificationServicesController, } from '@metamask/notification-services-controller'; -import { - methodsRequiringNetworkSwitch, - methodsWithConfirmation, -} from '../../shared/constants/methods-tags'; +import { methodsRequiringNetworkSwitch } from '../../shared/constants/methods-tags'; ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) import { toChecksumHexAddress } from '../../shared/modules/hexstring-utils'; @@ -5504,7 +5501,7 @@ export default class MetamaskController extends EventEmitter { ) { return false; } - return methodsWithConfirmation.includes(request.method); + return methodsRequiringNetworkSwitch.includes(request.method); }, }); engine.push(requestQueueMiddleware); diff --git a/shared/constants/methods-tags.ts b/shared/constants/methods-tags.ts index 651109dcedcf..a35954769b1b 100644 --- a/shared/constants/methods-tags.ts +++ b/shared/constants/methods-tags.ts @@ -10,24 +10,9 @@ export const methodsRequiringNetworkSwitch = [ 'eth_sendTransaction', 'eth_sendRawTransaction', 'wallet_switchEthereumChain', - 'wallet_addEthereumChain', 'wallet_watchAsset', 'eth_signTypedData', 'eth_signTypedData_v3', 'eth_signTypedData_v4', 'personal_sign', ] as const; - -/** - * This is a list of methods that can cause a confirmation to be - * presented to the user. Note that some of these methods may - * only sometimes cause a confirmation to appear. - */ -export const methodsWithConfirmation = [ - ...methodsRequiringNetworkSwitch, - 'wallet_requestPermissions', - 'wallet_requestSnaps', - 'eth_decrypt', - 'eth_requestAccounts', - 'eth_getEncryptionPublicKey', -];