tinyrelayfile
tinyrelay/scripts/conformance/nip70.test.ts/

scripts/conformance/nip70.test.ts raw
1import { describe, it, expect } from "vitest";
2import { newEvent, newKey, sockets } from "./helpers.ts";
3
4const connect = sockets();
5
6describe("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

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs