Simplify Pdu Hashes struct.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-08 11:55:52 +00:00
parent 3ea8c82ef0
commit 190269f616
6 changed files with 19 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
mod builder;
mod count;
mod hashes;
mod id;
mod raw_id;
mod redact;
@@ -20,6 +21,7 @@ pub use self::{
Count as PduCount, Id as PduId, Pdu as PduEvent, RawId as RawPduId,
builder::{Builder, Builder as PduBuilder},
count::Count,
hashes::EventHashes as EventHash,
id::{ShortId, *},
raw_id::*,
};
@@ -67,13 +69,6 @@ pub struct Pdu {
pub signatures: Option<Box<RawJsonValue>>,
}
/// Content hashes of a PDU.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct EventHash {
/// The SHA-256 hash.
pub sha256: String,
}
impl Pdu {
pub fn from_id_val(event_id: &EventId, mut json: CanonicalJsonObject) -> Result<Self> {
let event_id = CanonicalJsonValue::String(event_id.into());