Replying to Avatar fiatjaf

We need a bunch of JSON files with test vectors inside.

For starters, would be nice to have just a bunch of kind:1 events to see if they are valid and have a valid signature. We need vectors for events that should fail (for example, if they have an invalid signature or if they are missing some property or have something that isn't a string inside a tag array, stuff like that).

And also tests for parsing event filters and if a given filter matches a given event.

I don't know what is the best format for the JSON, but it should be something that library implementors can easily load -- for example, directly from GitHub -- and plug into their test file to test everything in a single loop.

Avatar
Leo Wandersleb 2y ago

Is

https://github.com/Giszmo/NostrPostr/tree/master/nostrpostrlib/src/test/resources

helpful?

Reply to this note

Please Login to reply.

Discussion

Avatar
Leo Wandersleb 2y ago

These are just events recorded back in the time when I was working on that library, dumped into files. It's not a canonical set of test vectors but it helped me find many issues with my lib.

Thread collapsed