Trait fuel_core_relayer::ports::RelayerDb

source ·
pub trait RelayerDb: Send + Sync {
    // Required methods
    fn insert_events(
        &mut self,
        da_height: &DaBlockHeight,
        events: &[Event],
    ) -> StorageResult<()>;
    fn get_finalized_da_height(&self) -> Option<DaBlockHeight>;
}
Expand description

Manages state related to supported external chains.

Required Methods§

source

fn insert_events( &mut self, da_height: &DaBlockHeight, events: &[Event], ) -> StorageResult<()>

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

source

fn get_finalized_da_height(&self) -> Option<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> RelayerDb for T
where T: Send + Sync + Transactional, for<'a> T::Transaction<'a>: StorageMutate<EventsHistory, Error = Error>,