fix: have resolveModuleRegistryEntry decode the cid and pass the pubkey
This commit is contained in:
parent
39497a6391
commit
e6318cdc38
|
@ -1,6 +1,7 @@
|
||||||
import { internalModuleCall, modules } from "./queries.js";
|
import { internalModuleCall, modules } from "./queries.js";
|
||||||
import { SignedRegistryEntry } from "@lumeweb/libs5";
|
import { SignedRegistryEntry } from "@lumeweb/libs5";
|
||||||
import { base58btc } from "multiformats/bases/base58";
|
import { base58btc } from "multiformats/bases/base58";
|
||||||
|
import { decodeCid } from "@lumeweb/libweb";
|
||||||
|
|
||||||
const CORE_MODULES = {
|
const CORE_MODULES = {
|
||||||
swarm: "z3o47ar8NBrnaEneBVzZD7QuMRMXjDtQDCpt4xP6mhsdw1cjnJ8mQKfNKGv3",
|
swarm: "z3o47ar8NBrnaEneBVzZD7QuMRMXjDtQDCpt4xP6mhsdw1cjnJ8mQKfNKGv3",
|
||||||
|
@ -30,7 +31,11 @@ function moduleLoaded(module: string) {
|
||||||
return module in modules;
|
return module in modules;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resolveModuleRegistryEntry(pubkey: string) {
|
export async function resolveModuleRegistryEntry(module: string) {
|
||||||
|
const [cid] = decodeCid(module);
|
||||||
|
|
||||||
|
const pubkey = cid.hash;
|
||||||
|
|
||||||
const signedEntry = (await internalModuleCall(
|
const signedEntry = (await internalModuleCall(
|
||||||
CORE_MODULES.s5,
|
CORE_MODULES.s5,
|
||||||
"getRegistryEntry",
|
"getRegistryEntry",
|
||||||
|
|
Loading…
Reference in New Issue