enostr: rename Event to Note

we will likely replace Note with nostrdb::Note in the future,
this just helps with that transition

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-07-01 06:38:08 -07:00
parent a16d5b3a05
commit 307b8af8f1
7 changed files with 130 additions and 136 deletions

View File

@@ -1,17 +1,17 @@
use crate::{EventId, Pubkey};
use crate::{NoteId, Pubkey};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
pub struct Filter {
#[serde(skip_serializing_if = "Option::is_none")]
pub ids: Option<Vec<EventId>>,
pub ids: Option<Vec<NoteId>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub authors: Option<Vec<Pubkey>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub kinds: Option<Vec<u64>>,
#[serde(rename = "#e")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<EventId>>,
pub events: Option<Vec<NoteId>>,
#[serde(rename = "#p")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pubkeys: Option<Vec<Pubkey>>,
@@ -49,7 +49,7 @@ impl Filter {
150
}
pub fn ids(mut self, ids: Vec<EventId>) -> Self {
pub fn ids(mut self, ids: Vec<NoteId>) -> Self {
self.ids = Some(ids);
self
}
@@ -64,7 +64,7 @@ impl Filter {
self
}
pub fn events(mut self, events: Vec<EventId>) -> Self {
pub fn events(mut self, events: Vec<NoteId>) -> Self {
self.events = Some(events);
self
}