Skip to main content

ChainKeyOperations

Trait ChainKeyOperations 

pub trait ChainKeyOperations {
    type Error: Error + Send + Sync + 'static;
    type Mapper: KeyIdMapping<KeyIdent, OffchainPublicKey> + Clone + Send + Sync + 'static;

    // Required methods
    fn chain_key_to_packet_key(
        &self,
        chain: &Address,
    ) -> Result<Option<OffchainPublicKey>, Self::Error>;
    fn packet_key_to_chain_key(
        &self,
        packet: &OffchainPublicKey,
    ) -> Result<Option<Address>, Self::Error>;
    fn key_id_mapper_ref(&self) -> &Self::Mapper;
}
Expand description

Operations for offchain keys.

Provides translation between on-chain Address values and offchain OffchainPublicKey values.

Required Associated Types§

Required Methods§

fn chain_key_to_packet_key( &self, chain: &Address, ) -> Result<Option<OffchainPublicKey>, Self::Error>

Translates Address into OffchainPublicKey.

fn packet_key_to_chain_key( &self, packet: &OffchainPublicKey, ) -> Result<Option<Address>, Self::Error>

Translates OffchainPublicKey into Address.

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

Returns a reference to KeyIdMapping for offchain key IDs.

Implementations on Foreign Types§

§

impl<'a, T> ChainKeyOperations for &'a T
where T: 'a + ChainKeyOperations + ?Sized,

§

impl<T> ChainKeyOperations for Box<T>

§

impl<T> ChainKeyOperations for Arc<T>

Implementors§