mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 13:28:33 +00:00
Rust clippy 1.87 lint fixes (#7471)
Fix clippy lints for `rustc` 1.87 clippy complains about `BeaconChainError` being too large. I went on a bit of a boxing spree because of this. We may instead want to `Box` some of the `BeaconChainError` variants?
This commit is contained in:
@@ -32,7 +32,7 @@ pub enum GossipDataColumnError {
|
||||
///
|
||||
/// We were unable to process this data column due to an internal error. It's
|
||||
/// unclear if the data column is valid.
|
||||
BeaconChainError(BeaconChainError),
|
||||
BeaconChainError(Box<BeaconChainError>),
|
||||
/// The proposal signature in invalid.
|
||||
///
|
||||
/// ## Peer scoring
|
||||
@@ -162,13 +162,13 @@ pub enum GossipDataColumnError {
|
||||
|
||||
impl From<BeaconChainError> for GossipDataColumnError {
|
||||
fn from(e: BeaconChainError) -> Self {
|
||||
GossipDataColumnError::BeaconChainError(e)
|
||||
GossipDataColumnError::BeaconChainError(e.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BeaconStateError> for GossipDataColumnError {
|
||||
fn from(e: BeaconStateError) -> Self {
|
||||
GossipDataColumnError::BeaconChainError(BeaconChainError::BeaconStateError(e))
|
||||
GossipDataColumnError::BeaconChainError(BeaconChainError::BeaconStateError(e).into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ pub fn validate_data_column_sidecar_for_gossip<T: BeaconChainTypes, O: Observati
|
||||
data_column.block_proposer_index(),
|
||||
data_column.block_root(),
|
||||
)
|
||||
.map_err(|e| GossipDataColumnError::BeaconChainError(e.into()))?;
|
||||
.map_err(|e| GossipDataColumnError::BeaconChainError(Box::new(e.into())))?;
|
||||
|
||||
if O::observe() {
|
||||
observe_gossip_data_column(&kzg_verified_data_column.data, chain)?;
|
||||
@@ -516,7 +516,7 @@ fn verify_is_first_sidecar<T: BeaconChainTypes>(
|
||||
.observed_column_sidecars
|
||||
.read()
|
||||
.proposer_is_known(data_column)
|
||||
.map_err(|e| GossipDataColumnError::BeaconChainError(e.into()))?
|
||||
.map_err(|e| GossipDataColumnError::BeaconChainError(Box::new(e.into())))?
|
||||
{
|
||||
return Err(GossipDataColumnError::PriorKnown {
|
||||
proposer: data_column.block_proposer_index(),
|
||||
@@ -616,7 +616,7 @@ fn verify_proposer_and_signature<T: BeaconChainTypes>(
|
||||
let (parent_state_root, mut parent_state) = chain
|
||||
.store
|
||||
.get_advanced_hot_state(block_parent_root, column_slot, parent_block.state_root)
|
||||
.map_err(|e| GossipDataColumnError::BeaconChainError(e.into()))?
|
||||
.map_err(|e| GossipDataColumnError::BeaconChainError(Box::new(e.into())))?
|
||||
.ok_or_else(|| {
|
||||
BeaconChainError::DBInconsistent(format!(
|
||||
"Missing state for parent block {block_parent_root:?}",
|
||||
@@ -748,7 +748,7 @@ pub fn observe_gossip_data_column<T: BeaconChainTypes>(
|
||||
.observed_column_sidecars
|
||||
.write()
|
||||
.observe_sidecar(data_column_sidecar)
|
||||
.map_err(|e| GossipDataColumnError::BeaconChainError(e.into()))?
|
||||
.map_err(|e| GossipDataColumnError::BeaconChainError(Box::new(e.into())))?
|
||||
{
|
||||
return Err(GossipDataColumnError::PriorKnown {
|
||||
proposer: data_column_sidecar.block_proposer_index(),
|
||||
|
||||
Reference in New Issue
Block a user