(
&self,
request: tonic::Request<pb::OfferRequest>,
)
| 2486 | } |
| 2487 | |
| 2488 | async fn offer( |
| 2489 | &self, |
| 2490 | request: tonic::Request<pb::OfferRequest>, |
| 2491 | ) -> Result<tonic::Response<pb::OfferResponse>, tonic::Status> { |
| 2492 | let req = request.into_inner(); |
| 2493 | let req: requests::OfferRequest = req.try_into()?; |
| 2494 | debug!("Client asked for offer"); |
| 2495 | trace!("offer request: {:?}", req); |
| 2496 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 2497 | .await |
| 2498 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 2499 | let result = rpc.call(Request::Offer(req)) |
| 2500 | .await |
| 2501 | .map_err(|e| Status::new( |
| 2502 | Code::Unknown, |
| 2503 | format!("Error calling method Offer: {:?}", e)))?; |
| 2504 | match result { |
| 2505 | Response::Offer(r) => { |
| 2506 | trace!("offer response: {:?}", r); |
| 2507 | Ok(tonic::Response::new(r.into())) |
| 2508 | }, |
| 2509 | r => Err(Status::new( |
| 2510 | Code::Internal, |
| 2511 | format!( |
| 2512 | "Unexpected result {:?} to method call Offer", |
| 2513 | r |
| 2514 | ) |
| 2515 | )), |
| 2516 | } |
| 2517 | |
| 2518 | } |
| 2519 | |
| 2520 | async fn open_channel_abort( |
| 2521 | &self, |
nothing calls this directly
no test coverage detected