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 candidate_group(candidate: &Self::Candidate) -> Self::GroupId;
    fn is_member_of(
        &self,
        authority: &Self::AuthorityId,
        group: &Self::GroupId
    ) -> bool;
    fn requisite_votes(&self, group: &Self::GroupId) -> 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 candidate_group(candidate: &Self::Candidate) -> Self::GroupId

get the group 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 requisite_votes(&self, group: &Self::GroupId) -> usize

requisite number of votes for validity from a group.

Implementors§