mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-28 11:52:18 +00:00
39 lines
1.1 KiB
Rust
39 lines
1.1 KiB
Rust
//! This crate implements the testing nodes.
|
|
|
|
use alloy::{network::TxSigner, signers::Signature};
|
|
use revive_dt_config::Arguments;
|
|
use revive_dt_node_interaction::EthereumNode;
|
|
|
|
pub mod common;
|
|
pub mod geth;
|
|
pub mod kitchensink;
|
|
pub mod pool;
|
|
|
|
/// The default genesis configuration.
|
|
pub const GENESIS_JSON: &str = include_str!("../../../genesis.json");
|
|
|
|
/// An abstract interface for testing nodes.
|
|
pub trait Node: EthereumNode {
|
|
/// Create a new uninitialized instance.
|
|
fn new(
|
|
config: &Arguments,
|
|
additional_signers: impl IntoIterator<Item: TxSigner<Signature> + Send + Sync + 'static>,
|
|
) -> Self;
|
|
|
|
/// Spawns a node configured according to the genesis json.
|
|
///
|
|
/// Blocking until it's ready to accept transactions.
|
|
fn spawn(&mut self, genesis: String) -> anyhow::Result<()>;
|
|
|
|
/// Prune the node instance and related data.
|
|
///
|
|
/// Blocking until it's completely stopped.
|
|
fn shutdown(&mut self) -> anyhow::Result<()>;
|
|
|
|
/// Returns the nodes connection string.
|
|
fn connection_string(&self) -> String;
|
|
|
|
/// Returns the node version.
|
|
fn version(&self) -> anyhow::Result<String>;
|
|
}
|