use crate::app::Web3ProxyApp; // use crate::frontend::errors::Web3ProxyError; use ethers::providers::{JsonRpcClient, ProviderError}; use serde::{de::DeserializeOwned, Serialize}; use std::fmt::Debug; use std::sync::Arc; /// use the app as an ether's JsonRpcClient #[derive(Debug)] struct Web3ProxyAppClient(Arc); #[async_trait::async_trait] impl JsonRpcClient for Web3ProxyAppClient { type Error = ProviderError; async fn request(&self, method: &str, params: T) -> Result where T: Debug + Serialize + Send + Sync, R: DeserializeOwned + Send, { todo!("figure out traits"); // match self.0.internal_request(method, ¶ms).await { // Ok(x) => Ok(x), // Err(Web3ProxyError::EthersProvider(err)) => Err(err), // Err(err) => Err(ProviderError::CustomError(format!("{}", err))), // } } }