referrerpolicy=no-referrer-when-downgrade
polkadot_statement_table::generic

Trait Context

Source
pub trait Context {
    type AuthorityId: Debug + Hash + Eq + Clone;
    type Digest: Debug + Hash + Eq + Clone;
    type GroupId: Debug + Hash + Ord + Eq + Clone;
    type Signature: Debug + Eq + Clone;
    type Candidate: Debug + Ord + Eq + Clone;

    // Required methods
    fn candidate_digest(candidate: &Self::Candidate) -> Self::Digest;
    fn is_member_of(
        &self,
        authority: &Self::AuthorityId,
        group: &Self::GroupId,
    ) -> bool;
    fn get_group_size(&self, group: &Self::GroupId) -> Option<usize>;
}
Expand description

Context for the statement table.

Required Associated Types§

Source

type AuthorityId: Debug + Hash + Eq + Clone

An authority ID

Source

type Digest: Debug + Hash + Eq + Clone

The digest (hash or other unique attribute) of a candidate.

Source

type GroupId: Debug + Hash + Ord + Eq + Clone

The group ID type

Source

type Signature: Debug + Eq + Clone

A signature type.

Source

type Candidate: Debug + Ord + Eq + Clone

Candidate type. In practice this will be a candidate receipt.

Required Methods§

Source

fn candidate_digest(candidate: &Self::Candidate) -> Self::Digest

get the digest of a candidate.

Source

fn is_member_of( &self, authority: &Self::AuthorityId, group: &Self::GroupId, ) -> bool

Whether a authority is a member of a group. Members are meant to submit candidates and vote on validity.

Source

fn get_group_size(&self, group: &Self::GroupId) -> Option<usize>

Get a validator group size.

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§