Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ alloy = { version = "1.0.19", features = [
] }
alloy-contract = { version = "1.0.19", features = ["pubsub"] }

# Reth
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.1" }
reth-exex = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.1" }

# Async
tokio = { version = "1.43.0", features = ["macros"] }
async-trait = "0.1.87"
Expand Down
8 changes: 4 additions & 4 deletions crates/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ trevm = { workspace = true, features = ["test-utils"] }

alloy.workspace = true

reth.workspace = true
reth-exex.workspace = true

tracing-subscriber.workspace = true
tokio.workspace = true
tokio.workspace = true

[dev-dependencies]
tracing-subscriber = { workspace = true, features = ["env-filter"] }
99 changes: 0 additions & 99 deletions crates/test-utils/src/convert.rs

This file was deleted.

5 changes: 3 additions & 2 deletions crates/test-utils/src/evm.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use reth::revm::context::CfgEnv;
use signet_constants::test_utils::*;
use trevm::revm::{database::in_memory_db::InMemoryDB, primitives::hardfork::SpecId};
use trevm::revm::{
context::CfgEnv, database::in_memory_db::InMemoryDB, primitives::hardfork::SpecId,
};

/// Create a new Signet EVM with an in-memory database for testing.
pub fn test_signet_evm() -> signet_evm::EvmNeedsBlock<InMemoryDB> {
Expand Down
1 change: 0 additions & 1 deletion crates/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod chain;
pub mod convert;
pub mod evm;
pub mod specs;
pub mod users;
Expand Down
39 changes: 28 additions & 11 deletions crates/test-utils/src/specs/notif_spec.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
use crate::{convert::ToRethPrimitive, specs::HostBlockSpec};
use crate::{chain::Chain, specs::HostBlockSpec};
use alloy::consensus::BlobTransactionSidecar;
use reth_exex::ExExNotification;
use signet_types::primitives::TransactionSigned;
use std::{collections::BTreeMap, sync::Arc};

/// A shim for reth_exex::ExExNotification that allows us to use it in tests.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ExExNotification {
/// Chain got committed without a reorg, and only the new chain is returned.
Committed {
/// The new chain after commit.
new: Arc<Chain>,
},
/// Chain got reorged, and both the old and the new chains are returned.
Reorged {
/// The old chain before reorg.
old: Arc<Chain>,
/// The new chain after reorg.
new: Arc<Chain>,
},
/// Chain got reverted, and only the old chain is returned.
Reverted {
/// The old chain before reversion.
old: Arc<Chain>,
},
}

/// A notification spec.
#[derive(Debug, Default)]
pub struct NotificationSpec {
Expand Down Expand Up @@ -86,22 +107,18 @@ impl NotificationSpec {

match (old_chain, new_chain) {
(Some(old_chain), Some(new_chain)) => NotificationWithSidecars {
notification: ExExNotification::ChainReorged {
old: Arc::new(old_chain.to_reth()),
new: Arc::new(new_chain.to_reth()),
notification: ExExNotification::Reorged {
old: Arc::new(old_chain),
new: Arc::new(new_chain),
},
sidecars,
},
(Some(old_chain), None) => NotificationWithSidecars {
notification: ExExNotification::ChainReverted {
old: Arc::new(old_chain.to_reth()),
},
notification: ExExNotification::Reverted { old: Arc::new(old_chain) },
sidecars,
},
(None, Some(new_chain)) => NotificationWithSidecars {
notification: ExExNotification::ChainCommitted {
new: Arc::new(new_chain.to_reth()),
},
notification: ExExNotification::Committed { new: Arc::new(new_chain) },
sidecars,
},
(None, None) => panic!("missing old and new chains"),
Expand Down