Skip to content

Commit 7f92dcf

Browse files
test(wrapped-keys-lit-actions): LIT-3920 - Use ethers.utils.computeAddress to get walletAddress instead of exporting the key in testBatchGeneratePrivateKeys
1 parent 84af943 commit 7f92dcf

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

local-tests/tests/wrapped-keys/testBatchGeneratePrivateKeys.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,18 @@ async function verifyEvmSignature(
4949
}
5050
}
5151

52-
const { decryptedPrivateKey } = await exportPrivateKey({
53-
litNodeClient,
54-
network: 'evm',
55-
id: evmResult.generateEncryptedPrivateKey.id,
56-
pkpSessionSigs,
57-
});
52+
const walletAddress = ethers.utils.computeAddress(
53+
evmResult.generateEncryptedPrivateKey.generatedPublicKey
54+
);
5855

5956
const recoveredAddress = verifyMessageSignature();
6057

61-
const wallet = new ethers.Wallet(decryptedPrivateKey);
62-
6358
console.log({
6459
recoveredAddress,
65-
walletAddress: wallet.address,
60+
walletAddress,
6661
signature: evmResult.signMessage.signature,
6762
});
68-
if (recoveredAddress !== wallet.address) {
63+
if (recoveredAddress !== walletAddress) {
6964
throw new Error(
7065
"Recovered address from verifyMessage doesn't match the wallet address"
7166
);

0 commit comments

Comments
 (0)