Add fixed-size type support for IdPkTs and EventRef

- Update nostr dependency to v1.0.11 with new types package
- Add IDFixed(), PubFixed(), IDHex(), PubHex() methods to IdPkTs
- Add EventRef type: 80-byte stack-allocated event reference
- Add ToEventRef()/ToIdPkTs() conversion methods
- Update tests to use IDHex() instead of hex.Enc(r.Id)

EventRef provides:
- Copy-on-assignment semantics (arrays vs slices)
- Zero heap allocations for event reference passing
- Type-safe fixed-size fields (EventID, Pubkey)

Files modified:
- go.mod, go.sum: Update nostr to v1.0.11
- pkg/interfaces/store/store_interface.go: Add methods and EventRef type
- pkg/interfaces/store/store_interface_test.go: New test file
- pkg/database/binary_tag_filter_test.go: Use IDHex()
- pkg/neo4j/fetch-event_test.go: Use IDHex(), PubHex()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-23 14:47:50 +01:00
parent 0addc61549
commit 06063750e7
6 changed files with 366 additions and 33 deletions

View File

@@ -120,7 +120,7 @@ func TestBinaryTagFilterRegression(t *testing.T) {
// Verify we got the correct event
found := false
for _, r := range results {
if hex.Enc(r.Id) == testEventIdHex {
if r.IDHex() == testEventIdHex {
found = true
break
}
@@ -156,7 +156,7 @@ func TestBinaryTagFilterRegression(t *testing.T) {
// Verify we got the correct event
found := false
for _, r := range results {
if hex.Enc(r.Id) == testEventIdHex {
if r.IDHex() == testEventIdHex {
found = true
break
}
@@ -192,7 +192,7 @@ func TestBinaryTagFilterRegression(t *testing.T) {
// Verify we got the correct event
found := false
for _, r := range results {
if hex.Enc(r.Id) == testEventIdHex {
if r.IDHex() == testEventIdHex {
found = true
break
}
@@ -229,7 +229,7 @@ func TestBinaryTagFilterRegression(t *testing.T) {
// Verify we got the correct event
found := false
for _, r := range results {
if hex.Enc(r.Id) == testEventIdHex {
if r.IDHex() == testEventIdHex {
found = true
break
}