Skip to content

Commit

Permalink
remove methods from array used to determine which requests should be …
Browse files Browse the repository at this point in the history
…enqueued because they can be safely passed through
  • Loading branch information
adonesky1 committed Sep 20, 2024
1 parent c323433 commit d125ee5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
7 changes: 2 additions & 5 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down
15 changes: 0 additions & 15 deletions shared/constants/methods-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

0 comments on commit d125ee5

Please sign in to comment.