fix: pass the fullBytes of the hash, and return the CID in string form with fromRegistry
This commit is contained in:
parent
b6142a654d
commit
2d616979c3
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue