Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianwu committed Aug 2, 2024
1 parent c2a7175 commit 4a6dc63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion crates/optimism/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ use reth_consensus_common::validation::{
validate_block_pre_execution, validate_header_base_fee, validate_header_extradata,
validate_header_gas,
};
use reth_primitives::{BlockWithSenders, Header, GotExpected, SealedBlock, SealedHeader, EMPTY_OMMER_ROOT_HASH, U256};
use reth_primitives::{
BlockWithSenders, GotExpected, Header, SealedBlock, SealedHeader, EMPTY_OMMER_ROOT_HASH, U256,
};
use std::{sync::Arc, time::SystemTime};

mod validation;
Expand Down
7 changes: 5 additions & 2 deletions crates/optimism/node/src/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ where
let mut encoded = Vec::new();
valid_tx.transaction().to_recovered_transaction().encode_enveloped(&mut encoded);

let cost_addition = if self.chain_spec().is_wright_active_at_timestamp(self.block_timestamp()) &&
valid_tx.transaction().priority_fee_or_price() == 0 {
let cost_addition = if self
.chain_spec()
.is_wright_active_at_timestamp(self.block_timestamp()) &&
valid_tx.transaction().priority_fee_or_price() == 0
{
U256::from(0)
} else {
match l1_block_info.l1_tx_data_fee(
Expand Down
10 changes: 5 additions & 5 deletions crates/rpc/rpc/src/eth/helpers/optimism.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Loads and formats OP transaction RPC response.
use jsonrpsee_types::error::ErrorObject;
use reth_chainspec::OptimismHardforks;
use reth_evm::ConfigureEvm;
use reth_evm_optimism::RethL1BlockInfo;
use reth_primitives::{
Expand All @@ -10,14 +11,13 @@ use reth_provider::{
BlockIdReader, BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, ExecutionOutcome,
StateProviderFactory,
};
use reth_rpc_eth_api::helpers::{LoadPendingBlock, LoadReceipt, SpawnBlocking};
use reth_rpc_eth_types::{EthApiError, EthResult, EthStateCache, PendingBlock, ReceiptBuilder};
use reth_rpc_server_types::result::internal_rpc_err;
use reth_rpc_types::{AnyTransactionReceipt, OptimismTransactionReceiptFields, ToRpcError};
use reth_transaction_pool::TransactionPool;
use revm::L1BlockInfo;
use revm_primitives::{BlockEnv, ExecutionResult};
use reth_chainspec::OptimismHardforks;
use reth_rpc_eth_api::helpers::{LoadPendingBlock, LoadReceipt, SpawnBlocking};
use reth_rpc_eth_types::{EthApiError, EthResult, EthStateCache, PendingBlock, ReceiptBuilder};
use reth_rpc_server_types::result::internal_rpc_err;

use crate::EthApi;

Expand Down Expand Up @@ -112,7 +112,7 @@ where
let mut optimism_tx_meta = self.build_op_tx_meta(&tx, l1_block_info, block.timestamp)?;

if self.inner.provider().chain_spec().is_wright_active_at_timestamp(block.timestamp) &&
tx.effective_gas_price(meta.base_fee) ==0
tx.effective_gas_price(meta.base_fee) ==0
{
optimism_tx_meta.l1_fee = Some(0);
}
Expand Down

0 comments on commit 4a6dc63

Please sign in to comment.