forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement bare types for websocket transport
Signed-off-by: onur-ozkan <work@onurozkan.dev>
- Loading branch information
1 parent
6dbd85b
commit fbf0dad
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#![allow(unused)] // TODO: remove this | ||
|
||
use crate::eth::web3_transport::Web3SendOut; | ||
use futures::lock::Mutex as AsyncMutex; | ||
use jsonrpc_core::Call; | ||
use std::sync::Arc; | ||
use web3::{RequestId, Transport}; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct WebsocketTransportNode { | ||
pub(crate) uri: http::Uri, | ||
pub(crate) gui_auth: bool, | ||
} | ||
|
||
#[derive(Debug)] | ||
struct WebsocketTransportRpcClient(AsyncMutex<WebsocketTransportRpcClientImpl>); | ||
|
||
#[derive(Debug)] | ||
struct WebsocketTransportRpcClientImpl { | ||
nodes: Vec<WebsocketTransportNode>, | ||
} | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct WebsocketTransport { | ||
client: Arc<WebsocketTransportRpcClient>, | ||
} | ||
|
||
impl Transport for WebsocketTransport { | ||
type Out = Web3SendOut; | ||
|
||
fn prepare(&self, method: &str, params: Vec<serde_json::Value>) -> (RequestId, Call) { todo!() } | ||
|
||
fn send(&self, id: RequestId, request: Call) -> Self::Out { todo!() } | ||
} |