(
&self,
request: tonic::Request<pb::CreateonionRequest>,
)
| 563 | } |
| 564 | |
| 565 | async fn create_onion( |
| 566 | &self, |
| 567 | request: tonic::Request<pb::CreateonionRequest>, |
| 568 | ) -> Result<tonic::Response<pb::CreateonionResponse>, tonic::Status> { |
| 569 | let req = request.into_inner(); |
| 570 | let req: requests::CreateonionRequest = req.try_into()?; |
| 571 | debug!("Client asked for create_onion"); |
| 572 | trace!("create_onion request: {:?}", req); |
| 573 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 574 | .await |
| 575 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 576 | let result = rpc.call(Request::CreateOnion(req)) |
| 577 | .await |
| 578 | .map_err(|e| Status::new( |
| 579 | Code::Unknown, |
| 580 | format!("Error calling method CreateOnion: {:?}", e)))?; |
| 581 | match result { |
| 582 | Response::CreateOnion(r) => { |
| 583 | trace!("create_onion response: {:?}", r); |
| 584 | Ok(tonic::Response::new(r.into())) |
| 585 | }, |
| 586 | r => Err(Status::new( |
| 587 | Code::Internal, |
| 588 | format!( |
| 589 | "Unexpected result {:?} to method call CreateOnion", |
| 590 | r |
| 591 | ) |
| 592 | )), |
| 593 | } |
| 594 | |
| 595 | } |
| 596 | |
| 597 | async fn del_datastore( |
| 598 | &self, |
nothing calls this directly
no test coverage detected