change tests and nips to use the new api.

This commit is contained in:
fiatjaf
2023-12-19 13:49:03 -03:00
parent 1908e1ee0d
commit fe87529646
32 changed files with 151 additions and 163 deletions

View File

@@ -1,6 +1,6 @@
/* global WebSocket */
import { verifySignature, validateEvent, type Event, EventTemplate } from './event.ts'
import { verifyEvent, validateEvent, type Event, EventTemplate } from './pure.ts'
import { matchFilters, type Filter } from './filter.ts'
import { getHex64, getSubscriptionId } from './fakejson.ts'
import { Queue, normalizeURL } from './utils.ts'
@@ -161,7 +161,7 @@ export class Relay {
case 'EVENT': {
const so = this.openSubs.get(data[1] as string) as Subscription
const event = data[2] as Event
if ((this.trusted || (validateEvent(event) && verifySignature(event))) && matchFilters(so.filters, event)) {
if ((this.trusted || (validateEvent(event) && verifyEvent(event))) && matchFilters(so.filters, event)) {
so.onevent(event)
}
return