ndb: make NostrEvents immutable
Since we can't mutate NdbNotes, let's update the existing codebase to generate and sign ids on NostrEvent constructions. This will allow us to match NdbNote's constructor
This commit is contained in:
@@ -821,10 +821,8 @@ func process_metadata_profile(our_pubkey: String, profiles: Profiles, profile: P
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove this, let nostrdb handle all validation
|
||||
func guard_valid_event(events: EventCache, ev: NostrEvent, callback: @escaping () -> Void) {
|
||||
guard ev.id == hex_encode(calculate_event_id(ev: ev)) else {
|
||||
return
|
||||
}
|
||||
let validated = events.is_event_valid(ev.id)
|
||||
|
||||
switch validated {
|
||||
|
||||
Reference in New Issue
Block a user