MCPcopy Index your code
hub / github.com/cameri/nostream / makeValidEvent

Function makeValidEvent

test/unit/handlers/event-message-handler.spec.ts:681–690  ·  view source on GitHub ↗
(kind: EventKinds)

Source from the content-addressed store, hash-verified

679 const PRIVKEY = '0000000000000000000000000000000000000000000000000000000000000001'
680
681 async function makeValidEvent(kind: EventKinds): Promise<Event> {
682 const unsigned = await identifyEvent({
683 pubkey: '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
684 created_at: 1700000000,
685 kind,
686 tags: [],
687 content: '',
688 })
689 return signEvent(PRIVKEY)(unsigned)
690 }
691
692 it('blocks kind 13 (Seal) with a clear rejection message', async () => {
693 const sealEvent = await makeValidEvent(EventKinds.SEAL)

Callers 1

Calls 2

identifyEventFunction · 0.90
signEventFunction · 0.90

Tested by

no test coverage detected