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,4 +1,4 @@
import { Event, finishEvent, verifySignature } from './event.ts'
import { Event, finalizeEvent, verifyEvent } from './pure.ts'
import { Repost } from './kinds.ts'
import { EventPointer } from './nip19.ts'
@@ -23,9 +23,9 @@ export function finishRepostEvent(
t: RepostEventTemplate,
reposted: Event,
relayUrl: string,
privateKey: string,
privateKey: Uint8Array,
): Event {
return finishEvent(
return finalizeEvent(
{
kind: Repost,
tags: [...(t.tags ?? []), ['e', reposted.id, relayUrl], ['p', reposted.pubkey]],
@@ -89,7 +89,7 @@ export function getRepostedEvent(event: Event, { skipVerification }: GetReposted
return undefined
}
if (!skipVerification && !verifySignature(repostedEvent)) {
if (!skipVerification && !verifyEvent(repostedEvent)) {
return undefined
}