Skip to content

Commit 0d68d68

Browse files
committed
chore(repo): clippy / fmt
With the new edition/version bump there's a bunch of clippy / fmt changes to do.
1 parent 259b620 commit 0d68d68

File tree

17 files changed

+61
-69
lines changed

17 files changed

+61
-69
lines changed

crates/blobber/src/block_data.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::{
2-
error::UnrecoverableBlobError, shim::ExtractableChainShim, BlockExtractionError,
3-
BlockExtractorBuilder, ExtractionResult,
2+
BlockExtractionError, BlockExtractorBuilder, ExtractionResult, error::UnrecoverableBlobError,
3+
shim::ExtractableChainShim,
44
};
55
use alloy::{
66
consensus::{Blob, SidecarCoder, SimpleCoder},
77
eips::eip7594::BlobTransactionSidecarVariant,
8-
primitives::{keccak256, TxHash, B256},
8+
primitives::{B256, TxHash, keccak256},
99
};
1010
use init4_bin_base::utils::calc::SlotCalculator;
1111
use reth::{
@@ -334,15 +334,15 @@ mod tests {
334334
BlobTransactionSidecar, SidecarBuilder, SignableTransaction, TxEip2930, TxEnvelope,
335335
},
336336
eips::Encodable2718,
337-
primitives::{bytes, Address, TxKind, U256},
337+
primitives::{Address, TxKind, U256, bytes},
338338
rlp::encode,
339-
signers::{local::PrivateKeySigner, SignerSync},
339+
signers::{SignerSync, local::PrivateKeySigner},
340340
};
341341
use foundry_blob_explorers::TransactionDetails;
342342
use reth::primitives::{Transaction, TransactionSigned};
343343
use reth_transaction_pool::{
344-
test_utils::{testing_pool, MockTransaction},
345344
PoolTransaction, TransactionOrigin,
345+
test_utils::{MockTransaction, testing_pool},
346346
};
347347
use signet_types::constants::SignetSystemConstants;
348348

crates/db/src/provider.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::{
2+
DataCompat, DbZenithHeader, RuChain, ZenithHeaders,
23
tables::{DbSignetEvent, JournalHashes, SignetEvents},
34
traits::RuWriter,
4-
DataCompat, DbZenithHeader, RuChain, ZenithHeaders,
55
};
66
use alloy::{
77
consensus::{BlockHeader, TxReceipt},
8-
primitives::{map::HashSet, Address, BlockNumber, B256, U256},
8+
primitives::{Address, B256, BlockNumber, U256, map::HashSet},
99
};
1010
use reth::{
1111
primitives::{Account, StaticFileSegment},
@@ -17,13 +17,13 @@ use reth::{
1717
},
1818
};
1919
use reth_db::{
20+
PlainAccountState,
2021
cursor::{DbCursorRO, DbCursorRW},
2122
models::{BlockNumberAddress, StoredBlockBodyIndices},
2223
tables,
2324
transaction::{DbTx, DbTxMut},
24-
PlainAccountState,
2525
};
26-
use reth_prune_types::{PruneMode, MINIMUM_PRUNING_DISTANCE};
26+
use reth_prune_types::{MINIMUM_PRUNING_DISTANCE, PruneMode};
2727
use signet_evm::BlockResult;
2828
use signet_node_types::{NodeTypesDbTrait, SignetNodeTypes};
2929
use signet_types::primitives::RecoveredBlock;

crates/db/src/tables.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
use alloy::{
2-
primitives::{bytes::BufMut, Address, BlockNumber, Bytes, B256, U256},
2+
primitives::{Address, B256, BlockNumber, Bytes, U256, bytes::BufMut},
33
rlp::Buf,
44
};
55
use reth_db::{
6+
DatabaseError,
67
table::{Compress, Decompress, DupSort, Table},
7-
tables, DatabaseError,
8+
tables,
89
};
910
use signet_zenith::{
1011
Passage::{Enter, EnterToken},

crates/db/src/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::{DbExtractionResults, DbSignetEvent, RuChain};
2-
use alloy::primitives::{Address, BlockNumber, B256, U256};
2+
use alloy::primitives::{Address, B256, BlockNumber, U256};
33
use itertools::Itertools;
44
use reth::{
55
primitives::Account,

crates/rpc/examples/filler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ use alloy::{
33
network::{Ethereum, EthereumWallet, TransactionBuilder},
44
primitives::Bytes,
55
providers::{
6+
Identity, Provider as _, RootProvider, SendableTx,
67
fillers::{
78
BlobGasFiller, ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller,
89
WalletFiller,
910
},
10-
Identity, Provider as _, RootProvider, SendableTx,
1111
},
12-
rpc::types::{mev::EthSendBundle, TransactionRequest},
12+
rpc::types::{TransactionRequest, mev::EthSendBundle},
1313
signers::Signer,
1414
};
15-
use eyre::{eyre, Error};
15+
use eyre::{Error, eyre};
1616
use signet_bundle::SignetEthBundle;
1717
use signet_constants::SignetConstants;
1818
use signet_tx_cache::{client::TxCache, types::TxCacheSendBundleResponse};

crates/rpc/examples/order.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use alloy::{
22
consensus::constants::GWEI_TO_WEI,
3-
primitives::{uint, U256},
3+
primitives::{U256, uint},
44
signers::Signer,
55
};
66
use chrono::Utc;
77
use eyre::Error;
8-
use signet_constants::{SignetConstants, NATIVE_TOKEN_ADDRESS};
8+
use signet_constants::{NATIVE_TOKEN_ADDRESS, SignetConstants};
99
use signet_tx_cache::client::TxCache;
1010
use signet_types::UnsignedOrder;
1111
use signet_zenith::RollupOrders::{Input, Order, Output};

crates/rpc/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use ajj::{pubsub::ServerShutdown, Router};
1+
use ajj::{Router, pubsub::ServerShutdown};
22
use reth::{args::RpcServerArgs, tasks::TaskExecutor};
33
use std::net::SocketAddr;
44
use tokio::task::JoinHandle;

crates/rpc/src/ctx.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::{
2+
Pnt,
23
eth::EthError,
34
interest::{ActiveFilter, FilterManager, FilterOutput, SubscriptionManager},
45
receipts::build_signet_receipt,
56
util::BlockRangeInclusiveIter,
6-
Pnt,
77
};
88
use alloy::{
99
consensus::{BlockHeader, Header, Signed, Transaction, TxEnvelope},
@@ -16,21 +16,21 @@ use reth::{
1616
core::primitives::SignerRecoverable,
1717
primitives::{Block, EthPrimitives, Receipt, Recovered, RecoveredBlock, TransactionSigned},
1818
providers::{
19-
providers::{BlockchainProvider, ProviderNodeTypes},
2019
BlockHashReader, BlockIdReader, BlockNumReader, CanonStateSubscriptions, HeaderProvider,
2120
ProviderBlock, ProviderError, ProviderReceipt, ReceiptProvider, StateProviderFactory,
2221
TransactionsProvider,
22+
providers::{BlockchainProvider, ProviderNodeTypes},
2323
},
2424
revm::{database::StateProviderDatabase, primitives::hardfork::SpecId},
2525
rpc::{
2626
eth::{filter::EthFilterError, helpers::types::EthRpcConverter},
2727
server_types::eth::{
28+
EthApiError, EthConfig, EthStateCache, FeeHistoryCache, FeeHistoryEntry,
29+
GasPriceOracle,
2830
fee_history::{
2931
calculate_reward_percentiles_for_block, fee_history_cache_new_blocks_task,
3032
},
31-
logs_utils::{self, append_matching_block_logs, ProviderOrBlock},
32-
EthApiError, EthConfig, EthStateCache, FeeHistoryCache, FeeHistoryEntry,
33-
GasPriceOracle,
33+
logs_utils::{self, ProviderOrBlock, append_matching_block_logs},
3434
},
3535
types::{FilterBlockOption, FilteredParams},
3636
},
@@ -41,12 +41,12 @@ use reth_node_api::{BlockBody, FullNodeComponents};
4141
use reth_rpc_eth_api::{RpcBlock, RpcConvert, RpcReceipt, RpcTransaction};
4242
use signet_evm::EvmNeedsTx;
4343
use signet_tx_cache::client::TxCache;
44-
use signet_types::{constants::SignetSystemConstants, MagicSig};
44+
use signet_types::{MagicSig, constants::SignetSystemConstants};
4545
use std::{marker::PhantomData, sync::Arc};
46-
use tracing::{instrument, trace, Level};
46+
use tracing::{Level, instrument, trace};
4747
use trevm::{
48-
revm::{context::CfgEnv, database::StateBuilder},
4948
Cfg,
49+
revm::{context::CfgEnv, database::StateBuilder},
5050
};
5151

5252
/// Type alias for EVMs using a [`StateProviderBox`] as the `DB` type for
@@ -326,7 +326,6 @@ where
326326
Ok(Some((hash, header)))
327327
}
328328

329-
330329
/// Get the block for a given block, returning the block hash and
331330
/// the block itself.
332331
pub async fn raw_block(

crates/rpc/src/eth/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub use error::EthError;
77
mod helpers;
88
pub use helpers::CallErrorData;
99

10-
use crate::{ctx::RpcCtx, Pnt};
10+
use crate::{Pnt, ctx::RpcCtx};
1111
use alloy::{eips::BlockNumberOrTag, primitives::B256};
1212
use reth_node_api::FullNodeComponents;
1313

crates/rpc/src/interest/filters.rs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ use alloy::{
33
primitives::{B256, U64},
44
rpc::types::{Filter, Log},
55
};
6-
use dashmap::{mapref::one::RefMut, DashMap};
6+
use dashmap::{DashMap, mapref::one::RefMut};
77
use std::{
88
collections::VecDeque,
99
sync::{
10-
atomic::{AtomicU64, Ordering},
1110
Arc, Weak,
11+
atomic::{AtomicU64, Ordering},
1212
},
1313
time::{Duration, Instant},
1414
};
@@ -71,9 +71,9 @@ impl FilterOutput {
7171
pub fn extend(&mut self, other: Self) {
7272
match (self, other) {
7373
// If we're a log, we can extend with other logs
74-
(Self::Log(ref mut logs), Self::Log(other_logs)) => logs.extend(other_logs),
74+
(Self::Log(logs), Self::Log(other_logs)) => logs.extend(other_logs),
7575
// If we're a block, we can extend with other blocks
76-
(Self::Block(ref mut blocks), Self::Block(other_blocks)) => blocks.extend(other_blocks),
76+
(Self::Block(blocks), Self::Block(other_blocks)) => blocks.extend(other_blocks),
7777
// Extending with empty is a noop
7878
(_, Self::Empty(_)) => (),
7979
// If we're empty, just take the other value
@@ -108,22 +108,14 @@ impl From<Vec<Log>> for FilterOutput {
108108
impl FromIterator<Log> for FilterOutput {
109109
fn from_iter<T: IntoIterator<Item = Log>>(iter: T) -> Self {
110110
let inner: VecDeque<_> = iter.into_iter().collect();
111-
if inner.is_empty() {
112-
Self::empty()
113-
} else {
114-
Self::Log(inner)
115-
}
111+
if inner.is_empty() { Self::empty() } else { Self::Log(inner) }
116112
}
117113
}
118114

119115
impl FromIterator<B256> for FilterOutput {
120116
fn from_iter<T: IntoIterator<Item = B256>>(iter: T) -> Self {
121117
let inner: VecDeque<_> = iter.into_iter().collect();
122-
if inner.is_empty() {
123-
Self::empty()
124-
} else {
125-
Self::Block(inner)
126-
}
118+
if inner.is_empty() { Self::empty() } else { Self::Block(inner) }
127119
}
128120
}
129121

@@ -294,12 +286,14 @@ impl FilterCleanTask {
294286
/// [`DashMap::retain`]'s deadlock condition is not met. See [`DashMap`]
295287
/// documentation for more information.
296288
fn spawn(self) {
297-
std::thread::spawn(move || loop {
298-
std::thread::sleep(self.sleep);
299-
trace!("cleaning stale filters");
300-
match self.manager.upgrade() {
301-
Some(manager) => manager.clean_stale(self.age_limit),
302-
None => break,
289+
std::thread::spawn(move || {
290+
loop {
291+
std::thread::sleep(self.sleep);
292+
trace!("cleaning stale filters");
293+
match self.manager.upgrade() {
294+
Some(manager) => manager.clean_stale(self.age_limit),
295+
None => break,
296+
}
303297
}
304298
});
305299
}

0 commit comments

Comments
 (0)