minor improvement
This commit is contained in:
parent
7510db4989
commit
1669c15a32
14
src/main.rs
14
src/main.rs
@ -373,6 +373,19 @@ impl Web3ProxyApp {
|
||||
.ok_or_else(|| anyhow::anyhow!("no params"))?
|
||||
.to_owned();
|
||||
|
||||
if rpc_servers.len() == 1 {
|
||||
let rpc = rpc_servers.first().unwrap();
|
||||
|
||||
let provider = connections.get(rpc).unwrap().clone_provider();
|
||||
|
||||
let response = provider.request(&method, params).await;
|
||||
|
||||
connections.get(rpc).unwrap().dec_active_requests();
|
||||
|
||||
tx.send(response.map_err(Into::into))?;
|
||||
|
||||
Ok(())
|
||||
} else {
|
||||
// TODO: lets just use a usize index or something
|
||||
let method = Arc::new(method);
|
||||
|
||||
@ -436,6 +449,7 @@ impl Web3ProxyApp {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user