diff --git a/src/delegation.rs b/src/delegation.rs index fe2f805..e682b40 100644 --- a/src/delegation.rs +++ b/src/delegation.rs @@ -80,7 +80,7 @@ impl FromStr for Operator { #[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct ConditionQuery { - pub(crate) conditions: Vec, + pub conditions: Vec, } impl ConditionQuery { @@ -137,9 +137,9 @@ pub fn validate_delegation( /// An example complex condition would be: kind=1,2,3&created_at<1665265999 #[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct Condition { - pub(crate) field: Field, - pub(crate) operator: Operator, - pub(crate) values: Vec, + pub field: Field, + pub operator: Operator, + pub values: Vec, } impl Condition { diff --git a/src/event.rs b/src/event.rs index 84229bd..f443ef0 100644 --- a/src/event.rs +++ b/src/event.rs @@ -37,19 +37,19 @@ impl EventCmd { #[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct Event { pub id: String, - pub(crate) pubkey: String, + pub pubkey: String, #[serde(skip)] - pub(crate) delegated_by: Option, - pub(crate) created_at: u64, - pub(crate) kind: u64, + pub delegated_by: Option, + pub created_at: u64, + pub kind: u64, #[serde(deserialize_with = "tag_from_string")] // NOTE: array-of-arrays may need to be more general than a string container - pub(crate) tags: Vec>, - pub(crate) content: String, - pub(crate) sig: String, + pub tags: Vec>, + pub content: String, + pub sig: String, // Optimization for tag search, built on demand. #[serde(skip)] - pub(crate) tagidx: Option>>, + pub tagidx: Option>>, } /// Simple tag type for array of array of strings. @@ -242,7 +242,7 @@ impl Event { } /// Check if this event has a valid signature. - fn validate(&self) -> Result<()> { + pub fn validate(&self) -> Result<()> { // TODO: return a Result with a reason for invalid events // validation is performed by: // * parsing JSON string into event fields