referrerpolicy=no-referrer-when-downgrade
pub trait AssignmentCriteria {
    // Required methods
    fn compute_assignments(
        &self,
        keystore: &LocalKeystore,
        relay_vrf_story: RelayVRFStory,
        config: &Config,
        leaving_cores: Vec<(CandidateHash, CoreIndex, GroupIndex)>,
        enable_v2_assignments: bool,
    ) -> HashMap<CoreIndex, OurAssignment>;
    fn check_assignment_cert(
        &self,
        claimed_core_bitfield: CoreBitfield,
        validator_index: ValidatorIndex,
        config: &Config,
        relay_vrf_story: RelayVRFStory,
        assignment: &AssignmentCertV2,
        backing_groups: Vec<GroupIndex>,
    ) -> Result<DelayTranche, InvalidAssignment>;
}
Expand description

A trait for producing and checking assignments.

Approval voting subsystem implements a a real implemention for it and tests use a mock implementation.

Required Methods§

source

fn compute_assignments( &self, keystore: &LocalKeystore, relay_vrf_story: RelayVRFStory, config: &Config, leaving_cores: Vec<(CandidateHash, CoreIndex, GroupIndex)>, enable_v2_assignments: bool, ) -> HashMap<CoreIndex, OurAssignment>

Compute the assignments for the given relay VRF story.

source

fn check_assignment_cert( &self, claimed_core_bitfield: CoreBitfield, validator_index: ValidatorIndex, config: &Config, relay_vrf_story: RelayVRFStory, assignment: &AssignmentCertV2, backing_groups: Vec<GroupIndex>, ) -> Result<DelayTranche, InvalidAssignment>

Check the assignment cert for the given relay VRF story and returns the delay tranche.

Implementors§