diff --git a/src/bridge_backend_client.rs b/src/bridge_backend_client.rs deleted file mode 100644 index 643855c..0000000 --- a/src/bridge_backend_client.rs +++ /dev/null @@ -1,34 +0,0 @@ -use std::{net::SocketAddr, time::Duration}; - -use jsonrpsee::{ - http_client::{HttpClient, HttpClientBuilder}, - ws_client::{PingConfig, WsClient, WsClientBuilder}, -}; - -pub struct BridgeBackendClient { - _http_client: HttpClient, - _ws_client: WsClient, - pub rpc_addr: SocketAddr, -} - -impl BridgeBackendClient { - pub async fn new(rpc_addr: SocketAddr) -> anyhow::Result { - let http_host = format!("http://localhost:{}", rpc_addr.port()); - let ws_host = format!("ws://localhost:{}", rpc_addr.port()); - - let _http_client = HttpClientBuilder::default() - .request_timeout(Duration::from_secs(120)) - .build(http_host)?; - - let _ws_client = WsClientBuilder::default() - .enable_ws_ping(PingConfig::default().inactive_limit(Duration::from_secs(10))) - .build(ws_host) - .await?; - - Ok(Self { - _ws_client, - _http_client, - rpc_addr, - }) - } -} diff --git a/src/framework.rs b/src/framework.rs index ac2e735..1940557 100644 --- a/src/framework.rs +++ b/src/framework.rs @@ -12,7 +12,7 @@ use super::{ traits::{LogProvider, LogProviderErased, NodeT}, Result, }; -use crate::{bridge_backend::BridgeBackendNodeCluster, prover::Prover, utils::tail_file}; +use crate::{bridge_backend::BridgeBackendNode, prover::Prover, utils::tail_file}; pub struct TestContext { pub config: TestConfig, @@ -36,7 +36,7 @@ impl TestContext { pub struct TestFramework { ctx: TestContext, pub bitcoin_nodes: BitcoinNodeCluster, - pub bridge_backend_nodes: BridgeBackendNodeCluster, + pub bridge_backend: Option, pub sequencer: Option, pub prover: Option, pub full_node: Option, @@ -62,12 +62,10 @@ impl TestFramework { let ctx = TestContext::new(config).await; let bitcoin_nodes = BitcoinNodeCluster::new(&ctx).await?; - let bridge_backend_nodes = BridgeBackendNodeCluster::new(&ctx).await?; - // tokio::time::sleep(std::time::Duration::from_secs(30)).await; Ok(Self { bitcoin_nodes, - bridge_backend_nodes, + bridge_backend: None, sequencer: None, prover: None, full_node: None, diff --git a/src/lib.rs b/src/lib.rs index 30d413c..b4ec8aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ pub mod bitcoin; pub mod bridge_backend; -// mod bridge_backend_client; mod client; pub mod config; mod docker;