| 134 | |
| 135 | #[tokio::test] |
| 136 | async fn test_call() { |
| 137 | let req = Request::Getinfo(requests::GetinfoRequest {}); |
| 138 | let (uds1, uds2) = UnixStream::pair().unwrap(); |
| 139 | let mut cln = ClnRpc::from_stream(uds1).unwrap(); |
| 140 | |
| 141 | let mut read = FramedRead::new(uds2, JsonCodec::default()); |
| 142 | tokio::task::spawn(async move { |
| 143 | cln.call(req).await.unwrap(); |
| 144 | }); |
| 145 | |
| 146 | let read_req = dbg!(read.next().await.unwrap().unwrap()); |
| 147 | |
| 148 | assert_eq!( |
| 149 | json!({"id": "1", "method": "getinfo", "params": {}, "jsonrpc": "2.0"}), |
| 150 | read_req |
| 151 | ); |
| 152 | } |
| 153 | |
| 154 | #[tokio::test] |
| 155 | async fn test_typed_call() { |