mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
eslint and minor fixes.
This commit is contained in:
8
event.js
8
event.js
@@ -34,13 +34,13 @@ export function verifySignature(event) {
|
||||
if (event.id !== getEventHash(event)) return false
|
||||
return verifySchnorr(
|
||||
Buffer.from(event.id, 'hex'),
|
||||
Buffer.from(event.pubkey, 'hex')
|
||||
Buffer.from(event.sig, 'hex'),
|
||||
Buffer.from(event.pubkey, 'hex'),
|
||||
Buffer.from(event.sig, 'hex')
|
||||
)
|
||||
}
|
||||
|
||||
export function signEvent(event, key) {
|
||||
let eventHash = Buffer.from(getEventHash(event), 'hex')
|
||||
let key = Buffer.from(key, 'hex')
|
||||
return Buffer.from(signSchnorr(eventHash, key)).toString('hex')
|
||||
let keyB = Buffer.from(key, 'hex')
|
||||
return Buffer.from(signSchnorr(eventHash, keyB)).toString('hex')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user