Skip to content

Commit

Permalink
fix: case when pkp public key is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansonhkg committed Apr 12, 2024
1 parent 719c266 commit 95ab5d5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2474,10 +2474,12 @@ export class LitNodeClientNodeJs

// Compute the address from the public key if it's provided. Otherwise, the node will compute it.
const pkpEthAddress = (function () {
// prefix '0x' if it's not already prefixed
const hexedPkpPublicKey = hexPrefixed(params.pkpPublicKey!);
if (params.pkpPublicKey) {
// prefix '0x' if it's not already prefixed
const hexedPkpPublicKey = hexPrefixed(params.pkpPublicKey);

if (hexedPkpPublicKey) return computeAddress(hexedPkpPublicKey);
if (hexedPkpPublicKey) return computeAddress(hexedPkpPublicKey);
}

// This will be populated by the node, using dummy value for now.
return '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
Expand Down

0 comments on commit 95ab5d5

Please sign in to comment.