Skip to content

Commit a57a150

Browse files
authored
chore: clean up some imports (#139)
1 parent 818a38e commit a57a150

File tree

7 files changed

+25
-18
lines changed

7 files changed

+25
-18
lines changed

crates/bundle/src/call/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl SignetCallBundle {
156156
}
157157

158158
/// Decode and validate the transactions in the bundle.
159-
pub fn decode_and_validate_txs<Db: trevm::revm::Database>(
159+
pub fn decode_and_validate_txs<Db: Database>(
160160
&self,
161161
) -> Result<Vec<TxEnvelope>, BundleError<Db>> {
162162
let txs = self

crates/evm/src/driver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use trevm::{
2929
database::State,
3030
Database, DatabaseCommit, Inspector,
3131
},
32-
trevm_try, BlockDriver, BlockOutput, Tx,
32+
trevm_try, Block, BlockDriver, BlockOutput, Cfg, Tx,
3333
};
3434

3535
/// Used internally to signal that the transaction should be discarded.
@@ -562,7 +562,7 @@ impl<'a, 'b, C: Extractable> SignetDriver<'a, 'b, C> {
562562
}
563563
}
564564

565-
impl<C: Extractable> trevm::Cfg for SignetDriver<'_, '_, C> {
565+
impl<C: Extractable> Cfg for SignetDriver<'_, '_, C> {
566566
fn fill_cfg_env(&self, cfg_env: &mut CfgEnv) {
567567
cfg_env.chain_id = self.extracts.chain_id;
568568
}
@@ -630,7 +630,7 @@ where
630630
}
631631
}
632632

633-
impl<C: Extractable> trevm::Block for SignetDriver<'_, '_, C> {
633+
impl<C: Extractable> Block for SignetDriver<'_, '_, C> {
634634
fn fill_block_env(&self, block_env: &mut BlockEnv) {
635635
let BlockEnv {
636636
number,

crates/evm/src/types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
use super::*;
22
#[allow(unused_imports)]
33
use trevm::{
4+
inspectors::Layered,
45
revm::{context::result::EVMError, inspector::NoOpInspector, Database},
56
Block, Cfg, Trevm,
67
};
78

89
/// Layered inspector containing an [`OrderDetector`].
9-
pub type SignetLayered<I> = trevm::inspectors::Layered<I, OrderDetector>;
10+
pub type SignetLayered<I> = Layered<I, OrderDetector>;
1011

1112
/// A [`Trevm`] that requires a [`Cfg`].
1213
///

crates/journal/src/meta.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::borrow::Cow;
2-
31
use alloy::{consensus::Header, primitives::B256};
2+
use std::borrow::Cow;
43
use trevm::journal::{JournalDecode, JournalDecodeError, JournalEncode};
54

65
/// Metadata for a block journal. This includes the block header, the host

crates/journal/src/versions.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use alloy::{consensus::Header, primitives::B256};
2-
use trevm::journal::{JournalDecode, JournalEncode};
3-
41
use crate::HostJournal;
2+
use alloy::{consensus::Header, primitives::B256};
3+
use trevm::journal::{JournalDecode, JournalDecodeError, JournalEncode};
54

65
/// Journal versions.
76
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -74,11 +73,11 @@ impl JournalEncode for Journal<'_> {
7473
}
7574

7675
impl JournalDecode for Journal<'static> {
77-
fn decode(buf: &mut &[u8]) -> Result<Self, trevm::journal::JournalDecodeError> {
76+
fn decode(buf: &mut &[u8]) -> Result<Self, JournalDecodeError> {
7877
let version: u8 = JournalDecode::decode(buf)?;
7978
match version {
8079
1 => JournalDecode::decode(buf).map(Journal::V1),
81-
_ => Err(trevm::journal::JournalDecodeError::InvalidTag {
80+
_ => Err(JournalDecodeError::InvalidTag {
8281
ty_name: "Journal",
8382
tag: version,
8483
max_expected: 1,

crates/sim/src/lib.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#![cfg_attr(docsrs, feature(doc_cfg))]
1616

1717
mod built;
18+
1819
pub use built::BuiltBlock;
1920

2021
mod cache;
@@ -35,11 +36,18 @@ pub use outcome::SimOutcomeWithCache;
3536
mod task;
3637
pub use task::BlockBuild;
3738

39+
use std::sync::Arc;
40+
use trevm::{
41+
db::cow::CacheOnWrite,
42+
inspectors::{Layered, TimeLimit},
43+
revm::database::CacheDB,
44+
};
45+
3846
/// A type alias for the database underlying the simulation.
39-
pub type InnerDb<Db> = std::sync::Arc<trevm::revm::database::CacheDB<Db>>;
47+
pub type InnerDb<Db> = Arc<CacheDB<Db>>;
4048

4149
/// A type alias for the database used in the simulation.
42-
pub type SimDb<Db> = trevm::db::cow::CacheOnWrite<InnerDb<Db>>;
50+
pub type SimDb<Db> = CacheOnWrite<InnerDb<Db>>;
4351

4452
/// A time-limited layered inspector.
45-
pub type TimeLimited<Insp> = trevm::inspectors::Layered<trevm::inspectors::TimeLimit, Insp>;
53+
pub type TimeLimited<Insp> = Layered<TimeLimit, Insp>;

crates/test-utils/src/evm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use trevm::{
2727
state::{Account, AccountInfo, Bytecode, EvmState, EvmStorageSlot},
2828
Database, DatabaseCommit, Inspector,
2929
},
30-
NoopBlock,
30+
Cfg, NoopBlock,
3131
};
3232

3333
/// Create a new Signet EVM with an in-memory database for testing.
@@ -70,7 +70,7 @@ where
7070
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7171
pub struct TestCfg;
7272

73-
impl trevm::Cfg for TestCfg {
73+
impl Cfg for TestCfg {
7474
fn fill_cfg_env(&self, cfg_env: &mut CfgEnv) {
7575
let CfgEnv { chain_id, spec, .. } = cfg_env;
7676

@@ -83,7 +83,7 @@ impl trevm::Cfg for TestCfg {
8383
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8484
pub struct HostTestCfg;
8585

86-
impl trevm::Cfg for HostTestCfg {
86+
impl Cfg for HostTestCfg {
8787
fn fill_cfg_env(&self, cfg_env: &mut CfgEnv) {
8888
let CfgEnv { chain_id, spec, .. } = cfg_env;
8989

0 commit comments

Comments
 (0)