referrerpolicy=no-referrer-when-downgrade

BeefyAuthorityId

Trait BeefyAuthorityId 

Source
pub trait BeefyAuthorityId: RuntimeAppPublic {
    // Required methods
    fn get_all_public_keys_from_store(
        store: KeystorePtr,
    ) -> Vec<impl AsRef<[u8]>>;
    fn try_sign_with_store(
        &self,
        store: KeystorePtr,
        msg: &[u8],
    ) -> Result<Option<impl AsRef<[u8]> + Debug>, Error>;
    fn verify(
        &self,
        signature: &<Self as RuntimeAppPublic>::Signature,
        msg: &[u8],
    ) -> bool;
}
Expand description

Trait representing BEEFY authority id, including custom signature verification.

Required Methods§

Source

fn get_all_public_keys_from_store(store: KeystorePtr) -> Vec<impl AsRef<[u8]>>

Get all the public keys of the current type from a provided Keystore.

Source

fn try_sign_with_store( &self, store: KeystorePtr, msg: &[u8], ) -> Result<Option<impl AsRef<[u8]> + Debug>, Error>

Sign a message using the private key associated to the current public key.

We can’t access the private key directly, so we need to receive the store that contains it.

Source

fn verify( &self, signature: &<Self as RuntimeAppPublic>::Signature, msg: &[u8], ) -> bool

Verify a signature.

Return true if signature over msg is valid for this id.

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.

Implementors§

Source§

impl BeefyAuthorityId for sp_consensus_beefy::bls_crypto::AuthorityId

Source§

impl BeefyAuthorityId for sp_consensus_beefy::ecdsa_bls_crypto::AuthorityId

Source§

impl BeefyAuthorityId for sp_consensus_beefy::ecdsa_crypto::AuthorityId