implement filter codec

This commit is contained in:
2025-08-26 18:26:34 +01:00
parent c958a7d9ed
commit 1ba2bb0a9b
47 changed files with 687 additions and 19133 deletions

View File

@@ -32,7 +32,8 @@ import (
// same as go 1.25 json v1 except with this one stupidity removed.
type E struct {
// ID is the SHA256 hash of the canonical encoding of the event in binary format
// ID is the SHA256 hash of the canonical encoding of the event in binary
// format
ID []byte
// Pubkey is the public key of the event creator in binary format
@@ -57,8 +58,8 @@ type E struct {
// Pubkey in binary format.
Sig []byte
// b is the decode buffer for the event.E. this is where the UnmarshalJSON will
// source the memory to store all of the fields except for the tags.
// b is the decode buffer for the event.E. this is where the UnmarshalJSON
// will source the memory to store all of the fields except for the tags.
b bufpool.B
}

View File

@@ -89,7 +89,7 @@ func TestExamplesCache(t *testing.T) {
t.Fatalf("failed to re-marshal back original")
}
ev.Free()
// Don't return scanner.Bytes() to the pool as it's not a buffer we own
// Don't return scanner.Bytes() to the pool as it's a buffer from embed.
// bufpool.PutBytes(b)
bufpool.PutBytes(b2)
bufpool.PutBytes(c)