1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::{connector::connect, jrpc_client, FatalErr, JrpcRequest, Offchain, Pair};
use hyper::Uri;
use serde_json::Value;
use tokio::task::JoinHandle;
pub fn pass(off: Offchain, uri: Uri) -> JoinHandle<Result<(), FatalErr>> {
tokio::spawn(async move {
tracing::debug!("pass pipeline starting with URI {uri:?}");
pass_pair(off.jrpc(), uri).await
})
}
pub async fn pass_pair(
jrpc: impl Pair<Value, JrpcRequest> + Unpin + 'static,
uri: Uri,
) -> Result<(), FatalErr> {
let client = jrpc_client(uri, None).await?;
let res = connect(client, jrpc).await;
tracing::debug!("pass pipeline exiting with {res:?}");
res
}