pub struct EventProcessor {
pub db: Arc<SledEventDatabase>,
}
Fields§
§db: Arc<SledEventDatabase>
Implementations§
Source§impl EventProcessor
impl EventProcessor
pub fn new(db: Arc<SledEventDatabase>) -> Self
Sourcepub fn compute_state(
&self,
id: &IdentifierPrefix,
) -> Result<Option<IdentifierState>, Error>
pub fn compute_state( &self, id: &IdentifierPrefix, ) -> Result<Option<IdentifierState>, Error>
Compute State for Prefix
Returns the current State associated with the given Prefix
Sourcepub fn compute_state_at_sn(
&self,
id: &IdentifierPrefix,
sn: u64,
) -> Result<Option<IdentifierState>, Error>
pub fn compute_state_at_sn( &self, id: &IdentifierPrefix, sn: u64, ) -> Result<Option<IdentifierState>, Error>
Compute State for Prefix and sn
Returns the State associated with the given Prefix after applying event of given sn.
Sourcepub fn get_last_establishment_event_seal(
&self,
id: &IdentifierPrefix,
) -> Result<Option<EventSeal>, Error>
pub fn get_last_establishment_event_seal( &self, id: &IdentifierPrefix, ) -> Result<Option<EventSeal>, Error>
Get last establishment event seal for Prefix
Returns the EventSeal of last establishment event from KEL of given Prefix.
Sourcepub fn get_kerl(&self, id: &IdentifierPrefix) -> Result<Option<Vec<u8>>, Error>
pub fn get_kerl(&self, id: &IdentifierPrefix) -> Result<Option<Vec<u8>>, Error>
Get KERL for Prefix
Returns the current validated KEL for a given Prefix
pub fn has_receipt( &self, id: &IdentifierPrefix, sn: u64, validator_pref: &IdentifierPrefix, ) -> Result<bool, Error>
Sourcepub fn process(&self, data: Message) -> Result<Option<IdentifierState>, Error>
pub fn process(&self, data: Message) -> Result<Option<IdentifierState>, Error>
Process
Process a deserialized KERI message
pub fn process_actual_event( &self, id: &IdentifierPrefix, event: impl EventSemantics, ) -> Result<Option<IdentifierState>, Error>
Sourcepub fn process_event(
&self,
signed_event: &SignedEventMessage,
) -> Result<Option<IdentifierState>, Error>
pub fn process_event( &self, signed_event: &SignedEventMessage, ) -> Result<Option<IdentifierState>, Error>
Process Event
Validates a Key Event against the latest state of the Identifier and applies it to update the state returns the updated state TODO improve checking and handling of errors!
Sourcepub fn process_validator_receipt(
&self,
vrc: SignedTransferableReceipt,
) -> Result<Option<IdentifierState>, Error>
pub fn process_validator_receipt( &self, vrc: SignedTransferableReceipt, ) -> Result<Option<IdentifierState>, Error>
Process Validator Receipt
Checks the receipt against the receipted event and the state of the validator, returns the state of the identifier being receipted TODO improve checking and handling of errors!
Sourcepub fn process_witness_receipt(
&self,
rct: SignedNontransferableReceipt,
) -> Result<Option<IdentifierState>, Error>
pub fn process_witness_receipt( &self, rct: SignedNontransferableReceipt, ) -> Result<Option<IdentifierState>, Error>
Process Witness Receipt
Checks the receipt against the receipted event returns the state of the Identifier being receipted, which may have been updated by un-escrowing events TODO improve checking and handling of errors!