From 880a70f153f5d989cae0385c1111aff37feaf0c5 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 4 Sep 2023 03:16:33 -0400 Subject: [PATCH] fix: encodeRegistryValue needs to use type and hashType --- src/cid.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/cid.ts b/src/cid.ts index 0eb9d1e..24603fc 100644 --- a/src/cid.ts +++ b/src/cid.ts @@ -114,7 +114,7 @@ export function encodeRegistryValue( cid.hash, cid.size, CID_TYPES.RESOLVER, - CID_HASH_TYPES.BLAKE3, + hashType, true, ); @@ -122,10 +122,7 @@ export function encodeRegistryValue( return [new Uint8Array(), err]; } - return [ - concatBytes(Uint8Array.from([REGISTRY_TYPES.CID]), ret as Uint8Array), - null, - ]; + return [concatBytes(Uint8Array.from([type]), ret as Uint8Array), null]; } export function decodeRegistryValue(hash: Uint8Array): ErrTuple {