From 03df12695567fcd909ccba5abbcedb30a9371a7b Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Tue, 12 Nov 2024 16:40:50 +0200 Subject: [PATCH] fix(WalletConnect): Fix the parsed account in the session request The account in the session request composed by the dApp can have a different case from what Status is using. When resolving the session request the account address will be replaced with the one from the account model. --- .../Wallet/services/dapps/types/SessionRequestResolver.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/app/AppLayouts/Wallet/services/dapps/types/SessionRequestResolver.qml b/ui/app/AppLayouts/Wallet/services/dapps/types/SessionRequestResolver.qml index 34494a44c3..f89839c466 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/types/SessionRequestResolver.qml +++ b/ui/app/AppLayouts/Wallet/services/dapps/types/SessionRequestResolver.qml @@ -61,13 +61,15 @@ SQUtils.QObject { return { request: null, error: SessionRequest.InvalidChainId } } - const validAccount = !!SQUtils.ModelUtils.getFirstModelEntryIf(accountsModel, (account) => { + const validAccount = SQUtils.ModelUtils.getFirstModelEntryIf(accountsModel, (account) => { return account.address.toLowerCase() === request.account.toLowerCase(); }) if (!validAccount) { console.warn("SessionRequestResolver - resolveEvent - invalid account", request.account) return { request: null, error: SessionRequest.InvalidAccount } } + // Override the account with the validated one to always match the case + request.account = validAccount.address return { request, error: SessionRequest.NoError } } catch (e) {