|
|
|
scripts/conformance/nip70.test.ts raw
| 1 | import { describe, it, expect } from "vitest" ; | | 2 | import { newEvent, newKey, sockets } from "./helpers.ts" ; | | 3 | | | 4 | const connect = sockets(); | | 5 | | | 6 | describe("NIP-70 protected events" , () => { | | 7 | it("accepts ['-'] events only from a connection authenticated as the author" , async () => { | | 8 | const sk = newKey(); | | 9 | const c = await connect(); | | 10 | const e = newEvent(sk, 1, "members only" , [["-" ]]); | | 11 | c.send("EVENT" , e); | | 12 | expect(await c.expectOK(e.id, false)).toMatch(/^auth-required:/); | | 13 | await c.auth(newKey()); | | 14 | c.send("EVENT" , e); | | 15 | await c.expectOK(e.id, false); | | 16 | await c.auth(sk); | | 17 | await c.publish(e); | | 18 | }); | | 19 | }); |
|
|
About| owner | c01503e8035f |
|---|
| visibility | public |
|---|
| head | d730679639bf |
|---|
Maintainers- c01503e8035f owner
- ba1b5beed5b5 agent hermes
Clonehttps://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git
|