nostr-protocol / nips

Nostr Implementation Possibilities
2.41k stars 586 forks source link

NIP-01: clarify single filter match #1357

Closed patrickReiis closed 3 months ago

patrickReiis commented 4 months ago

I didn't understand it first time when I read the current explanation, I think with this merge request it'll be easier for people with no nostr experience to understand it first time.

patrickReiis commented 4 months ago

What do you think? @staab

alexgleason commented 4 months ago

The original text is concise. An example helps, but I'm not sure it belongs there.

Maybe it would make more sense to put a bulleted list of some examples at the end of the section, similar to the relay "OK" message examples.

Semisol commented 4 months ago

Maybe it's time we do test cases for NIPs?

alexgleason commented 4 months ago

I was thinking the same @Semisol

patrickReiis commented 4 months ago

How would tests look like? Using this merge request as an example.

bezysoftware commented 4 months ago

I would loooove to see gherkin tests for NIPs (either along each NIP or maybe in a separate repo?) This is a sample test from nostream:

Feature: NIP-01
  Scenario: Alice gets an event by ID
    Given someone called Alice
    And someone called Bob
    When Bob sends a text_note event with content "why is nobody talking about this?"
    And Alice subscribes to last event from Bob
    Then Alice receives a text_note event from Bob with content "why is nobody talking about this?"

I'm sure this could be adapted to cover the filter matching

bezysoftware commented 3 months ago

I wrote a few NIP-01 gherkin tests for my Netstr project, check them out: https://github.com/bezysoftware/netstr/blob/main/test/Netstr.Tests/NIPs/01.feature