Trait tendermint_machine::ext::Signer

source ·
pub trait Signer: Send + Sync {
    type ValidatorId: ValidatorId;
    type Signature: Signature;

    // Required methods
    fn validator_id<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<Self::ValidatorId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sign<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Self::Signature> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A signer for a validator.

Required Associated Types§

Required Methods§

source

fn validator_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Self::ValidatorId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the validator’s current ID. Returns None if they aren’t a current validator.

source

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Self::Signature> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sign a signature with the current validator’s private key.

Implementations on Foreign Types§

source§

impl<S: Signer> Signer for Arc<S>

§

type ValidatorId = <S as Signer>::ValidatorId

§

type Signature = <S as Signer>::Signature

source§

fn validator_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Self::ValidatorId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Self::Signature> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§