fix(provider): Add Send bound to return type of JsonRpcClient::request (#2072)
This commit is contained in:
parent
83b12a80e3
commit
7da559bbed
|
@ -752,6 +752,7 @@ fn can_handle_overloaded_function_with_array() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::disallowed_names)]
|
||||
fn convert_uses_correct_abi() {
|
||||
abigen!(
|
||||
Foo, r#"[function foo()]"#;
|
||||
|
|
|
@ -76,7 +76,7 @@ pub trait JsonRpcClient: Debug + Send + Sync {
|
|||
async fn request<T, R>(&self, method: &str, params: T) -> Result<R, Self::Error>
|
||||
where
|
||||
T: Debug + Serialize + Send + Sync,
|
||||
R: DeserializeOwned;
|
||||
R: DeserializeOwned + Send;
|
||||
}
|
||||
|
||||
pub trait FromErr<T> {
|
||||
|
|
|
@ -199,7 +199,7 @@ impl<P: JsonRpcClient> Provider<P> {
|
|||
pub async fn request<T, R>(&self, method: &str, params: T) -> Result<R, ProviderError>
|
||||
where
|
||||
T: Debug + Serialize + Send + Sync,
|
||||
R: Serialize + DeserializeOwned + Debug,
|
||||
R: Serialize + DeserializeOwned + Debug + Send,
|
||||
{
|
||||
let span =
|
||||
tracing::trace_span!("rpc", method = method, params = ?serde_json::to_string(¶ms)?);
|
||||
|
@ -215,7 +215,7 @@ impl<P: JsonRpcClient> Provider<P> {
|
|||
Ok(res)
|
||||
}
|
||||
|
||||
async fn get_block_gen<Tx: Default + Serialize + DeserializeOwned + Debug>(
|
||||
async fn get_block_gen<Tx: Default + Serialize + DeserializeOwned + Debug + Send>(
|
||||
&self,
|
||||
id: BlockId,
|
||||
include_txs: bool,
|
||||
|
|
|
@ -238,7 +238,7 @@ where
|
|||
async fn request<A, R>(&self, method: &str, params: A) -> Result<R, Self::Error>
|
||||
where
|
||||
A: Debug + Serialize + Send + Sync,
|
||||
R: DeserializeOwned,
|
||||
R: DeserializeOwned + Send,
|
||||
{
|
||||
// Helper type that caches the `params` value across several retries
|
||||
// This is necessary because the wrapper provider is supposed to skip he `params` if it's of
|
||||
|
|
|
@ -105,14 +105,10 @@ where
|
|||
|
||||
/// Sends a POST request with the provided method and the params serialized as JSON
|
||||
/// over HTTP
|
||||
async fn request<T: Serialize + Send + Sync, R: DeserializeOwned>(
|
||||
&self,
|
||||
method: &str,
|
||||
params: T,
|
||||
) -> Result<R, Self::Error>
|
||||
async fn request<T, R>(&self, method: &str, params: T) -> Result<R, Self::Error>
|
||||
where
|
||||
T: std::fmt::Debug + Serialize + Send + Sync,
|
||||
R: DeserializeOwned,
|
||||
R: DeserializeOwned + Send,
|
||||
{
|
||||
match method {
|
||||
"eth_sendTransaction" | "eth_sendRawTransaction" => {
|
||||
|
|
Loading…
Reference in New Issue