fix sonic parsing req envelopes with limit/since/until.

This commit is contained in:
fiatjaf
2025-03-14 20:08:56 -03:00
parent 4dcadd4d88
commit c64ebde59d
2 changed files with 13 additions and 0 deletions

View File

@ -106,6 +106,16 @@ func TestParseMessage(t *testing.T) {
Message: `["CLOSE","subscription123"]`,
ExpectedEnvelope: ptr(CloseEnvelope("subscription123")),
},
{
Name: "AUTH envelope from nak 23gmt bug",
Message: `["AUTH","c45b2b06ad92e28a"]`,
ExpectedEnvelope: &AuthEnvelope{Challenge: ptr("c45b2b06ad92e28a")},
},
{
Name: "REQ from jumble",
Message: `["REQ","sub:1",{"kinds":[1,6],"limit":100}]`,
ExpectedEnvelope: &ReqEnvelope{SubscriptionID: "sub:1", Filters: Filters{{Kinds: []int{1, 6}, Limit: 100}}},
},
}
t.Run("standard", func(t *testing.T) {