tests run (but not pass) and fine-tuning (specially tag filters) on filter_easyjson.go

This commit is contained in:
fiatjaf
2023-04-16 16:12:42 -03:00
parent 0a3e898c2f
commit c42059f4b4
12 changed files with 116 additions and 129 deletions

View File

@@ -135,10 +135,10 @@ jump1:
}
jump2:
if d.since != nil && ev.CreatedAt.Before(*d.since) {
if d.since != nil && ev.CreatedAt.Time().Before(*d.since) {
return false, fmt.Errorf("Event is created before delegation conditions allow.")
}
if d.until != nil && ev.CreatedAt.After(*d.until) {
if d.until != nil && ev.CreatedAt.Time().After(*d.until) {
return false, fmt.Errorf("Event is created after delegation conditions allow.")
}
@@ -166,7 +166,7 @@ func DelegatedSign(ev *nostr.Event, d *DelegationToken, delegatee_sk string) err
return fmt.Errorf("event already has delegation token")
}
}
if d.since != nil && ev.CreatedAt.Before(*d.since) || d.until != nil && ev.CreatedAt.After(*d.until) {
if d.since != nil && ev.CreatedAt.Time().Before(*d.since) || d.until != nil && ev.CreatedAt.Time().After(*d.until) {
return fmt.Errorf("event created_at field is not compatible with delegation token time conditions.")
}
if len(d.kinds) > 0 {