feat: support parameterized replaceable evts

This commit is contained in:
Ricardo Arturo Cabral Mejia
2022-10-30 18:16:29 -04:00
parent ee1a1c8ba9
commit 6b3c83fb92
10 changed files with 117 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ import {
isEventIdValid,
isEventMatchingFilter,
isEventSignatureValid,
isParameterizedReplaceableEvent,
isReplaceableEvent,
serializeEvent,
} from '../../../src/utils/event'
@@ -475,3 +476,15 @@ describe('NIP-09', () => {
})
})
})
describe('NIP-33', () => {
describe('isParameterizedReplaceableEvent', () => {
it('returns true if event is a parameterized replaceable event', () => {
expect(isParameterizedReplaceableEvent({ kind: 30000 } as any)).to.be.true
})
it('returns false if event is a parameterized replaceable event', () => {
expect(isParameterizedReplaceableEvent({ kind: 40000 } as any)).to.be.false
})
})
})