From 5e617ce808e02da3a8981b874c22d7411fdfb0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Oliv=C3=A9?= Date: Thu, 17 Aug 2023 14:58:26 +0200 Subject: [PATCH] =?UTF-8?q?[MMI]=C2=A0Fix=20signed=20messages=20from=20non?= =?UTF-8?q?=20custodial=20accounts=20(#20506)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Alter behaviour in MMI controller to use the original code path for signed messages that are from non custodial accounts * Improved readability * Removed unused import --------- Co-authored-by: Shane Terence Odlum --- app/scripts/controllers/mmi-controller.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/scripts/controllers/mmi-controller.js b/app/scripts/controllers/mmi-controller.js index 6aec42962..f5fcc339c 100644 --- a/app/scripts/controllers/mmi-controller.js +++ b/app/scripts/controllers/mmi-controller.js @@ -578,7 +578,12 @@ export default class MMIController extends EventEmitter { } async newUnsignedMessage(msgParams, req, version) { - const updatedMsgParams = { ...msgParams, deferSetAsSigned: true }; + // The code path triggered by deferSetAsSigned: true is for custodial accounts + const accountDetails = this.custodyController.getAccountDetails( + msgParams.from, + ); + const isCustodial = Boolean(accountDetails); + const updatedMsgParams = { ...msgParams, deferSetAsSigned: isCustodial }; if (req.method.includes('eth_signTypedData')) { return await this.signatureController.newUnsignedTypedMessage(