fix: encodeRegistryValue needs to use type and hashType

This commit is contained in:
Derrick Hammer 2023-09-04 03:16:33 -04:00
parent 1db8cb7427
commit 880a70f153
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 5 deletions

View File

@ -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<CID> {