21 Commits

Author SHA1 Message Date
fiatjaf
4dcadd4d88 update go version so we can use the new benchmarking helper. 2025-03-13 18:57:30 -03:00
fiatjaf
91efcb3825 remove support for extra fields in events -- was deprecated. 2024-12-28 14:19:28 -03:00
fiatjaf
72d9aac9b1 replace all ocurrences of encoding/json with json-iterator so we get rid of HTML escaping and hopefully get faster too. 2024-12-03 00:49:27 -03:00
fiatjaf
1d06176c7e kind checking moved to top-level functions on kinds.go 2024-11-03 15:34:49 -03:00
fiatjaf
14fa7a0358 deprecate storing extra fields in events. 2024-10-16 09:37:41 -03:00
fiatjaf
b870a78622 a test for c07528eb 2024-09-20 14:05:45 -03:00
fiatjaf
b5f8d48f79 event.CheckID()
absurd performance increase benefit over a naïve id comparison!

goos: linux
goarch: amd64
pkg: github.com/nbd-wtf/go-nostr
cpu: AMD Ryzen 3 3200G with Radeon Vega Graphics
BenchmarkIDCheck/naïve-4          	 1478547	       802.9 ns/op	     488 B/op	      15 allocs/op
BenchmarkIDCheck/big_brain-4      	 1673341	       715.3 ns/op	     358 B/op	      12 allocs/op
2024-09-14 10:55:54 -03:00
K
c91e7b9765
using testify instead of testing.T methods. (#143) 2024-09-09 07:20:56 -03:00
fiatjaf
b43d0e374a reorder json serialization to write "kind" first and adjust tests. 2024-04-25 18:30:38 -03:00
Isaque Veras
0f66883dc7 feat(kind): using constants 2023-09-07 07:05:01 -03:00
Isaque Veras
58d56abe05 fix: removing redundancy 2023-06-12 08:18:29 -03:00
shota3506
96f3d4c9a0 fix event comparison in EventSerialization test 2023-05-07 06:21:12 -03:00
fiatjaf
c42059f4b4
tests run (but not pass) and fine-tuning (specially tag filters) on filter_easyjson.go 2023-04-16 16:16:16 -03:00
fiatjaf
3349b2a52b
fix encoding and decoding of event "extra" fields.
fixes https://github.com/nbd-wtf/go-nostr/issues/31
2023-01-03 14:46:50 -03:00
alex
28663f21f0 relaypool: add a unique events subscription smoke test
was trying to reproduce the issue described in
https://github.com/nbd-wtf/go-nostr/issues/23

no success in reproducing that specific problem, but i believe the test
can still be useful to help in avoiding regression bugs in the future.
2022-12-26 16:03:00 -03:00
fiatjaf
ac25c2071e
another event serialization test, now reversed. 2022-12-14 13:35:13 -03:00
fiatjaf
fe01c9474b
fix string formatting on test errors. 2022-11-08 08:44:22 -03:00
fiatjaf
329b8d44d2
move stuff back from nostr package to top level.
because otherwise the path must be specified as github.com/fiatjaf/go-nostr/nostr, which is annoying.
2022-11-04 08:22:13 -03:00
BitcoinCoderBob
9549c3624a
nostr package, readme updates accordingly, matching example program (#14) 2022-10-12 17:24:30 -03:00
fiatjaf
dd43f4c495 add another event to serialization and verification test. 2022-02-14 10:18:50 -03:00
fiatjaf
41955a0601 serialization tests for events and filters. 2022-02-09 13:40:26 -03:00