refactor: only prefix ED25519 if its not the 1st byte

This commit is contained in:
Derrick Hammer 2023-09-03 20:54:57 -04:00
parent beb42152b8
commit bd04087a97
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -115,7 +115,9 @@ async function handleGetRegistryEntry(aq: ActiveQuery) {
pubkey = ensureBytes("registry entry ", pubkey, 32);
pubkey = concatBytes(Uint8Array.from([CID_HASH_TYPES.ED25519]), pubkey);
if (pubkey[0] !== CID_HASH_TYPES.ED25519) {
pubkey = concatBytes(Uint8Array.from([CID_HASH_TYPES.ED25519]), pubkey);
}
const ret = await node.services.registry.get(pubkey);