Skip to content

Commit

Permalink
updatge
Browse files Browse the repository at this point in the history
  • Loading branch information
smatthewenglish committed Jun 30, 2024
1 parent 6880b7d commit 199cf49
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions crates/rpc/rpc-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@
//! evm_config,
//! )
//! .build(transports);
//!
//! let mut handle = RpcServerConfig::default().with_http(ServerBuilder::default());
//!
//! handle.start_ws_http(&transport_modules).await.unwrap();
//! }
//! ```
Expand Down Expand Up @@ -253,12 +251,10 @@ where
{
let module_config = module_config.into();
let mut server_config = server_config.into();

let value = RpcModuleBuilder::new(provider, pool, network, executor, events, evm_config)
let modules = RpcModuleBuilder::new(provider, pool, network, executor, events, evm_config)
.build(module_config);

let output: RpcServerHandle = server_config.start_ws_http(&value).await?;
Ok(output)
let handle: RpcServerHandle = server_config.start_ws_http(&modules).await?;
Ok(handle)
}

/// A builder type to configure the RPC module: See [`RpcModule`]
Expand Down Expand Up @@ -1414,24 +1410,10 @@ impl RpcServerConfig {
http_local_addr = Some(local_addr);
http_server = Some(server);
}

// http_handle = if let Some(http_server) = http_server {
// Some(http_server.start(modules.http.clone().expect("http_handle 1")))
// } else {
// None
// };

// ws_handle = if let Some(ws_server) = ws_server {
// Some(ws_server.start(modules.ws.clone().expect("ws_handle 1")))
// } else {
// None
// };
http_handle = http_server
.map(|http_server| http_server.start(modules.http.clone().expect("http_handle 1")));

ws_handle =
ws_server.map(|ws_server| ws_server.start(modules.ws.clone().expect("ws_handle 1")));

.map(|http_server| http_server.start(modules.http.clone().expect("http server error")));
ws_handle = ws_server
.map(|ws_server| ws_server.start(modules.ws.clone().expect("ws server error")));
Ok(RpcServerHandle {
http_local_addr,
ws_local_addr,
Expand Down

0 comments on commit 199cf49

Please sign in to comment.