1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

[MMI] Fix signed messages from non custodial accounts (#20506)

* 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 <shane.odlum@consensys.net>
This commit is contained in:
Albert Olivé 2023-08-17 14:58:26 +02:00 committed by GitHub
parent 486ade85f3
commit 5e617ce808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(