refactor: load logErr direct from libkernel/module

This commit is contained in:
Derrick Hammer 2023-07-04 00:59:01 -04:00
parent 3b2cf557dc
commit 1b9e656e86
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 6 deletions

View File

@ -6,13 +6,13 @@ import {
getKey,
handleMessage,
handlePresentKey as handlePresentKeyModule,
logErr,
} from "@lumeweb/libkernel/module";
import { Buffer } from "buffer";
import { ed25519 } from "@noble/curves/ed25519";
import b4a from "b4a";
import { pubKeyToIpv6 } from "./addr.js";
import { EventEmitter2 as EventEmitter } from "eventemitter2";
import { logErr } from "@lumeweb/libkernel";
// @ts-ignore
import Protomux from "protomux";
import defer, { DeferredPromise } from "p-defer";
@ -88,13 +88,9 @@ addHandler("createProtomuxMessage", handleCreateProtomuxMessage, {
addHandler("createSwarm", handleCreateSwarm);
async function handlePresentKey(aq: ActiveQuery) {
const pubkey = ed25519.getPublicKey(aq.callerInput.rootKey);
handlePresentKeyModule({
callerInput: {
seed: {
publicKey: ed25519.getPublicKey(aq.callerInput.rootKey),
secretKey: b4a.concat([aq.callerInput.rootKey, pubkey]),
},
key: aq.callerInput.rootKey,
},
} as ActiveQuery);