MCPcopy Create free account
hub / github.com/ElementsProject/lightning / call_raw

Function call_raw

cln-rpc/src/test.rs:69–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67
68#[tokio::test]
69async fn call_raw() {
70 let req = serde_json::json!({});
71 let (uds1, uds2) = UnixStream::pair().unwrap();
72 let mut cln = ClnRpc::from_stream(uds1).unwrap();
73
74 let mut read = FramedRead::new(uds2, JsonCodec::default());
75 tokio::task::spawn(async move {
76 let _: serde_json::Value = cln.call_raw("getinfo", &req).await.unwrap();
77 });
78
79 let read_req = dbg!(read.next().await.unwrap().unwrap());
80
81 assert_eq!(
82 json!({"id": 1, "method": "getinfo", "params": {}, "jsonrpc": "2.0"}),
83 read_req
84 );
85}
86
87#[tokio::test]
88async fn test_call_enum_remote_error() {

Callers

nothing calls this directly

Calls 2

call_rawMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected