Trait linera_client::chain_listener::ClientContext

source ·
pub trait ClientContext: 'static + Send {
    type ValidatorNodeProvider: ValidatorNodeProvider + Sync;
    type Storage: Storage + Clone + Send + Sync + 'static;

    // Required methods
    fn wallet(&self) -> &Wallet;
    fn make_chain_client(
        &self,
        chain_id: ChainId,
    ) -> Result<ChainClient<<Self as ClientContext>::ValidatorNodeProvider, <Self as ClientContext>::Storage>, Error>;
    fn update_wallet_for_new_chain<'life0, 'async_trait>(
        &'life0 mut self,
        chain_id: ChainId,
        key_pair: Option<AccountSecretKey>,
        timestamp: Timestamp,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_wallet<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        client: &'life1 ChainClient<<Self as ClientContext>::ValidatorNodeProvider, <Self as ClientContext>::Storage>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn clients(
        &self,
    ) -> Result<Vec<ChainClient<<Self as ClientContext>::ValidatorNodeProvider, <Self as ClientContext>::Storage>>, Error> { ... }
}

Required Associated Types§

Required Methods§

source

fn wallet(&self) -> &Wallet

source

fn make_chain_client( &self, chain_id: ChainId, ) -> Result<ChainClient<<Self as ClientContext>::ValidatorNodeProvider, <Self as ClientContext>::Storage>, Error>

source

fn update_wallet_for_new_chain<'life0, 'async_trait>( &'life0 mut self, chain_id: ChainId, key_pair: Option<AccountSecretKey>, timestamp: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn update_wallet<'life0, 'life1, 'async_trait>( &'life0 mut self, client: &'life1 ChainClient<<Self as ClientContext>::ValidatorNodeProvider, <Self as ClientContext>::Storage>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Implementors§

source§

impl<S, W> ClientContext for ClientContext<S, W>
where S: Storage + Clone + Send + Sync + 'static, W: Persist<Target = Wallet> + 'static,