refactor: load logErr direct from libkernel/module
This commit is contained in:
parent
3b2cf557dc
commit
1b9e656e86
|
@ -6,13 +6,13 @@ import {
|
||||||
getKey,
|
getKey,
|
||||||
handleMessage,
|
handleMessage,
|
||||||
handlePresentKey as handlePresentKeyModule,
|
handlePresentKey as handlePresentKeyModule,
|
||||||
|
logErr,
|
||||||
} from "@lumeweb/libkernel/module";
|
} from "@lumeweb/libkernel/module";
|
||||||
import { Buffer } from "buffer";
|
import { Buffer } from "buffer";
|
||||||
import { ed25519 } from "@noble/curves/ed25519";
|
import { ed25519 } from "@noble/curves/ed25519";
|
||||||
import b4a from "b4a";
|
import b4a from "b4a";
|
||||||
import { pubKeyToIpv6 } from "./addr.js";
|
import { pubKeyToIpv6 } from "./addr.js";
|
||||||
import { EventEmitter2 as EventEmitter } from "eventemitter2";
|
import { EventEmitter2 as EventEmitter } from "eventemitter2";
|
||||||
import { logErr } from "@lumeweb/libkernel";
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Protomux from "protomux";
|
import Protomux from "protomux";
|
||||||
import defer, { DeferredPromise } from "p-defer";
|
import defer, { DeferredPromise } from "p-defer";
|
||||||
|
@ -88,13 +88,9 @@ addHandler("createProtomuxMessage", handleCreateProtomuxMessage, {
|
||||||
addHandler("createSwarm", handleCreateSwarm);
|
addHandler("createSwarm", handleCreateSwarm);
|
||||||
|
|
||||||
async function handlePresentKey(aq: ActiveQuery) {
|
async function handlePresentKey(aq: ActiveQuery) {
|
||||||
const pubkey = ed25519.getPublicKey(aq.callerInput.rootKey);
|
|
||||||
handlePresentKeyModule({
|
handlePresentKeyModule({
|
||||||
callerInput: {
|
callerInput: {
|
||||||
seed: {
|
key: aq.callerInput.rootKey,
|
||||||
publicKey: ed25519.getPublicKey(aq.callerInput.rootKey),
|
|
||||||
secretKey: b4a.concat([aq.callerInput.rootKey, pubkey]),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as ActiveQuery);
|
} as ActiveQuery);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue