From 2d616979c3249c7c0d9c3da1574ce9ca22352405 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 11 Sep 2023 05:44:19 -0400 Subject: [PATCH] fix: pass the fullBytes of the hash, and return the CID in string form with fromRegistry --- src/coreModules.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreModules.ts b/src/coreModules.ts index fc8f3d7..6819814 100644 --- a/src/coreModules.ts +++ b/src/coreModules.ts @@ -1,5 +1,5 @@ import { internalModuleCall, modules } from "./queries.js"; -import { SignedRegistryEntry, CID } from "@lumeweb/libs5"; +import { CID, SignedRegistryEntry } from "@lumeweb/libs5"; const CORE_MODULES = { swarm: "zdiLmwHCC15afFNLYzzT2DVV7m27SrBde7oXHdSzAe95GpFZXzdpatUN6b", @@ -32,7 +32,7 @@ function moduleLoaded(module: string) { export async function resolveModuleRegistryEntry(module: string) { const cid = CID.decode(module); - const pubkey = cid.hash; + const pubkey = cid.hash.fullBytes; const signedEntry = (await internalModuleCall( CORE_MODULES.s5, @@ -40,5 +40,5 @@ export async function resolveModuleRegistryEntry(module: string) { { pubkey }, )) as SignedRegistryEntry; - const entry = CID.fromRegistry(signedEntry.data); + return CID.fromRegistry(signedEntry.data).toString(); }