remove the kind type parameter from events and filters.

This commit is contained in:
fiatjaf
2023-12-16 10:10:37 -03:00
parent 1939c46eaa
commit 6a07e7c1cc
21 changed files with 157 additions and 211 deletions

View File

@@ -1,5 +1,6 @@
import { finishEvent, Kind } from './event.ts'
import { finishEvent } from './event.ts'
import { getPublicKey } from './keys.ts'
import { Repost, ShortTextNote } from './kinds.ts'
import { finishRepostEvent, getRepostedEventPointer, getRepostedEvent } from './nip18.ts'
import { buildEvent } from './test-helpers.ts'
@@ -12,7 +13,7 @@ describe('finishRepostEvent + getRepostedEventPointer + getRepostedEvent', () =>
const repostedEvent = finishEvent(
{
kind: Kind.Text,
kind: ShortTextNote,
tags: [
['e', 'replied event id'],
['p', 'replied event pubkey'],
@@ -30,7 +31,7 @@ describe('finishRepostEvent + getRepostedEventPointer + getRepostedEvent', () =>
const event = finishRepostEvent(template, repostedEvent, relayUrl, privateKey)
expect(event.kind).toEqual(Kind.Repost)
expect(event.kind).toEqual(Repost)
expect(event.tags).toEqual([
['e', repostedEvent.id, relayUrl],
['p', repostedEvent.pubkey],
@@ -61,7 +62,7 @@ describe('finishRepostEvent + getRepostedEventPointer + getRepostedEvent', () =>
const event = finishRepostEvent(template, repostedEvent, relayUrl, privateKey)
expect(event.kind).toEqual(Kind.Repost)
expect(event.kind).toEqual(Repost)
expect(event.tags).toEqual([
['nonstandard', 'tag'],
['e', repostedEvent.id, relayUrl],
@@ -88,7 +89,7 @@ describe('finishRepostEvent + getRepostedEventPointer + getRepostedEvent', () =>
describe('getRepostedEventPointer', () => {
it('should parse an event with only an `e` tag', () => {
const event = buildEvent({
kind: Kind.Repost,
kind: Repost,
tags: [['e', 'reposted event id', relayUrl]],
})