mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-10 00:58:51 +00:00
Rename signEvent to getSignature
This commit is contained in:
@@ -5,7 +5,7 @@ const {
|
||||
getEventHash,
|
||||
validateEvent,
|
||||
verifySignature,
|
||||
signEvent,
|
||||
getSignature,
|
||||
getPublicKey,
|
||||
Kind
|
||||
} = require('./lib/nostr.cjs')
|
||||
@@ -281,8 +281,8 @@ describe('Event', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('signEvent', () => {
|
||||
it('should sign an event object', () => {
|
||||
describe('getSignature', () => {
|
||||
it('should produce the correct signature for an event object', () => {
|
||||
const privateKey =
|
||||
'd217c1ff2f8a65c3e3a1740db3b9f58b8c848bb45e26d00ed4714e4a0f4ceecf'
|
||||
const publicKey = getPublicKey(privateKey)
|
||||
@@ -295,7 +295,7 @@ describe('Event', () => {
|
||||
pubkey: publicKey
|
||||
}
|
||||
|
||||
const sig = signEvent(unsignedEvent, privateKey)
|
||||
const sig = getSignature(unsignedEvent, privateKey)
|
||||
|
||||
// verify the signature
|
||||
const isValid = verifySignature({
|
||||
@@ -324,7 +324,7 @@ describe('Event', () => {
|
||||
pubkey: publicKey
|
||||
}
|
||||
|
||||
const sig = signEvent(unsignedEvent, wrongPrivateKey)
|
||||
const sig = getSignature(unsignedEvent, wrongPrivateKey)
|
||||
|
||||
// verify the signature
|
||||
const isValid = verifySignature({
|
||||
|
||||
Reference in New Issue
Block a user