pub trait RelayerDb: Send + Sync {
    // Required methods
    fn insert_messages(
        &mut self,
        da_height: &DaBlockHeight,
        messages: &[CheckedMessage]
    ) -> StorageResult<()>;
    fn set_finalized_da_height_to_at_least(
        &mut self,
        block: &DaBlockHeight
    ) -> StorageResult<()>;
    fn get_finalized_da_height(&self) -> StorageResult<DaBlockHeight>;
}
Expand description

Manages state related to supported external chains.

Required Methods§

source

fn insert_messages( &mut self, da_height: &DaBlockHeight, messages: &[CheckedMessage] ) -> StorageResult<()>

Add bridge messages to database. Messages are not revertible. Must only set a new da height if it is greater than the current.

source

fn set_finalized_da_height_to_at_least( &mut self, block: &DaBlockHeight ) -> StorageResult<()>

Set finalized da height that represent last block from da layer that got finalized. This will only set the value if it is greater than the current.

source

fn get_finalized_da_height(&self) -> StorageResult<DaBlockHeight>

Get finalized da height that represent last block from da layer that got finalized. Panics if height is not set as of initialization of database.

Implementors§

source§

impl<T, Storage> RelayerDb for Twhere T: Send + Sync + Transactional<Storage = Storage> + StorageMutate<RelayerMetadata, Error = StorageError>, Storage: StorageMutate<Messages, Error = StorageError> + StorageMutate<RelayerMetadata, Error = StorageError>,