Simplify Pdu Hashes struct.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user