fix get attesting indices (#5742)

* fix get attesting indices

* better errors

* fix compile

* only get committee index once
This commit is contained in:
realbigsean
2024-05-09 09:34:56 -04:00
committed by GitHub
parent 43c3f63e30
commit e32dfcdcad
3 changed files with 16 additions and 7 deletions

View File

@@ -1309,10 +1309,11 @@ pub fn obtain_indexed_attestation_and_committees_per_slot<T: BeaconChainTypes>(
attesting_indices_electra::get_indexed_attestation(&committees, att)
.map(|attestation| (attestation, committees_per_slot))
.map_err(|e| {
if e == BlockOperationError::BeaconStateError(NoCommitteeFound) {
let index = att.committee_index();
if e == BlockOperationError::BeaconStateError(NoCommitteeFound(index)) {
Error::NoCommitteeForSlotAndIndex {
slot: att.data.slot,
index: att.committee_index(),
index,
}
} else {
Error::Invalid(e)