Skip to content

Commit 2011852

Browse files
authored
fix(api): ensure address comparison is case-insensitive and remove unlock check for eth_accounts (#127)
1 parent 8fcd476 commit 2011852

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

api/background/handlers/ethereum/accounts.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ export const accountsHandler = async (
1414
};
1515

1616
const isConnected = await ApiUtils.isHostConnected(message.host);
17-
const isUnlocked = ApiUtils.isUnlocked();
18-
if (!isConnected || !isUnlocked) {
17+
if (!isConnected) {
1918
sendResponse(ApiUtils.createApiResponse(message.id, []));
2019
return;
2120
}

api/background/handlers/ethereum/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const isMatchCurrentAddress = async (address: string) => {
1313
const publicKeyHex = account.publicKeys[0];
1414
const uncompressedHex = uncompressPublicKey(publicKeyHex);
1515
const ethAddress = publicKeyToAddress(uncompressedHex);
16-
return address === ethAddress;
16+
return address.toLowerCase() === ethAddress.toLowerCase();
1717
};
1818

1919
export const uncompressPublicKey = (publicKey: string) => {

0 commit comments

Comments
 (0)