ChainKeyOperations

Trait ChainKeyOperations 

Source
pub trait ChainKeyOperations {
    type Error: Error + Send + Sync + 'static;
    type Mapper: KeyIdMapper<HoprSphinxSuite, HoprSphinxHeaderSpec> + Clone + Send + Sync + 'static;

    // Required methods
    fn chain_key_to_packet_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        chain: &'life1 Address,
    ) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn packet_key_to_chain_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        packet: &'life1 OffchainPublicKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Address>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn key_id_mapper_ref(&self) -> &Self::Mapper;
}
Expand description

Operations for offchain keys.

This typically translates to optimized (and cached) versions of [ChainReadChannelOperations].

Required Associated Types§

Required Methods§

Source

fn chain_key_to_packet_key<'life0, 'life1, 'async_trait>( &'life0 self, chain: &'life1 Address, ) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Translates Address into OffchainPublicKey.

Source

fn packet_key_to_chain_key<'life0, 'life1, 'async_trait>( &'life0 self, packet: &'life1 OffchainPublicKey, ) -> Pin<Box<dyn Future<Output = Result<Option<Address>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Translates OffchainPublicKey into Address.

Source

fn key_id_mapper_ref(&self) -> &Self::Mapper

Returns mapper for offchain key IDs as a reference.

Implementors§