mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Fix Rust beta compiler errors (1.77) (#5180)
* Lint fixes * More fixes for beta compiler. * Format fixes * Move `#[allow(dead_code)]` to field level. * Remove old comment. * Update beacon_node/execution_layer/src/test_utils/mod.rs Co-authored-by: João Oliveira <hello@jxs.pt> * remove duplicate line
This commit is contained in:
@@ -539,8 +539,8 @@ impl<'a, T: BeaconChainTypes> IndexedAggregatedAttestation<'a, T> {
|
||||
Err(e) => return Err(SignatureNotChecked(&signed_aggregate.message.aggregate, e)),
|
||||
};
|
||||
|
||||
let indexed_attestation =
|
||||
match map_attestation_committee(chain, attestation, |(committee, _)| {
|
||||
let get_indexed_attestation_with_committee =
|
||||
|(committee, _): (BeaconCommittee, CommitteesPerSlot)| {
|
||||
// Note: this clones the signature which is known to be a relatively slow operation.
|
||||
//
|
||||
// Future optimizations should remove this clone.
|
||||
@@ -561,11 +561,17 @@ impl<'a, T: BeaconChainTypes> IndexedAggregatedAttestation<'a, T> {
|
||||
|
||||
get_indexed_attestation(committee.committee, attestation)
|
||||
.map_err(|e| BeaconChainError::from(e).into())
|
||||
}) {
|
||||
Ok(indexed_attestation) => indexed_attestation,
|
||||
Err(e) => return Err(SignatureNotChecked(&signed_aggregate.message.aggregate, e)),
|
||||
};
|
||||
|
||||
let indexed_attestation = match map_attestation_committee(
|
||||
chain,
|
||||
attestation,
|
||||
get_indexed_attestation_with_committee,
|
||||
) {
|
||||
Ok(indexed_attestation) => indexed_attestation,
|
||||
Err(e) => return Err(SignatureNotChecked(&signed_aggregate.message.aggregate, e)),
|
||||
};
|
||||
|
||||
Ok(IndexedAggregatedAttestation {
|
||||
signed_aggregate,
|
||||
indexed_attestation,
|
||||
|
||||
@@ -967,7 +967,7 @@ mod test {
|
||||
let spec = &E::default_spec();
|
||||
let state: BeaconState<E> = BeaconState::new(0, get_eth1_data(0), spec);
|
||||
|
||||
let blocks = vec![];
|
||||
let blocks = [];
|
||||
|
||||
assert_eq!(
|
||||
get_votes_to_consider(
|
||||
|
||||
@@ -51,7 +51,8 @@ const MAX_BLOCK_PRODUCTION_CACHE_DISTANCE: u64 = 4;
|
||||
#[derive(Debug)]
|
||||
enum Error {
|
||||
BeaconChain(BeaconChainError),
|
||||
HeadMissingFromSnapshotCache(Hash256),
|
||||
// We don't use the inner value directly, but it's used in the Debug impl.
|
||||
HeadMissingFromSnapshotCache(#[allow(dead_code)] Hash256),
|
||||
MaxDistanceExceeded {
|
||||
current_slot: Slot,
|
||||
head_slot: Slot,
|
||||
|
||||
Reference in New Issue
Block a user