Send a RPC call with the given method and parameters. # Examples ```ignore let web3 = web3::Web3::new("http://127.0.0.1:8545").unwrap(); let response = web3.send_rpc("eth_blockNumber", rpc_params![]).await; assert!(response.is_ok()); ```
(&self, method: &str, params: Params)
| 48 | /// assert!(response.is_ok()); |
| 49 | /// ``` |
| 50 | pub async fn send_rpc<Params>(&self, method: &str, params: Params) -> Result<Value> |
| 51 | where |
| 52 | Params: ToRpcParams + Send + std::fmt::Debug, |
| 53 | { |
| 54 | trace!("Sending RPC {} with params {:?}", method, params); |
| 55 | |
| 56 | let response = self |
| 57 | .client |
| 58 | .request(method, params) |
| 59 | .await |
| 60 | .map_err(|e| Web3Error::RpcRequestError(e.to_string())); |
| 61 | |
| 62 | trace!("RPC Response {:?}", response); |
| 63 | |
| 64 | response |
| 65 | } |
| 66 | } |
no outgoing calls
no test coverage detected