mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 16:48:50 +00:00
Use buildEvent function in more places
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {nip26, getPublicKey, generatePrivateKey} from '.'
|
||||
import { buildEvent } from './test-helpers'
|
||||
|
||||
test('parse good delegation from NIP', async () => {
|
||||
expect(
|
||||
@@ -94,14 +95,10 @@ test('create and verify delegation', async () => {
|
||||
expect(delegation).toHaveProperty('to', pk2)
|
||||
expect(delegation).toHaveProperty('cond', 'kind=1')
|
||||
|
||||
let event = {
|
||||
let event = buildEvent({
|
||||
kind: 1,
|
||||
tags: [['delegation', delegation.from, delegation.cond, delegation.sig]],
|
||||
pubkey: pk2,
|
||||
content: '',
|
||||
created_at: 0,
|
||||
id: '',
|
||||
sig: '',
|
||||
}
|
||||
})
|
||||
expect(nip26.getDelegator(event)).toEqual(pk1)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user