[][src]Trait exocore_chain::pending::PendingStore

pub trait PendingStore: Send + Sync + 'static {
    pub fn put_operation(
        &mut self,
        operation: NewOperation
    ) -> Result<bool, Error>;
pub fn update_operation_commit_status(
        &mut self,
        operation_id: OperationId,
        status: CommitStatus
    ) -> Result<(), Error>;
pub fn get_operation(
        &self,
        operation_id: OperationId
    ) -> Result<Option<StoredOperation>, Error>;
pub fn get_group_operations(
        &self,
        group_id: GroupId
    ) -> Result<Option<StoredOperationsGroup>, Error>;
pub fn operations_iter<R>(
        &self,
        range: R
    ) -> Result<TimelineIterator<'_>, Error>
    where
        R: RangeBounds<OperationId>
;
pub fn operations_count(&self) -> usize;
pub fn delete_operation(
        &mut self,
        operation_id: OperationId
    ) -> Result<(), Error>; }

Pending operations store. This store contains operations that have just been created and that aren't committed to the chain yet.

Required methods

pub fn put_operation(&mut self, operation: NewOperation) -> Result<bool, Error>[src]

Adds or replaces the given operation into the store. Returns true if the operation already exists and got overwritten.

pub fn update_operation_commit_status(
    &mut self,
    operation_id: OperationId,
    status: CommitStatus
) -> Result<(), Error>
[src]

Updates the commit status of an operation. This information is not replicated, and is populated by the CommitManager so that the PendingSynchronizer and Engine can get the chain status of an operation without hitting the chain every time. Returns Error::NotFound if operation doesn't exist.

pub fn get_operation(
    &self,
    operation_id: OperationId
) -> Result<Option<StoredOperation>, Error>
[src]

Returns the operation with given id.

pub fn get_group_operations(
    &self,
    group_id: GroupId
) -> Result<Option<StoredOperationsGroup>, Error>
[src]

Returns all operations grouped under the given group id / operation id. An example of operation group is a block with its signatures / refusals operations. Entry operations are NOT stored in the block's group since they could get added into different blocks (but only one will be committed).

pub fn operations_iter<R>(
    &self,
    range: R
) -> Result<TimelineIterator<'_>, Error> where
    R: RangeBounds<OperationId>, 
[src]

Iterates through all operations in the store within the given range. The iterator returns operations sorted by operation ids.

pub fn operations_count(&self) -> usize[src]

Returns the number of operations in the store.

pub fn delete_operation(
    &mut self,
    operation_id: OperationId
) -> Result<(), Error>
[src]

Deletes the operation with given id, or all operations grouped by this operation id if the operation was a group (ex: block with its signatures)

Loading content...

Implementors

impl PendingStore for MemoryPendingStore[src]

Loading content...