mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
event.test: tamper with things in a more evil way
This commit is contained in:
@@ -248,7 +248,7 @@ describe('Event', () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// tamper with the signature
|
// tamper with the signature
|
||||||
event.sig = event.sig.replace(/0/g, '1')
|
event.sig = event.sig.replace(/^.{3}/g, '666')
|
||||||
|
|
||||||
const isValid = verifySignature(event)
|
const isValid = verifySignature(event)
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ describe('Event', () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// tamper with the id
|
// tamper with the id
|
||||||
event.id = event.id.replace(/0/g, '1')
|
event.id = event.id.replace(/^.{3}/g, '666')
|
||||||
|
|
||||||
const isValid = verifySignature(event)
|
const isValid = verifySignature(event)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user