Add countenvelope encoder with marshal/unmarshal support, buffer pool integration, and tests; improve error messages for subscription validation

This commit is contained in:
2025-08-30 16:26:55 +01:00
parent 6c39ea4332
commit 576475e3dc
8 changed files with 353 additions and 13 deletions

View File

@@ -34,13 +34,13 @@ func (ev *E) Verify() (valid bool, err error) {
// check that this isn't because of a bogus ID
id := ev.GetIDBytes()
if !utils.FastEqual(id, ev.ID) {
log.E.Ln("event ID incorrect")
log.E.Ln("event Subscription incorrect")
ev.ID = id
err = nil
if valid, err = keys.Verify(ev.ID, ev.Sig); chk.E(err) {
return
}
err = errorf.W("event ID incorrect but signature is valid on correct ID")
err = errorf.W("event Subscription incorrect but signature is valid on correct Subscription")
}
return
}