Use AttestationDuty in epoch duties

This commit is contained in:
Age Manning 2019-03-30 17:14:38 +11:00
parent c107ebf9aa
commit bb8938c564
No known key found for this signature in database
GPG Key ID: 05EED64B79E06A93
4 changed files with 13 additions and 13 deletions

View File

@ -6,4 +6,5 @@ pub struct AttestationDuty {
pub slot: Slot,
pub shard: Shard,
pub committee_index: usize,
pub comittee_size: usize,
}

View File

@ -23,9 +23,7 @@ pub struct WorkInfo {
#[derive(Debug, PartialEq, Clone, Copy, Default)]
pub struct EpochDuty {
pub block_production_slot: Option<Slot>,
pub attestation_slot: Slot,
pub attestation_shard: u64,
pub committee_index: u64,
pub attestation_duty: AttestationDuty,
}
impl EpochDuty {
@ -39,12 +37,8 @@ impl EpochDuty {
// if the validator is required to attest to a shard, create the data
let mut attestation_duty = None;
if self.attestation_slot == slot {
attestation_duty = Some(AttestationDuty {
slot,
shard: self.attestation_shard,
committee_index: self.committee_index as usize,
});
if self.attestation_duty.slot == slot {
attestation_duty = self.attestation_duty
}
if produce_block | attestation_duty.is_some() {

View File

@ -47,11 +47,17 @@ impl BeaconNodeDuties for ValidatorServiceClient {
None
}
};
let attestation_duty = AttestationDuty {
slot: Slot::from(active_duty.get_attestation_slot()),
shard: active_duty.get_attestation_shard(),
committee_index: active_duty.get_committee_index(),
comittee_size: 10,
}
let epoch_duty = EpochDuty {
block_production_slot,
attestation_slot: Slot::from(active_duty.get_attestation_slot()),
attestation_shard: active_duty.get_attestation_shard(),
committee_index: active_duty.get_committee_index(),
attestation_duty,
};
epoch_duties.insert(pub_keys[index].clone(), Some(epoch_duty));
}

View File

@ -30,7 +30,6 @@ pub enum UpdateOutcome {
#[derive(Debug, PartialEq)]
pub enum Error {
DutiesMapPoisoned,
EpochMapPoisoned,
BeaconNodeDutiesError(BeaconNodeDutiesError),
UnknownEpoch,
UnknownValidator,