Skip to content

Commit

Permalink
Allow compact public key for admin env (#230)
Browse files Browse the repository at this point in the history
* Handle compact public key for admin env

* Typo fix

* Update admin key env check to include all falsy values

Co-authored-by: Todd Rasband <todd.rasband@gmail.com>

---------

Co-authored-by: Todd Rasband <todd.rasband@gmail.com>
  • Loading branch information
dzikowski and Rasbandit authored May 26, 2024
1 parent 3a51da5 commit d8c8e1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chaincode/src/services/PublicKeyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ export class PublicKeyService {
}

// check if we want the profile of the admin
if (process.env.DEV_ADMIN_PUBLIC_KEY !== undefined && process.env.DEV_ADMIN_USER_ID !== undefined) {
const adminEthAddress = signatures.getEthAddress(process.env.DEV_ADMIN_PUBLIC_KEY);
if (process.env.DEV_ADMIN_PUBLIC_KEY && process.env.DEV_ADMIN_USER_ID) {
const nonCompactPK = signatures.getNonCompactHexPublicKey(process.env.DEV_ADMIN_PUBLIC_KEY);
const adminEthAddress = signatures.getEthAddress(nonCompactPK);

if (adminEthAddress === ethAddress) {
const message =
Expand Down

0 comments on commit d8c8e1e

Please sign in to comment.