mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Improve attester errors, move info -> helpers
- Ensured one can distingush between a committee error and an invalid validator index when using `validator_attesation_slot_and_shard`. - Renamed the `info.rs` file to `getters.rs`, for clarity.
This commit is contained in:
@@ -53,9 +53,12 @@ impl<T: ClientDB, U: SlotClock> AttesterDutiesReader for DirectDuties<T, U> {
|
||||
.beacon_chain
|
||||
.validator_attestion_slot_and_shard(validator_index as usize)
|
||||
{
|
||||
Some((attest_slot, attest_shard)) if attest_slot == slot => Ok(Some(attest_shard)),
|
||||
Some(_) => Ok(None),
|
||||
None => Err(AttesterDutiesReaderError::UnknownEpoch),
|
||||
Ok(Some((attest_slot, attest_shard))) if attest_slot == slot => {
|
||||
Ok(Some(attest_shard))
|
||||
}
|
||||
Ok(Some(_)) => Ok(None),
|
||||
Ok(None) => Err(AttesterDutiesReaderError::UnknownEpoch),
|
||||
Err(_) => panic!("Error when getting validator attestation shard."),
|
||||
}
|
||||
} else {
|
||||
Err(AttesterDutiesReaderError::UnknownValidator)
|
||||
|
||||
Reference in New Issue
Block a user