Skip to main content

BlockSigner

Trait BlockSigner 

Source
pub trait BlockSigner {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn sign(
        &self,
        header: &BlockHeader,
    ) -> impl Future<Output = Result<Signature, Self::Error>> + Send;
    fn public_key(&self) -> PublicKey;
}
Expand description

Trait which abstracts the signing of block headers with ECDSA signatures.

Production-level implementations will involve some sort of secure remote backend. The trait also allows for testing with local and ephemeral signers.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn sign( &self, header: &BlockHeader, ) -> impl Future<Output = Result<Signature, Self::Error>> + Send

Source

fn public_key(&self) -> PublicKey

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BlockSigner for SecretKey

Source§

type Error = Infallible

Source§

async fn sign(&self, header: &BlockHeader) -> Result<Signature, Self::Error>

Source§

fn public_key(&self) -> PublicKey

Implementors§