Trait HoprDbCorruptedChannelOperations

Source
pub trait HoprDbCorruptedChannelOperations {
    // Required methods
    fn get_corrupted_channel_by_id<'a, 'life0, 'async_trait>(
        &'a self,
        tx: OptTx<'a>,
        id: &'life0 Hash,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CorruptedChannelEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
    fn get_all_corrupted_channels<'a, 'async_trait>(
        &'a self,
        tx: OptTx<'a>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CorruptedChannelEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn upsert_corrupted_channel<'a, 'async_trait>(
        &'a self,
        tx: OptTx<'a>,
        channel_id: ChannelId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
}
Expand description

Defines DB API for accessing information about HOPR payment channels.

Required Methods§

Source

fn get_corrupted_channel_by_id<'a, 'life0, 'async_trait>( &'a self, tx: OptTx<'a>, id: &'life0 Hash, ) -> Pin<Box<dyn Future<Output = Result<Option<CorruptedChannelEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Retrieves corrupted channel by its channel ID hash.

See [generate_channel_id] on how to generate a channel ID hash from source and destination Addresses.

Source

fn get_all_corrupted_channels<'a, 'async_trait>( &'a self, tx: OptTx<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<CorruptedChannelEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Retrieves all corrupted channels information from the DB.

Source

fn upsert_corrupted_channel<'a, 'async_trait>( &'a self, tx: OptTx<'a>, channel_id: ChannelId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Inserts the given ChannelID as a corrupted channel entry.

Implementors§