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: Bitfield<CoreIndex>,
validator_index: ValidatorIndex,
config: &Config,
relay_vrf_story: RelayVRFStory,
assignment: &AssignmentCertV2,
backing_groups: Vec<GroupIndex>,
) -> Result<u32, 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§
sourcefn 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 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.
sourcefn check_assignment_cert(
&self,
claimed_core_bitfield: Bitfield<CoreIndex>,
validator_index: ValidatorIndex,
config: &Config,
relay_vrf_story: RelayVRFStory,
assignment: &AssignmentCertV2,
backing_groups: Vec<GroupIndex>,
) -> Result<u32, InvalidAssignment>
fn check_assignment_cert( &self, claimed_core_bitfield: Bitfield<CoreIndex>, validator_index: ValidatorIndex, config: &Config, relay_vrf_story: RelayVRFStory, assignment: &AssignmentCertV2, backing_groups: Vec<GroupIndex>, ) -> Result<u32, InvalidAssignment>
Check the assignment cert for the given relay VRF story and returns the delay tranche.