Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Mar 5, 2024
1 parent 286962b commit 170706a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bin/reth/src/sigsegv_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern "C" fn print_stack_trace(_: libc::c_int) {
// Collect return addresses
let depth = libc::backtrace(STACK_TRACE.as_mut_ptr(), MAX_FRAMES as i32);
if depth == 0 {
return;
return
}
&STACK_TRACE.as_slice()[0..(depth as _)]
};
Expand Down
20 changes: 10 additions & 10 deletions crates/ethereum-forks/src/hardfork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,22 @@ impl Hardfork {
/// Retrieves the activation block for the specified hardfork on the given chain.
pub fn activation_block(&self, chain: Chain) -> Option<u64> {
if chain == Chain::mainnet() {
return self.mainnet_activation_block();
return self.mainnet_activation_block()
}
if chain == Chain::sepolia() {
return self.sepolia_activation_block();
return self.sepolia_activation_block()
}
if chain == Chain::holesky() {
return self.holesky_activation_block();
return self.holesky_activation_block()
}

#[cfg(feature = "optimism")]
{
if chain == Chain::base_sepolia() {
return self.base_sepolia_activation_block();
return self.base_sepolia_activation_block()
}
if chain == Chain::base_mainnet() {
return self.base_mainnet_activation_block();
return self.base_mainnet_activation_block()
}
}

Expand Down Expand Up @@ -252,21 +252,21 @@ impl Hardfork {
/// Retrieves the activation timestamp for the specified hardfork on the given chain.
pub fn activation_timestamp(&self, chain: Chain) -> Option<u64> {
if chain == Chain::mainnet() {
return self.mainnet_activation_timestamp();
return self.mainnet_activation_timestamp()
}
if chain == Chain::sepolia() {
return self.sepolia_activation_timestamp();
return self.sepolia_activation_timestamp()
}
if chain == Chain::holesky() {
return self.holesky_activation_timestamp();
return self.holesky_activation_timestamp()
}
#[cfg(feature = "optimism")]
{
if chain == Chain::base_sepolia() {
return self.base_sepolia_activation_timestamp();
return self.base_sepolia_activation_timestamp()
}
if chain == Chain::base_mainnet() {
return self.base_mainnet_activation_timestamp();
return self.base_mainnet_activation_timestamp()
}
}

Expand Down
4 changes: 3 additions & 1 deletion crates/node-core/src/events/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ impl Eta {
let Some(current) = checkpoint.entities() else { return };

if let Some(last_checkpoint_time) = &self.last_checkpoint_time {
let Some(processed_since_last) = current.processed.checked_sub(self.last_checkpoint.processed) else {
let Some(processed_since_last) =
current.processed.checked_sub(self.last_checkpoint.processed)
else {
self.eta = None;
debug!(target: "reth::cli", ?current, ?self.last_checkpoint, "Failed to calculate the ETA: processed entities is less than the last checkpoint");
return
Expand Down
4 changes: 2 additions & 2 deletions crates/transaction-pool/src/test_utils/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ impl PoolTransaction for MockTransaction {

// If the maximum fee per gas is less than the base fee, return None
if max_fee_per_gas < base_fee {
return None;
return None
}

// Calculate the fee by subtracting the base fee from the maximum fee per gas
Expand All @@ -651,7 +651,7 @@ impl PoolTransaction for MockTransaction {
// If the maximum priority fee per gas is available, return the minimum of fee and priority
// fee
if let Some(priority_fee) = self.max_priority_fee_per_gas() {
return Some(fee.min(priority_fee));
return Some(fee.min(priority_fee))
}

// Otherwise, return the calculated fee
Expand Down
4 changes: 1 addition & 3 deletions examples/custom-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ impl PayloadAttributes for CustomPayloadAttributes {

// custom validation logic - ensure that the custom field is not zero
if self.custom == 0 {
return Err(AttributesValidationError::invalid_params(
CustomError::CustomFieldIsNotZero,
));
return Err(AttributesValidationError::invalid_params(CustomError::CustomFieldIsNotZero))
}

Ok(())
Expand Down

0 comments on commit 170706a

Please sign in to comment.