Skip to content

Commit

Permalink
chore: remove a couple of unexpected changes lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lean-apple committed Nov 8, 2024
1 parent 6d32d99 commit f51fbcc
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions crates/rpc/rpc/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,18 @@ where

if !self.disallow.is_empty() {
if self.disallow.contains(&block.beneficiary) {
return Err(ValidationApiError::Blacklist(block.beneficiary));
return Err(ValidationApiError::Blacklist(block.beneficiary))
}
if self.disallow.contains(&message.proposer_fee_recipient) {
return Err(ValidationApiError::Blacklist(message.proposer_fee_recipient));
return Err(ValidationApiError::Blacklist(message.proposer_fee_recipient))
}
for (sender, tx) in block.senders.iter().zip(block.transactions()) {
if self.disallow.contains(sender) {
return Err(ValidationApiError::Blacklist(*sender));
return Err(ValidationApiError::Blacklist(*sender))
}
if let Some(to) = tx.to() {
if self.disallow.contains(&to) {
return Err(ValidationApiError::Blacklist(to));
return Err(ValidationApiError::Blacklist(to))
}
}
}
Expand All @@ -168,7 +168,7 @@ where
GotExpected { got: block.header.parent_hash, expected: latest_header.hash() }
.into(),
)
.into());
.into())
}
self.consensus.validate_header_against_parent(&block.header, &latest_header)?;
self.validate_gas_limit(registered_gas_limit, &latest_header, &block.header)?;
Expand Down Expand Up @@ -225,7 +225,7 @@ where
return Err(ConsensusError::BodyStateRootDiff(
GotExpected { got: state_root, expected: block.state_root }.into(),
)
.into());
.into())
}

Ok(())
Expand Down Expand Up @@ -256,7 +256,7 @@ where
return Err(ValidationApiError::GasUsedMismatch(GotExpected {
got: message.gas_used,
expected: header.gas_used,
}));
}))
} else {
Ok(())
}
Expand Down Expand Up @@ -284,7 +284,7 @@ where
return Err(ValidationApiError::GasLimitMismatch(GotExpected {
got: header.gas_limit,
expected: best_gas_limit,
}));
}))
}

Ok(())
Expand Down Expand Up @@ -322,7 +322,7 @@ where
}

if balance_after >= balance_before + message.value {
return Ok(());
return Ok(())
}

let (receipt, tx) = output
Expand All @@ -332,24 +332,24 @@ where
.ok_or(ValidationApiError::ProposerPayment)?;

if !receipt.success {
return Err(ValidationApiError::ProposerPayment);
return Err(ValidationApiError::ProposerPayment)
}

if tx.to() != Some(message.proposer_fee_recipient) {
return Err(ValidationApiError::ProposerPayment);
return Err(ValidationApiError::ProposerPayment)
}

if tx.value() != message.value {
return Err(ValidationApiError::ProposerPayment);
return Err(ValidationApiError::ProposerPayment)
}

if !tx.input().is_empty() {
return Err(ValidationApiError::ProposerPayment);
return Err(ValidationApiError::ProposerPayment)
}

if let Some(block_base_fee) = block.base_fee_per_gas {
if tx.effective_tip_per_gas(block_base_fee).unwrap_or_default() != 0 {
return Err(ValidationApiError::ProposerPayment);
return Err(ValidationApiError::ProposerPayment)
}
}

Expand All @@ -364,7 +364,7 @@ where
if blobs_bundle.commitments.len() != blobs_bundle.proofs.len() ||
blobs_bundle.commitments.len() != blobs_bundle.blobs.len()
{
return Err(ValidationApiError::InvalidBlobsBundle);
return Err(ValidationApiError::InvalidBlobsBundle)
}

let versioned_hashes = blobs_bundle
Expand Down

0 comments on commit f51fbcc

Please sign in to comment.