Skip to main content

append_event

Function append_event 

Source
pub fn append_event(
    event: AuditEvent,
    prev_event_hash: Option<String>,
) -> Result<AuditEvent, ChainError>
Expand description

Compute and assign this_event_hash for an event, given the previous chain tip.

Returns the event with this_event_hash and prev_event_hash set.

§Errors

Returns ChainError::Serde if the event cannot be serialized for hashing.