pub struct Envelope {
pub agora_governance_log: u32,
pub id: GovernanceLogId,
pub entry_type: GovernanceLogEntryType,
pub created_at: i64,
pub prev_hash: Option<Sha256Hex>,
pub data_hash: Sha256Hex,
}Expand description
The fields an entry’s hash commits to
A struct rather than a serde_json::Value so the preimage serializes
in declaration order whatever preserve_order says.
Fields§
§agora_governance_log: u32Always ENVELOPE_VERSION
id: GovernanceLogId§entry_type: GovernanceLogEntryType§created_at: i64Unix microseconds — the precision Postgres stores
prev_hash: Option<Sha256Hex>§data_hash: Sha256HexImplementations§
Source§impl Envelope
impl Envelope
Sourcepub fn new(
id: GovernanceLogId,
entry_type: GovernanceLogEntryType,
created_at: DateTime<Utc>,
prev_hash: Option<Sha256Hex>,
data_hash: Sha256Hex,
) -> Self
pub fn new( id: GovernanceLogId, entry_type: GovernanceLogEntryType, created_at: DateTime<Utc>, prev_hash: Option<Sha256Hex>, data_hash: Sha256Hex, ) -> Self
The version-1 envelope for these fields
Sourcepub fn created_at(&self) -> DateTime<Utc>
pub fn created_at(&self) -> DateTime<Utc>
created_at as a timestamp again
Sourcepub fn entry_hash(&self) -> Sha256Hex
pub fn entry_hash(&self) -> Sha256Hex
SHA-256 over preimage
Trait Implementations§
impl Eq for Envelope
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more