From 1e3f6373589a5c1853558a92478dc867fe02033a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 12 Feb 2024 11:42:25 -0600 Subject: [PATCH] verifySignatureWorker -> verifyEventWorker --- src/pipeline.ts | 4 ++-- src/workers/verify.ts | 6 +++--- src/workers/verify.worker.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pipeline.ts b/src/pipeline.ts index 4037a97..0fbce04 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -14,7 +14,7 @@ import { getTagSet } from '@/tags.ts'; import { eventAge, isRelay, nostrDate, nostrNow, Time } from '@/utils.ts'; import { fetchWorker } from '@/workers/fetch.ts'; import { TrendsWorker } from '@/workers/trends.ts'; -import { verifySignatureWorker } from '@/workers/verify.ts'; +import { verifyEventWorker } from '@/workers/verify.ts'; import { signAdminEvent } from '@/sign.ts'; import { lnurlCache } from '@/utils/lnurl.ts'; @@ -25,7 +25,7 @@ const debug = Debug('ditto:pipeline'); * It is idempotent, so it can be called multiple times for the same event. */ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise { - if (!(await verifySignatureWorker(event))) return; + if (!(await verifyEventWorker(event))) return; const wanted = reqmeister.isWanted(event); if (await encounterEvent(event, signal)) return; debug(`NostrEvent<${event.kind}> ${event.id}`); diff --git a/src/workers/verify.ts b/src/workers/verify.ts index 1f71322..21147cf 100644 --- a/src/workers/verify.ts +++ b/src/workers/verify.ts @@ -6,8 +6,8 @@ const worker = Comlink.wrap( new Worker(new URL('./verify.worker.ts', import.meta.url), { type: 'module' }), ); -function verifySignatureWorker(event: NostrEvent): Promise { - return worker.verifySignature(event); +function verifyEventWorker(event: NostrEvent): Promise { + return worker.verifyEvent(event); } -export { verifySignatureWorker }; +export { verifyEventWorker }; diff --git a/src/workers/verify.worker.ts b/src/workers/verify.worker.ts index 01377fe..be66424 100644 --- a/src/workers/verify.worker.ts +++ b/src/workers/verify.worker.ts @@ -1,7 +1,7 @@ import { Comlink, type NostrEvent, type VerifiedEvent, verifyEvent } from '@/deps.ts'; export const VerifyWorker = { - verifySignature(event: NostrEvent): event is VerifiedEvent { + verifyEvent(event: NostrEvent): event is VerifiedEvent { return verifyEvent(event); }, };