mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-11 14:21:09 +00:00
@@ -5,6 +5,7 @@ use revive_dt_config::Arguments;
|
||||
use revive_dt_node_interaction::EthereumNode;
|
||||
|
||||
pub mod geth;
|
||||
pub mod pool;
|
||||
|
||||
/// The default genesis configuration.
|
||||
pub const GENESIS_JSON: &str = include_str!("../../../genesis.json");
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
use std::sync::{
|
||||
LazyLock, Mutex,
|
||||
mpsc::{Receiver, Sender},
|
||||
};
|
||||
|
||||
pub trait NodePool<T: Node> {
|
||||
fn access() -> &'static LazyLock<Mutex<Vec<T>>>;
|
||||
}
|
||||
|
||||
use revive_dt_config::Arguments;
|
||||
|
||||
use crate::Node;
|
||||
|
||||
//static POOL: LazyLock<Mutex<Pool<T>>> = LazyLock::new(Default::default);
|
||||
|
||||
pub struct Handle<T> {
|
||||
node: T,
|
||||
notifier: Sender<()>,
|
||||
}
|
||||
|
||||
pub struct Pool<T> {
|
||||
request: Receiver<()>,
|
||||
nodes: usize,
|
||||
handles: Vec<T>,
|
||||
}
|
||||
|
||||
impl<T> Pool<T>
|
||||
where
|
||||
T: Node,
|
||||
{
|
||||
pub fn spawn() {}
|
||||
}
|
||||
|
||||
// spawner: loops on a queue
|
||||
|
||||
pub fn get_handle<T: Node + NodePool<T>>(config: &Arguments) -> Receiver<T> {
|
||||
todo!()
|
||||
}
|
||||
Reference in New Issue
Block a user