Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit fecd3b1

Browse files
committed
chore: clippy
1 parent 0b7a895 commit fecd3b1

File tree

4 files changed

+10
-76
lines changed

4 files changed

+10
-76
lines changed

src/extractor/example.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ where
4646
}
4747

4848
fn extract(&mut self, bytes: &[u8]) -> Self::Driver {
49+
#[allow(clippy::useless_asref)]
4950
let txs: Vec<TxEnvelope> =
5051
alloy_rlp::Decodable::decode(&mut bytes.as_ref()).unwrap_or_default();
5152
Block(txs, NoopBlock)

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
mod extractor;
44
pub use extractor::BlockExtractor;
55

6-
mod pool;
7-
pub use pool::{Best, EvmPool};
8-
96
mod shared;
107
pub use shared::{Child, ConcurrentCache, Root};
118

129
mod new;
10+
pub use new::{Best, EvmPool};

src/new.rs

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
use alloy_primitives::U256;
2-
use std::{
3-
future::Future,
4-
sync::{Arc, Weak},
5-
};
6-
use tokio::{sync::Semaphore, task::JoinSet};
2+
use std::sync::{Arc, Weak};
3+
use tokio::task::JoinSet;
74
use trevm::{revm::primitives::ResultAndState, Block, Cfg, EvmFactory, Tx};
85

9-
/// A trait for extracting transactions from a block.
6+
/// Evm context inner
107
#[derive(Debug, Clone)]
118
pub struct EvmCtxInner<Ef, C, B> {
129
evm_factory: Ef,
1310
cfg: C,
1411
block: B,
1512
}
1613

14+
/// Evm evaluation context
1715
#[derive(Debug, Clone)]
1816
pub struct EvmCtx<Ef, C, B>(Arc<EvmCtxInner<Ef, C, B>>);
1917

18+
/// Evm simulation pool
19+
#[derive(Debug, Clone)]
2020
pub struct EvmPool<Ef, C, B> {
2121
evm: EvmCtx<Ef, C, B>,
2222
}
@@ -30,19 +30,6 @@ where
3030
fn weak_evm(&self) -> Weak<EvmCtxInner<Ef, C, B>> {
3131
Arc::downgrade(&self.evm.0)
3232
}
33-
34-
fn spawn_eval<T, F>(
35-
&self,
36-
tx: Weak<T>,
37-
evaluator: F,
38-
) -> tokio::task::JoinHandle<Option<Best<T>>>
39-
where
40-
T: Tx + 'static,
41-
F: Fn(&ResultAndState) -> U256 + Send + Sync + 'static,
42-
{
43-
let evm = self.weak_evm();
44-
tokio::task::spawn_blocking(|| eval_fn(evm, tx, evaluator))
45-
}
4633
}
4734

4835
fn eval_fn<Ef, C, B, T, F>(
@@ -84,6 +71,8 @@ where
8471
C: Cfg + 'static,
8572
B: Block + 'static,
8673
{
74+
/// Spawn a task that will evaluate the best candidate from a channel of
75+
/// candidates.
8776
pub fn spawn<T, F>(
8877
self,
8978
mut rx: tokio::sync::mpsc::Receiver<Arc<T>>,

src/pool.rs

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)