Have an early rust NIP-19 TLV decoder written for rust. Needs more test cases and likely to simplify areas. Better TLV flexibility for ordering likely needed.

https://gist.github.com/blakejakopovic/f084749a912b9fcab60128ef9c6c98c

#[0]​ do we have more test cases somewhere I can use? How flexible should TLV order be?

https://github.com/nbd-wtf/nostr-tools/blob/24f5068fdbc2d3fce2f00af00ce2d01ea83fe40b/nip26.test.js

Reply to this note

Please Login to reply.

Discussion

Should be in any order I think. There are some hardcoded test cases on nostr-tools and go-nostr repositories.

If you want to help start compiling a bunch of test cases in a JSON file we could have these on the NIPs repo. I'm planning on doing that for most NIPs.

Ok cool. I’ll gather some test cases so we can start sharing them.

Sometimes the NIPs can benefit from concrete “this should work” or “this should become that” examples.

I noticed the nostr-tools repo didn’t allow for an optional author/pubkey for nevent as an example.

There is a 5 missing at the end of the gist URL. Correct URL is: https://gist.github.com/blakejakopovic/f084749a912b9fcab60128ef9c6c98c5

Thanks. In Damus I still have a jumping around cursor issue when using autocomplete, adding links or splitting paragraphs.. so I delete accidentally 😄