1pub mod vm_client {
4 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
5 use tonic::codegen::*;
6 use tonic::codegen::http::Uri;
7 #[derive(Debug, Clone)]
8 pub struct VmClient<T> {
9 inner: tonic::client::Grpc<T>,
10 }
11 impl VmClient<tonic::transport::Channel> {
12 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14 where
15 D: std::convert::TryInto<tonic::transport::Endpoint>,
16 D::Error: Into<StdError>,
17 {
18 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
19 Ok(Self::new(conn))
20 }
21 }
22 impl<T> VmClient<T>
23 where
24 T: tonic::client::GrpcService<tonic::body::BoxBody>,
25 T::Error: Into<StdError>,
26 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
27 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
28 {
29 pub fn new(inner: T) -> Self {
30 let inner = tonic::client::Grpc::new(inner);
31 Self { inner }
32 }
33 pub fn with_origin(inner: T, origin: Uri) -> Self {
34 let inner = tonic::client::Grpc::with_origin(inner, origin);
35 Self { inner }
36 }
37 pub fn with_interceptor<F>(
38 inner: T,
39 interceptor: F,
40 ) -> VmClient<InterceptedService<T, F>>
41 where
42 F: tonic::service::Interceptor,
43 T::ResponseBody: Default,
44 T: tonic::codegen::Service<
45 http::Request<tonic::body::BoxBody>,
46 Response = http::Response<
47 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
48 >,
49 >,
50 <T as tonic::codegen::Service<
51 http::Request<tonic::body::BoxBody>,
52 >>::Error: Into<StdError> + Send + Sync,
53 {
54 VmClient::new(InterceptedService::new(inner, interceptor))
55 }
56 #[must_use]
61 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
62 self.inner = self.inner.send_compressed(encoding);
63 self
64 }
65 #[must_use]
67 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
68 self.inner = self.inner.accept_compressed(encoding);
69 self
70 }
71 pub async fn initialize(
72 &mut self,
73 request: impl tonic::IntoRequest<super::InitializeRequest>,
74 ) -> Result<tonic::Response<super::InitializeResponse>, tonic::Status> {
75 self.inner
76 .ready()
77 .await
78 .map_err(|e| {
79 tonic::Status::new(
80 tonic::Code::Unknown,
81 format!("Service was not ready: {}", e.into()),
82 )
83 })?;
84 let codec = tonic::codec::ProstCodec::default();
85 let path = http::uri::PathAndQuery::from_static("/vm.VM/Initialize");
86 self.inner.unary(request.into_request(), path, codec).await
87 }
88 pub async fn set_state(
89 &mut self,
90 request: impl tonic::IntoRequest<super::SetStateRequest>,
91 ) -> Result<tonic::Response<super::SetStateResponse>, tonic::Status> {
92 self.inner
93 .ready()
94 .await
95 .map_err(|e| {
96 tonic::Status::new(
97 tonic::Code::Unknown,
98 format!("Service was not ready: {}", e.into()),
99 )
100 })?;
101 let codec = tonic::codec::ProstCodec::default();
102 let path = http::uri::PathAndQuery::from_static("/vm.VM/SetState");
103 self.inner.unary(request.into_request(), path, codec).await
104 }
105 pub async fn shutdown(
106 &mut self,
107 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
108 ) -> Result<
109 tonic::Response<super::super::google::protobuf::Empty>,
110 tonic::Status,
111 > {
112 self.inner
113 .ready()
114 .await
115 .map_err(|e| {
116 tonic::Status::new(
117 tonic::Code::Unknown,
118 format!("Service was not ready: {}", e.into()),
119 )
120 })?;
121 let codec = tonic::codec::ProstCodec::default();
122 let path = http::uri::PathAndQuery::from_static("/vm.VM/Shutdown");
123 self.inner.unary(request.into_request(), path, codec).await
124 }
125 pub async fn create_handlers(
126 &mut self,
127 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
128 ) -> Result<tonic::Response<super::CreateHandlersResponse>, tonic::Status> {
129 self.inner
130 .ready()
131 .await
132 .map_err(|e| {
133 tonic::Status::new(
134 tonic::Code::Unknown,
135 format!("Service was not ready: {}", e.into()),
136 )
137 })?;
138 let codec = tonic::codec::ProstCodec::default();
139 let path = http::uri::PathAndQuery::from_static("/vm.VM/CreateHandlers");
140 self.inner.unary(request.into_request(), path, codec).await
141 }
142 pub async fn create_static_handlers(
143 &mut self,
144 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
145 ) -> Result<
146 tonic::Response<super::CreateStaticHandlersResponse>,
147 tonic::Status,
148 > {
149 self.inner
150 .ready()
151 .await
152 .map_err(|e| {
153 tonic::Status::new(
154 tonic::Code::Unknown,
155 format!("Service was not ready: {}", e.into()),
156 )
157 })?;
158 let codec = tonic::codec::ProstCodec::default();
159 let path = http::uri::PathAndQuery::from_static(
160 "/vm.VM/CreateStaticHandlers",
161 );
162 self.inner.unary(request.into_request(), path, codec).await
163 }
164 pub async fn connected(
165 &mut self,
166 request: impl tonic::IntoRequest<super::ConnectedRequest>,
167 ) -> Result<
168 tonic::Response<super::super::google::protobuf::Empty>,
169 tonic::Status,
170 > {
171 self.inner
172 .ready()
173 .await
174 .map_err(|e| {
175 tonic::Status::new(
176 tonic::Code::Unknown,
177 format!("Service was not ready: {}", e.into()),
178 )
179 })?;
180 let codec = tonic::codec::ProstCodec::default();
181 let path = http::uri::PathAndQuery::from_static("/vm.VM/Connected");
182 self.inner.unary(request.into_request(), path, codec).await
183 }
184 pub async fn disconnected(
185 &mut self,
186 request: impl tonic::IntoRequest<super::DisconnectedRequest>,
187 ) -> Result<
188 tonic::Response<super::super::google::protobuf::Empty>,
189 tonic::Status,
190 > {
191 self.inner
192 .ready()
193 .await
194 .map_err(|e| {
195 tonic::Status::new(
196 tonic::Code::Unknown,
197 format!("Service was not ready: {}", e.into()),
198 )
199 })?;
200 let codec = tonic::codec::ProstCodec::default();
201 let path = http::uri::PathAndQuery::from_static("/vm.VM/Disconnected");
202 self.inner.unary(request.into_request(), path, codec).await
203 }
204 pub async fn build_block(
205 &mut self,
206 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
207 ) -> Result<tonic::Response<super::BuildBlockResponse>, tonic::Status> {
208 self.inner
209 .ready()
210 .await
211 .map_err(|e| {
212 tonic::Status::new(
213 tonic::Code::Unknown,
214 format!("Service was not ready: {}", e.into()),
215 )
216 })?;
217 let codec = tonic::codec::ProstCodec::default();
218 let path = http::uri::PathAndQuery::from_static("/vm.VM/BuildBlock");
219 self.inner.unary(request.into_request(), path, codec).await
220 }
221 pub async fn parse_block(
222 &mut self,
223 request: impl tonic::IntoRequest<super::ParseBlockRequest>,
224 ) -> Result<tonic::Response<super::ParseBlockResponse>, tonic::Status> {
225 self.inner
226 .ready()
227 .await
228 .map_err(|e| {
229 tonic::Status::new(
230 tonic::Code::Unknown,
231 format!("Service was not ready: {}", e.into()),
232 )
233 })?;
234 let codec = tonic::codec::ProstCodec::default();
235 let path = http::uri::PathAndQuery::from_static("/vm.VM/ParseBlock");
236 self.inner.unary(request.into_request(), path, codec).await
237 }
238 pub async fn get_block(
239 &mut self,
240 request: impl tonic::IntoRequest<super::GetBlockRequest>,
241 ) -> Result<tonic::Response<super::GetBlockResponse>, tonic::Status> {
242 self.inner
243 .ready()
244 .await
245 .map_err(|e| {
246 tonic::Status::new(
247 tonic::Code::Unknown,
248 format!("Service was not ready: {}", e.into()),
249 )
250 })?;
251 let codec = tonic::codec::ProstCodec::default();
252 let path = http::uri::PathAndQuery::from_static("/vm.VM/GetBlock");
253 self.inner.unary(request.into_request(), path, codec).await
254 }
255 pub async fn set_preference(
256 &mut self,
257 request: impl tonic::IntoRequest<super::SetPreferenceRequest>,
258 ) -> Result<
259 tonic::Response<super::super::google::protobuf::Empty>,
260 tonic::Status,
261 > {
262 self.inner
263 .ready()
264 .await
265 .map_err(|e| {
266 tonic::Status::new(
267 tonic::Code::Unknown,
268 format!("Service was not ready: {}", e.into()),
269 )
270 })?;
271 let codec = tonic::codec::ProstCodec::default();
272 let path = http::uri::PathAndQuery::from_static("/vm.VM/SetPreference");
273 self.inner.unary(request.into_request(), path, codec).await
274 }
275 pub async fn health(
276 &mut self,
277 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
278 ) -> Result<tonic::Response<super::HealthResponse>, tonic::Status> {
279 self.inner
280 .ready()
281 .await
282 .map_err(|e| {
283 tonic::Status::new(
284 tonic::Code::Unknown,
285 format!("Service was not ready: {}", e.into()),
286 )
287 })?;
288 let codec = tonic::codec::ProstCodec::default();
289 let path = http::uri::PathAndQuery::from_static("/vm.VM/Health");
290 self.inner.unary(request.into_request(), path, codec).await
291 }
292 pub async fn version(
293 &mut self,
294 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
295 ) -> Result<tonic::Response<super::VersionResponse>, tonic::Status> {
296 self.inner
297 .ready()
298 .await
299 .map_err(|e| {
300 tonic::Status::new(
301 tonic::Code::Unknown,
302 format!("Service was not ready: {}", e.into()),
303 )
304 })?;
305 let codec = tonic::codec::ProstCodec::default();
306 let path = http::uri::PathAndQuery::from_static("/vm.VM/Version");
307 self.inner.unary(request.into_request(), path, codec).await
308 }
309 pub async fn app_request(
310 &mut self,
311 request: impl tonic::IntoRequest<super::AppRequestMsg>,
312 ) -> Result<
313 tonic::Response<super::super::google::protobuf::Empty>,
314 tonic::Status,
315 > {
316 self.inner
317 .ready()
318 .await
319 .map_err(|e| {
320 tonic::Status::new(
321 tonic::Code::Unknown,
322 format!("Service was not ready: {}", e.into()),
323 )
324 })?;
325 let codec = tonic::codec::ProstCodec::default();
326 let path = http::uri::PathAndQuery::from_static("/vm.VM/AppRequest");
327 self.inner.unary(request.into_request(), path, codec).await
328 }
329 pub async fn app_request_failed(
330 &mut self,
331 request: impl tonic::IntoRequest<super::AppRequestFailedMsg>,
332 ) -> Result<
333 tonic::Response<super::super::google::protobuf::Empty>,
334 tonic::Status,
335 > {
336 self.inner
337 .ready()
338 .await
339 .map_err(|e| {
340 tonic::Status::new(
341 tonic::Code::Unknown,
342 format!("Service was not ready: {}", e.into()),
343 )
344 })?;
345 let codec = tonic::codec::ProstCodec::default();
346 let path = http::uri::PathAndQuery::from_static("/vm.VM/AppRequestFailed");
347 self.inner.unary(request.into_request(), path, codec).await
348 }
349 pub async fn app_response(
350 &mut self,
351 request: impl tonic::IntoRequest<super::AppResponseMsg>,
352 ) -> Result<
353 tonic::Response<super::super::google::protobuf::Empty>,
354 tonic::Status,
355 > {
356 self.inner
357 .ready()
358 .await
359 .map_err(|e| {
360 tonic::Status::new(
361 tonic::Code::Unknown,
362 format!("Service was not ready: {}", e.into()),
363 )
364 })?;
365 let codec = tonic::codec::ProstCodec::default();
366 let path = http::uri::PathAndQuery::from_static("/vm.VM/AppResponse");
367 self.inner.unary(request.into_request(), path, codec).await
368 }
369 pub async fn app_gossip(
370 &mut self,
371 request: impl tonic::IntoRequest<super::AppGossipMsg>,
372 ) -> Result<
373 tonic::Response<super::super::google::protobuf::Empty>,
374 tonic::Status,
375 > {
376 self.inner
377 .ready()
378 .await
379 .map_err(|e| {
380 tonic::Status::new(
381 tonic::Code::Unknown,
382 format!("Service was not ready: {}", e.into()),
383 )
384 })?;
385 let codec = tonic::codec::ProstCodec::default();
386 let path = http::uri::PathAndQuery::from_static("/vm.VM/AppGossip");
387 self.inner.unary(request.into_request(), path, codec).await
388 }
389 pub async fn gather(
390 &mut self,
391 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
392 ) -> Result<tonic::Response<super::GatherResponse>, tonic::Status> {
393 self.inner
394 .ready()
395 .await
396 .map_err(|e| {
397 tonic::Status::new(
398 tonic::Code::Unknown,
399 format!("Service was not ready: {}", e.into()),
400 )
401 })?;
402 let codec = tonic::codec::ProstCodec::default();
403 let path = http::uri::PathAndQuery::from_static("/vm.VM/Gather");
404 self.inner.unary(request.into_request(), path, codec).await
405 }
406 pub async fn cross_chain_app_request(
407 &mut self,
408 request: impl tonic::IntoRequest<super::CrossChainAppRequestMsg>,
409 ) -> Result<
410 tonic::Response<super::super::google::protobuf::Empty>,
411 tonic::Status,
412 > {
413 self.inner
414 .ready()
415 .await
416 .map_err(|e| {
417 tonic::Status::new(
418 tonic::Code::Unknown,
419 format!("Service was not ready: {}", e.into()),
420 )
421 })?;
422 let codec = tonic::codec::ProstCodec::default();
423 let path = http::uri::PathAndQuery::from_static(
424 "/vm.VM/CrossChainAppRequest",
425 );
426 self.inner.unary(request.into_request(), path, codec).await
427 }
428 pub async fn cross_chain_app_request_failed(
429 &mut self,
430 request: impl tonic::IntoRequest<super::CrossChainAppRequestFailedMsg>,
431 ) -> Result<
432 tonic::Response<super::super::google::protobuf::Empty>,
433 tonic::Status,
434 > {
435 self.inner
436 .ready()
437 .await
438 .map_err(|e| {
439 tonic::Status::new(
440 tonic::Code::Unknown,
441 format!("Service was not ready: {}", e.into()),
442 )
443 })?;
444 let codec = tonic::codec::ProstCodec::default();
445 let path = http::uri::PathAndQuery::from_static(
446 "/vm.VM/CrossChainAppRequestFailed",
447 );
448 self.inner.unary(request.into_request(), path, codec).await
449 }
450 pub async fn cross_chain_app_response(
451 &mut self,
452 request: impl tonic::IntoRequest<super::CrossChainAppResponseMsg>,
453 ) -> Result<
454 tonic::Response<super::super::google::protobuf::Empty>,
455 tonic::Status,
456 > {
457 self.inner
458 .ready()
459 .await
460 .map_err(|e| {
461 tonic::Status::new(
462 tonic::Code::Unknown,
463 format!("Service was not ready: {}", e.into()),
464 )
465 })?;
466 let codec = tonic::codec::ProstCodec::default();
467 let path = http::uri::PathAndQuery::from_static(
468 "/vm.VM/CrossChainAppResponse",
469 );
470 self.inner.unary(request.into_request(), path, codec).await
471 }
472 pub async fn get_ancestors(
473 &mut self,
474 request: impl tonic::IntoRequest<super::GetAncestorsRequest>,
475 ) -> Result<tonic::Response<super::GetAncestorsResponse>, tonic::Status> {
476 self.inner
477 .ready()
478 .await
479 .map_err(|e| {
480 tonic::Status::new(
481 tonic::Code::Unknown,
482 format!("Service was not ready: {}", e.into()),
483 )
484 })?;
485 let codec = tonic::codec::ProstCodec::default();
486 let path = http::uri::PathAndQuery::from_static("/vm.VM/GetAncestors");
487 self.inner.unary(request.into_request(), path, codec).await
488 }
489 pub async fn batched_parse_block(
490 &mut self,
491 request: impl tonic::IntoRequest<super::BatchedParseBlockRequest>,
492 ) -> Result<tonic::Response<super::BatchedParseBlockResponse>, tonic::Status> {
493 self.inner
494 .ready()
495 .await
496 .map_err(|e| {
497 tonic::Status::new(
498 tonic::Code::Unknown,
499 format!("Service was not ready: {}", e.into()),
500 )
501 })?;
502 let codec = tonic::codec::ProstCodec::default();
503 let path = http::uri::PathAndQuery::from_static("/vm.VM/BatchedParseBlock");
504 self.inner.unary(request.into_request(), path, codec).await
505 }
506 pub async fn verify_height_index(
507 &mut self,
508 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
509 ) -> Result<tonic::Response<super::VerifyHeightIndexResponse>, tonic::Status> {
510 self.inner
511 .ready()
512 .await
513 .map_err(|e| {
514 tonic::Status::new(
515 tonic::Code::Unknown,
516 format!("Service was not ready: {}", e.into()),
517 )
518 })?;
519 let codec = tonic::codec::ProstCodec::default();
520 let path = http::uri::PathAndQuery::from_static("/vm.VM/VerifyHeightIndex");
521 self.inner.unary(request.into_request(), path, codec).await
522 }
523 pub async fn get_block_id_at_height(
524 &mut self,
525 request: impl tonic::IntoRequest<super::GetBlockIdAtHeightRequest>,
526 ) -> Result<tonic::Response<super::GetBlockIdAtHeightResponse>, tonic::Status> {
527 self.inner
528 .ready()
529 .await
530 .map_err(|e| {
531 tonic::Status::new(
532 tonic::Code::Unknown,
533 format!("Service was not ready: {}", e.into()),
534 )
535 })?;
536 let codec = tonic::codec::ProstCodec::default();
537 let path = http::uri::PathAndQuery::from_static("/vm.VM/GetBlockIDAtHeight");
538 self.inner.unary(request.into_request(), path, codec).await
539 }
540 pub async fn state_sync_enabled(
541 &mut self,
542 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
543 ) -> Result<tonic::Response<super::StateSyncEnabledResponse>, tonic::Status> {
544 self.inner
545 .ready()
546 .await
547 .map_err(|e| {
548 tonic::Status::new(
549 tonic::Code::Unknown,
550 format!("Service was not ready: {}", e.into()),
551 )
552 })?;
553 let codec = tonic::codec::ProstCodec::default();
554 let path = http::uri::PathAndQuery::from_static("/vm.VM/StateSyncEnabled");
555 self.inner.unary(request.into_request(), path, codec).await
556 }
557 pub async fn get_ongoing_sync_state_summary(
558 &mut self,
559 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
560 ) -> Result<
561 tonic::Response<super::GetOngoingSyncStateSummaryResponse>,
562 tonic::Status,
563 > {
564 self.inner
565 .ready()
566 .await
567 .map_err(|e| {
568 tonic::Status::new(
569 tonic::Code::Unknown,
570 format!("Service was not ready: {}", e.into()),
571 )
572 })?;
573 let codec = tonic::codec::ProstCodec::default();
574 let path = http::uri::PathAndQuery::from_static(
575 "/vm.VM/GetOngoingSyncStateSummary",
576 );
577 self.inner.unary(request.into_request(), path, codec).await
578 }
579 pub async fn get_last_state_summary(
580 &mut self,
581 request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
582 ) -> Result<tonic::Response<super::GetLastStateSummaryResponse>, tonic::Status> {
583 self.inner
584 .ready()
585 .await
586 .map_err(|e| {
587 tonic::Status::new(
588 tonic::Code::Unknown,
589 format!("Service was not ready: {}", e.into()),
590 )
591 })?;
592 let codec = tonic::codec::ProstCodec::default();
593 let path = http::uri::PathAndQuery::from_static(
594 "/vm.VM/GetLastStateSummary",
595 );
596 self.inner.unary(request.into_request(), path, codec).await
597 }
598 pub async fn parse_state_summary(
599 &mut self,
600 request: impl tonic::IntoRequest<super::ParseStateSummaryRequest>,
601 ) -> Result<tonic::Response<super::ParseStateSummaryResponse>, tonic::Status> {
602 self.inner
603 .ready()
604 .await
605 .map_err(|e| {
606 tonic::Status::new(
607 tonic::Code::Unknown,
608 format!("Service was not ready: {}", e.into()),
609 )
610 })?;
611 let codec = tonic::codec::ProstCodec::default();
612 let path = http::uri::PathAndQuery::from_static("/vm.VM/ParseStateSummary");
613 self.inner.unary(request.into_request(), path, codec).await
614 }
615 pub async fn get_state_summary(
616 &mut self,
617 request: impl tonic::IntoRequest<super::GetStateSummaryRequest>,
618 ) -> Result<tonic::Response<super::GetStateSummaryResponse>, tonic::Status> {
619 self.inner
620 .ready()
621 .await
622 .map_err(|e| {
623 tonic::Status::new(
624 tonic::Code::Unknown,
625 format!("Service was not ready: {}", e.into()),
626 )
627 })?;
628 let codec = tonic::codec::ProstCodec::default();
629 let path = http::uri::PathAndQuery::from_static("/vm.VM/GetStateSummary");
630 self.inner.unary(request.into_request(), path, codec).await
631 }
632 pub async fn block_verify(
633 &mut self,
634 request: impl tonic::IntoRequest<super::BlockVerifyRequest>,
635 ) -> Result<tonic::Response<super::BlockVerifyResponse>, tonic::Status> {
636 self.inner
637 .ready()
638 .await
639 .map_err(|e| {
640 tonic::Status::new(
641 tonic::Code::Unknown,
642 format!("Service was not ready: {}", e.into()),
643 )
644 })?;
645 let codec = tonic::codec::ProstCodec::default();
646 let path = http::uri::PathAndQuery::from_static("/vm.VM/BlockVerify");
647 self.inner.unary(request.into_request(), path, codec).await
648 }
649 pub async fn block_accept(
650 &mut self,
651 request: impl tonic::IntoRequest<super::BlockAcceptRequest>,
652 ) -> Result<
653 tonic::Response<super::super::google::protobuf::Empty>,
654 tonic::Status,
655 > {
656 self.inner
657 .ready()
658 .await
659 .map_err(|e| {
660 tonic::Status::new(
661 tonic::Code::Unknown,
662 format!("Service was not ready: {}", e.into()),
663 )
664 })?;
665 let codec = tonic::codec::ProstCodec::default();
666 let path = http::uri::PathAndQuery::from_static("/vm.VM/BlockAccept");
667 self.inner.unary(request.into_request(), path, codec).await
668 }
669 pub async fn block_reject(
670 &mut self,
671 request: impl tonic::IntoRequest<super::BlockRejectRequest>,
672 ) -> Result<
673 tonic::Response<super::super::google::protobuf::Empty>,
674 tonic::Status,
675 > {
676 self.inner
677 .ready()
678 .await
679 .map_err(|e| {
680 tonic::Status::new(
681 tonic::Code::Unknown,
682 format!("Service was not ready: {}", e.into()),
683 )
684 })?;
685 let codec = tonic::codec::ProstCodec::default();
686 let path = http::uri::PathAndQuery::from_static("/vm.VM/BlockReject");
687 self.inner.unary(request.into_request(), path, codec).await
688 }
689 pub async fn state_summary_accept(
690 &mut self,
691 request: impl tonic::IntoRequest<super::StateSummaryAcceptRequest>,
692 ) -> Result<tonic::Response<super::StateSummaryAcceptResponse>, tonic::Status> {
693 self.inner
694 .ready()
695 .await
696 .map_err(|e| {
697 tonic::Status::new(
698 tonic::Code::Unknown,
699 format!("Service was not ready: {}", e.into()),
700 )
701 })?;
702 let codec = tonic::codec::ProstCodec::default();
703 let path = http::uri::PathAndQuery::from_static("/vm.VM/StateSummaryAccept");
704 self.inner.unary(request.into_request(), path, codec).await
705 }
706 }
707}
708pub mod vm_server {
710 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
711 use tonic::codegen::*;
712 #[async_trait]
714 pub trait Vm: Send + Sync + 'static {
715 async fn initialize(
716 &self,
717 request: tonic::Request<super::InitializeRequest>,
718 ) -> Result<tonic::Response<super::InitializeResponse>, tonic::Status>;
719 async fn set_state(
720 &self,
721 request: tonic::Request<super::SetStateRequest>,
722 ) -> Result<tonic::Response<super::SetStateResponse>, tonic::Status>;
723 async fn shutdown(
724 &self,
725 request: tonic::Request<super::super::google::protobuf::Empty>,
726 ) -> Result<
727 tonic::Response<super::super::google::protobuf::Empty>,
728 tonic::Status,
729 >;
730 async fn create_handlers(
731 &self,
732 request: tonic::Request<super::super::google::protobuf::Empty>,
733 ) -> Result<tonic::Response<super::CreateHandlersResponse>, tonic::Status>;
734 async fn create_static_handlers(
735 &self,
736 request: tonic::Request<super::super::google::protobuf::Empty>,
737 ) -> Result<tonic::Response<super::CreateStaticHandlersResponse>, tonic::Status>;
738 async fn connected(
739 &self,
740 request: tonic::Request<super::ConnectedRequest>,
741 ) -> Result<
742 tonic::Response<super::super::google::protobuf::Empty>,
743 tonic::Status,
744 >;
745 async fn disconnected(
746 &self,
747 request: tonic::Request<super::DisconnectedRequest>,
748 ) -> Result<
749 tonic::Response<super::super::google::protobuf::Empty>,
750 tonic::Status,
751 >;
752 async fn build_block(
753 &self,
754 request: tonic::Request<super::super::google::protobuf::Empty>,
755 ) -> Result<tonic::Response<super::BuildBlockResponse>, tonic::Status>;
756 async fn parse_block(
757 &self,
758 request: tonic::Request<super::ParseBlockRequest>,
759 ) -> Result<tonic::Response<super::ParseBlockResponse>, tonic::Status>;
760 async fn get_block(
761 &self,
762 request: tonic::Request<super::GetBlockRequest>,
763 ) -> Result<tonic::Response<super::GetBlockResponse>, tonic::Status>;
764 async fn set_preference(
765 &self,
766 request: tonic::Request<super::SetPreferenceRequest>,
767 ) -> Result<
768 tonic::Response<super::super::google::protobuf::Empty>,
769 tonic::Status,
770 >;
771 async fn health(
772 &self,
773 request: tonic::Request<super::super::google::protobuf::Empty>,
774 ) -> Result<tonic::Response<super::HealthResponse>, tonic::Status>;
775 async fn version(
776 &self,
777 request: tonic::Request<super::super::google::protobuf::Empty>,
778 ) -> Result<tonic::Response<super::VersionResponse>, tonic::Status>;
779 async fn app_request(
780 &self,
781 request: tonic::Request<super::AppRequestMsg>,
782 ) -> Result<
783 tonic::Response<super::super::google::protobuf::Empty>,
784 tonic::Status,
785 >;
786 async fn app_request_failed(
787 &self,
788 request: tonic::Request<super::AppRequestFailedMsg>,
789 ) -> Result<
790 tonic::Response<super::super::google::protobuf::Empty>,
791 tonic::Status,
792 >;
793 async fn app_response(
794 &self,
795 request: tonic::Request<super::AppResponseMsg>,
796 ) -> Result<
797 tonic::Response<super::super::google::protobuf::Empty>,
798 tonic::Status,
799 >;
800 async fn app_gossip(
801 &self,
802 request: tonic::Request<super::AppGossipMsg>,
803 ) -> Result<
804 tonic::Response<super::super::google::protobuf::Empty>,
805 tonic::Status,
806 >;
807 async fn gather(
808 &self,
809 request: tonic::Request<super::super::google::protobuf::Empty>,
810 ) -> Result<tonic::Response<super::GatherResponse>, tonic::Status>;
811 async fn cross_chain_app_request(
812 &self,
813 request: tonic::Request<super::CrossChainAppRequestMsg>,
814 ) -> Result<
815 tonic::Response<super::super::google::protobuf::Empty>,
816 tonic::Status,
817 >;
818 async fn cross_chain_app_request_failed(
819 &self,
820 request: tonic::Request<super::CrossChainAppRequestFailedMsg>,
821 ) -> Result<
822 tonic::Response<super::super::google::protobuf::Empty>,
823 tonic::Status,
824 >;
825 async fn cross_chain_app_response(
826 &self,
827 request: tonic::Request<super::CrossChainAppResponseMsg>,
828 ) -> Result<
829 tonic::Response<super::super::google::protobuf::Empty>,
830 tonic::Status,
831 >;
832 async fn get_ancestors(
833 &self,
834 request: tonic::Request<super::GetAncestorsRequest>,
835 ) -> Result<tonic::Response<super::GetAncestorsResponse>, tonic::Status>;
836 async fn batched_parse_block(
837 &self,
838 request: tonic::Request<super::BatchedParseBlockRequest>,
839 ) -> Result<tonic::Response<super::BatchedParseBlockResponse>, tonic::Status>;
840 async fn verify_height_index(
841 &self,
842 request: tonic::Request<super::super::google::protobuf::Empty>,
843 ) -> Result<tonic::Response<super::VerifyHeightIndexResponse>, tonic::Status>;
844 async fn get_block_id_at_height(
845 &self,
846 request: tonic::Request<super::GetBlockIdAtHeightRequest>,
847 ) -> Result<tonic::Response<super::GetBlockIdAtHeightResponse>, tonic::Status>;
848 async fn state_sync_enabled(
849 &self,
850 request: tonic::Request<super::super::google::protobuf::Empty>,
851 ) -> Result<tonic::Response<super::StateSyncEnabledResponse>, tonic::Status>;
852 async fn get_ongoing_sync_state_summary(
853 &self,
854 request: tonic::Request<super::super::google::protobuf::Empty>,
855 ) -> Result<
856 tonic::Response<super::GetOngoingSyncStateSummaryResponse>,
857 tonic::Status,
858 >;
859 async fn get_last_state_summary(
860 &self,
861 request: tonic::Request<super::super::google::protobuf::Empty>,
862 ) -> Result<tonic::Response<super::GetLastStateSummaryResponse>, tonic::Status>;
863 async fn parse_state_summary(
864 &self,
865 request: tonic::Request<super::ParseStateSummaryRequest>,
866 ) -> Result<tonic::Response<super::ParseStateSummaryResponse>, tonic::Status>;
867 async fn get_state_summary(
868 &self,
869 request: tonic::Request<super::GetStateSummaryRequest>,
870 ) -> Result<tonic::Response<super::GetStateSummaryResponse>, tonic::Status>;
871 async fn block_verify(
872 &self,
873 request: tonic::Request<super::BlockVerifyRequest>,
874 ) -> Result<tonic::Response<super::BlockVerifyResponse>, tonic::Status>;
875 async fn block_accept(
876 &self,
877 request: tonic::Request<super::BlockAcceptRequest>,
878 ) -> Result<
879 tonic::Response<super::super::google::protobuf::Empty>,
880 tonic::Status,
881 >;
882 async fn block_reject(
883 &self,
884 request: tonic::Request<super::BlockRejectRequest>,
885 ) -> Result<
886 tonic::Response<super::super::google::protobuf::Empty>,
887 tonic::Status,
888 >;
889 async fn state_summary_accept(
890 &self,
891 request: tonic::Request<super::StateSummaryAcceptRequest>,
892 ) -> Result<tonic::Response<super::StateSummaryAcceptResponse>, tonic::Status>;
893 }
894 #[derive(Debug)]
895 pub struct VmServer<T: Vm> {
896 inner: _Inner<T>,
897 accept_compression_encodings: EnabledCompressionEncodings,
898 send_compression_encodings: EnabledCompressionEncodings,
899 }
900 struct _Inner<T>(Arc<T>);
901 impl<T: Vm> VmServer<T> {
902 pub fn new(inner: T) -> Self {
903 Self::from_arc(Arc::new(inner))
904 }
905 pub fn from_arc(inner: Arc<T>) -> Self {
906 let inner = _Inner(inner);
907 Self {
908 inner,
909 accept_compression_encodings: Default::default(),
910 send_compression_encodings: Default::default(),
911 }
912 }
913 pub fn with_interceptor<F>(
914 inner: T,
915 interceptor: F,
916 ) -> InterceptedService<Self, F>
917 where
918 F: tonic::service::Interceptor,
919 {
920 InterceptedService::new(Self::new(inner), interceptor)
921 }
922 #[must_use]
924 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
925 self.accept_compression_encodings.enable(encoding);
926 self
927 }
928 #[must_use]
930 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
931 self.send_compression_encodings.enable(encoding);
932 self
933 }
934 }
935 impl<T, B> tonic::codegen::Service<http::Request<B>> for VmServer<T>
936 where
937 T: Vm,
938 B: Body + Send + 'static,
939 B::Error: Into<StdError> + Send + 'static,
940 {
941 type Response = http::Response<tonic::body::BoxBody>;
942 type Error = std::convert::Infallible;
943 type Future = BoxFuture<Self::Response, Self::Error>;
944 fn poll_ready(
945 &mut self,
946 _cx: &mut Context<'_>,
947 ) -> Poll<Result<(), Self::Error>> {
948 Poll::Ready(Ok(()))
949 }
950 fn call(&mut self, req: http::Request<B>) -> Self::Future {
951 let inner = self.inner.clone();
952 match req.uri().path() {
953 "/vm.VM/Initialize" => {
954 #[allow(non_camel_case_types)]
955 struct InitializeSvc<T: Vm>(pub Arc<T>);
956 impl<T: Vm> tonic::server::UnaryService<super::InitializeRequest>
957 for InitializeSvc<T> {
958 type Response = super::InitializeResponse;
959 type Future = BoxFuture<
960 tonic::Response<Self::Response>,
961 tonic::Status,
962 >;
963 fn call(
964 &mut self,
965 request: tonic::Request<super::InitializeRequest>,
966 ) -> Self::Future {
967 let inner = self.0.clone();
968 let fut = async move { (*inner).initialize(request).await };
969 Box::pin(fut)
970 }
971 }
972 let accept_compression_encodings = self.accept_compression_encodings;
973 let send_compression_encodings = self.send_compression_encodings;
974 let inner = self.inner.clone();
975 let fut = async move {
976 let inner = inner.0;
977 let method = InitializeSvc(inner);
978 let codec = tonic::codec::ProstCodec::default();
979 let mut grpc = tonic::server::Grpc::new(codec)
980 .apply_compression_config(
981 accept_compression_encodings,
982 send_compression_encodings,
983 );
984 let res = grpc.unary(method, req).await;
985 Ok(res)
986 };
987 Box::pin(fut)
988 }
989 "/vm.VM/SetState" => {
990 #[allow(non_camel_case_types)]
991 struct SetStateSvc<T: Vm>(pub Arc<T>);
992 impl<T: Vm> tonic::server::UnaryService<super::SetStateRequest>
993 for SetStateSvc<T> {
994 type Response = super::SetStateResponse;
995 type Future = BoxFuture<
996 tonic::Response<Self::Response>,
997 tonic::Status,
998 >;
999 fn call(
1000 &mut self,
1001 request: tonic::Request<super::SetStateRequest>,
1002 ) -> Self::Future {
1003 let inner = self.0.clone();
1004 let fut = async move { (*inner).set_state(request).await };
1005 Box::pin(fut)
1006 }
1007 }
1008 let accept_compression_encodings = self.accept_compression_encodings;
1009 let send_compression_encodings = self.send_compression_encodings;
1010 let inner = self.inner.clone();
1011 let fut = async move {
1012 let inner = inner.0;
1013 let method = SetStateSvc(inner);
1014 let codec = tonic::codec::ProstCodec::default();
1015 let mut grpc = tonic::server::Grpc::new(codec)
1016 .apply_compression_config(
1017 accept_compression_encodings,
1018 send_compression_encodings,
1019 );
1020 let res = grpc.unary(method, req).await;
1021 Ok(res)
1022 };
1023 Box::pin(fut)
1024 }
1025 "/vm.VM/Shutdown" => {
1026 #[allow(non_camel_case_types)]
1027 struct ShutdownSvc<T: Vm>(pub Arc<T>);
1028 impl<
1029 T: Vm,
1030 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1031 for ShutdownSvc<T> {
1032 type Response = super::super::google::protobuf::Empty;
1033 type Future = BoxFuture<
1034 tonic::Response<Self::Response>,
1035 tonic::Status,
1036 >;
1037 fn call(
1038 &mut self,
1039 request: tonic::Request<
1040 super::super::google::protobuf::Empty,
1041 >,
1042 ) -> Self::Future {
1043 let inner = self.0.clone();
1044 let fut = async move { (*inner).shutdown(request).await };
1045 Box::pin(fut)
1046 }
1047 }
1048 let accept_compression_encodings = self.accept_compression_encodings;
1049 let send_compression_encodings = self.send_compression_encodings;
1050 let inner = self.inner.clone();
1051 let fut = async move {
1052 let inner = inner.0;
1053 let method = ShutdownSvc(inner);
1054 let codec = tonic::codec::ProstCodec::default();
1055 let mut grpc = tonic::server::Grpc::new(codec)
1056 .apply_compression_config(
1057 accept_compression_encodings,
1058 send_compression_encodings,
1059 );
1060 let res = grpc.unary(method, req).await;
1061 Ok(res)
1062 };
1063 Box::pin(fut)
1064 }
1065 "/vm.VM/CreateHandlers" => {
1066 #[allow(non_camel_case_types)]
1067 struct CreateHandlersSvc<T: Vm>(pub Arc<T>);
1068 impl<
1069 T: Vm,
1070 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1071 for CreateHandlersSvc<T> {
1072 type Response = super::CreateHandlersResponse;
1073 type Future = BoxFuture<
1074 tonic::Response<Self::Response>,
1075 tonic::Status,
1076 >;
1077 fn call(
1078 &mut self,
1079 request: tonic::Request<
1080 super::super::google::protobuf::Empty,
1081 >,
1082 ) -> Self::Future {
1083 let inner = self.0.clone();
1084 let fut = async move {
1085 (*inner).create_handlers(request).await
1086 };
1087 Box::pin(fut)
1088 }
1089 }
1090 let accept_compression_encodings = self.accept_compression_encodings;
1091 let send_compression_encodings = self.send_compression_encodings;
1092 let inner = self.inner.clone();
1093 let fut = async move {
1094 let inner = inner.0;
1095 let method = CreateHandlersSvc(inner);
1096 let codec = tonic::codec::ProstCodec::default();
1097 let mut grpc = tonic::server::Grpc::new(codec)
1098 .apply_compression_config(
1099 accept_compression_encodings,
1100 send_compression_encodings,
1101 );
1102 let res = grpc.unary(method, req).await;
1103 Ok(res)
1104 };
1105 Box::pin(fut)
1106 }
1107 "/vm.VM/CreateStaticHandlers" => {
1108 #[allow(non_camel_case_types)]
1109 struct CreateStaticHandlersSvc<T: Vm>(pub Arc<T>);
1110 impl<
1111 T: Vm,
1112 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1113 for CreateStaticHandlersSvc<T> {
1114 type Response = super::CreateStaticHandlersResponse;
1115 type Future = BoxFuture<
1116 tonic::Response<Self::Response>,
1117 tonic::Status,
1118 >;
1119 fn call(
1120 &mut self,
1121 request: tonic::Request<
1122 super::super::google::protobuf::Empty,
1123 >,
1124 ) -> Self::Future {
1125 let inner = self.0.clone();
1126 let fut = async move {
1127 (*inner).create_static_handlers(request).await
1128 };
1129 Box::pin(fut)
1130 }
1131 }
1132 let accept_compression_encodings = self.accept_compression_encodings;
1133 let send_compression_encodings = self.send_compression_encodings;
1134 let inner = self.inner.clone();
1135 let fut = async move {
1136 let inner = inner.0;
1137 let method = CreateStaticHandlersSvc(inner);
1138 let codec = tonic::codec::ProstCodec::default();
1139 let mut grpc = tonic::server::Grpc::new(codec)
1140 .apply_compression_config(
1141 accept_compression_encodings,
1142 send_compression_encodings,
1143 );
1144 let res = grpc.unary(method, req).await;
1145 Ok(res)
1146 };
1147 Box::pin(fut)
1148 }
1149 "/vm.VM/Connected" => {
1150 #[allow(non_camel_case_types)]
1151 struct ConnectedSvc<T: Vm>(pub Arc<T>);
1152 impl<T: Vm> tonic::server::UnaryService<super::ConnectedRequest>
1153 for ConnectedSvc<T> {
1154 type Response = super::super::google::protobuf::Empty;
1155 type Future = BoxFuture<
1156 tonic::Response<Self::Response>,
1157 tonic::Status,
1158 >;
1159 fn call(
1160 &mut self,
1161 request: tonic::Request<super::ConnectedRequest>,
1162 ) -> Self::Future {
1163 let inner = self.0.clone();
1164 let fut = async move { (*inner).connected(request).await };
1165 Box::pin(fut)
1166 }
1167 }
1168 let accept_compression_encodings = self.accept_compression_encodings;
1169 let send_compression_encodings = self.send_compression_encodings;
1170 let inner = self.inner.clone();
1171 let fut = async move {
1172 let inner = inner.0;
1173 let method = ConnectedSvc(inner);
1174 let codec = tonic::codec::ProstCodec::default();
1175 let mut grpc = tonic::server::Grpc::new(codec)
1176 .apply_compression_config(
1177 accept_compression_encodings,
1178 send_compression_encodings,
1179 );
1180 let res = grpc.unary(method, req).await;
1181 Ok(res)
1182 };
1183 Box::pin(fut)
1184 }
1185 "/vm.VM/Disconnected" => {
1186 #[allow(non_camel_case_types)]
1187 struct DisconnectedSvc<T: Vm>(pub Arc<T>);
1188 impl<T: Vm> tonic::server::UnaryService<super::DisconnectedRequest>
1189 for DisconnectedSvc<T> {
1190 type Response = super::super::google::protobuf::Empty;
1191 type Future = BoxFuture<
1192 tonic::Response<Self::Response>,
1193 tonic::Status,
1194 >;
1195 fn call(
1196 &mut self,
1197 request: tonic::Request<super::DisconnectedRequest>,
1198 ) -> Self::Future {
1199 let inner = self.0.clone();
1200 let fut = async move {
1201 (*inner).disconnected(request).await
1202 };
1203 Box::pin(fut)
1204 }
1205 }
1206 let accept_compression_encodings = self.accept_compression_encodings;
1207 let send_compression_encodings = self.send_compression_encodings;
1208 let inner = self.inner.clone();
1209 let fut = async move {
1210 let inner = inner.0;
1211 let method = DisconnectedSvc(inner);
1212 let codec = tonic::codec::ProstCodec::default();
1213 let mut grpc = tonic::server::Grpc::new(codec)
1214 .apply_compression_config(
1215 accept_compression_encodings,
1216 send_compression_encodings,
1217 );
1218 let res = grpc.unary(method, req).await;
1219 Ok(res)
1220 };
1221 Box::pin(fut)
1222 }
1223 "/vm.VM/BuildBlock" => {
1224 #[allow(non_camel_case_types)]
1225 struct BuildBlockSvc<T: Vm>(pub Arc<T>);
1226 impl<
1227 T: Vm,
1228 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1229 for BuildBlockSvc<T> {
1230 type Response = super::BuildBlockResponse;
1231 type Future = BoxFuture<
1232 tonic::Response<Self::Response>,
1233 tonic::Status,
1234 >;
1235 fn call(
1236 &mut self,
1237 request: tonic::Request<
1238 super::super::google::protobuf::Empty,
1239 >,
1240 ) -> Self::Future {
1241 let inner = self.0.clone();
1242 let fut = async move { (*inner).build_block(request).await };
1243 Box::pin(fut)
1244 }
1245 }
1246 let accept_compression_encodings = self.accept_compression_encodings;
1247 let send_compression_encodings = self.send_compression_encodings;
1248 let inner = self.inner.clone();
1249 let fut = async move {
1250 let inner = inner.0;
1251 let method = BuildBlockSvc(inner);
1252 let codec = tonic::codec::ProstCodec::default();
1253 let mut grpc = tonic::server::Grpc::new(codec)
1254 .apply_compression_config(
1255 accept_compression_encodings,
1256 send_compression_encodings,
1257 );
1258 let res = grpc.unary(method, req).await;
1259 Ok(res)
1260 };
1261 Box::pin(fut)
1262 }
1263 "/vm.VM/ParseBlock" => {
1264 #[allow(non_camel_case_types)]
1265 struct ParseBlockSvc<T: Vm>(pub Arc<T>);
1266 impl<T: Vm> tonic::server::UnaryService<super::ParseBlockRequest>
1267 for ParseBlockSvc<T> {
1268 type Response = super::ParseBlockResponse;
1269 type Future = BoxFuture<
1270 tonic::Response<Self::Response>,
1271 tonic::Status,
1272 >;
1273 fn call(
1274 &mut self,
1275 request: tonic::Request<super::ParseBlockRequest>,
1276 ) -> Self::Future {
1277 let inner = self.0.clone();
1278 let fut = async move { (*inner).parse_block(request).await };
1279 Box::pin(fut)
1280 }
1281 }
1282 let accept_compression_encodings = self.accept_compression_encodings;
1283 let send_compression_encodings = self.send_compression_encodings;
1284 let inner = self.inner.clone();
1285 let fut = async move {
1286 let inner = inner.0;
1287 let method = ParseBlockSvc(inner);
1288 let codec = tonic::codec::ProstCodec::default();
1289 let mut grpc = tonic::server::Grpc::new(codec)
1290 .apply_compression_config(
1291 accept_compression_encodings,
1292 send_compression_encodings,
1293 );
1294 let res = grpc.unary(method, req).await;
1295 Ok(res)
1296 };
1297 Box::pin(fut)
1298 }
1299 "/vm.VM/GetBlock" => {
1300 #[allow(non_camel_case_types)]
1301 struct GetBlockSvc<T: Vm>(pub Arc<T>);
1302 impl<T: Vm> tonic::server::UnaryService<super::GetBlockRequest>
1303 for GetBlockSvc<T> {
1304 type Response = super::GetBlockResponse;
1305 type Future = BoxFuture<
1306 tonic::Response<Self::Response>,
1307 tonic::Status,
1308 >;
1309 fn call(
1310 &mut self,
1311 request: tonic::Request<super::GetBlockRequest>,
1312 ) -> Self::Future {
1313 let inner = self.0.clone();
1314 let fut = async move { (*inner).get_block(request).await };
1315 Box::pin(fut)
1316 }
1317 }
1318 let accept_compression_encodings = self.accept_compression_encodings;
1319 let send_compression_encodings = self.send_compression_encodings;
1320 let inner = self.inner.clone();
1321 let fut = async move {
1322 let inner = inner.0;
1323 let method = GetBlockSvc(inner);
1324 let codec = tonic::codec::ProstCodec::default();
1325 let mut grpc = tonic::server::Grpc::new(codec)
1326 .apply_compression_config(
1327 accept_compression_encodings,
1328 send_compression_encodings,
1329 );
1330 let res = grpc.unary(method, req).await;
1331 Ok(res)
1332 };
1333 Box::pin(fut)
1334 }
1335 "/vm.VM/SetPreference" => {
1336 #[allow(non_camel_case_types)]
1337 struct SetPreferenceSvc<T: Vm>(pub Arc<T>);
1338 impl<T: Vm> tonic::server::UnaryService<super::SetPreferenceRequest>
1339 for SetPreferenceSvc<T> {
1340 type Response = super::super::google::protobuf::Empty;
1341 type Future = BoxFuture<
1342 tonic::Response<Self::Response>,
1343 tonic::Status,
1344 >;
1345 fn call(
1346 &mut self,
1347 request: tonic::Request<super::SetPreferenceRequest>,
1348 ) -> Self::Future {
1349 let inner = self.0.clone();
1350 let fut = async move {
1351 (*inner).set_preference(request).await
1352 };
1353 Box::pin(fut)
1354 }
1355 }
1356 let accept_compression_encodings = self.accept_compression_encodings;
1357 let send_compression_encodings = self.send_compression_encodings;
1358 let inner = self.inner.clone();
1359 let fut = async move {
1360 let inner = inner.0;
1361 let method = SetPreferenceSvc(inner);
1362 let codec = tonic::codec::ProstCodec::default();
1363 let mut grpc = tonic::server::Grpc::new(codec)
1364 .apply_compression_config(
1365 accept_compression_encodings,
1366 send_compression_encodings,
1367 );
1368 let res = grpc.unary(method, req).await;
1369 Ok(res)
1370 };
1371 Box::pin(fut)
1372 }
1373 "/vm.VM/Health" => {
1374 #[allow(non_camel_case_types)]
1375 struct HealthSvc<T: Vm>(pub Arc<T>);
1376 impl<
1377 T: Vm,
1378 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1379 for HealthSvc<T> {
1380 type Response = super::HealthResponse;
1381 type Future = BoxFuture<
1382 tonic::Response<Self::Response>,
1383 tonic::Status,
1384 >;
1385 fn call(
1386 &mut self,
1387 request: tonic::Request<
1388 super::super::google::protobuf::Empty,
1389 >,
1390 ) -> Self::Future {
1391 let inner = self.0.clone();
1392 let fut = async move { (*inner).health(request).await };
1393 Box::pin(fut)
1394 }
1395 }
1396 let accept_compression_encodings = self.accept_compression_encodings;
1397 let send_compression_encodings = self.send_compression_encodings;
1398 let inner = self.inner.clone();
1399 let fut = async move {
1400 let inner = inner.0;
1401 let method = HealthSvc(inner);
1402 let codec = tonic::codec::ProstCodec::default();
1403 let mut grpc = tonic::server::Grpc::new(codec)
1404 .apply_compression_config(
1405 accept_compression_encodings,
1406 send_compression_encodings,
1407 );
1408 let res = grpc.unary(method, req).await;
1409 Ok(res)
1410 };
1411 Box::pin(fut)
1412 }
1413 "/vm.VM/Version" => {
1414 #[allow(non_camel_case_types)]
1415 struct VersionSvc<T: Vm>(pub Arc<T>);
1416 impl<
1417 T: Vm,
1418 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1419 for VersionSvc<T> {
1420 type Response = super::VersionResponse;
1421 type Future = BoxFuture<
1422 tonic::Response<Self::Response>,
1423 tonic::Status,
1424 >;
1425 fn call(
1426 &mut self,
1427 request: tonic::Request<
1428 super::super::google::protobuf::Empty,
1429 >,
1430 ) -> Self::Future {
1431 let inner = self.0.clone();
1432 let fut = async move { (*inner).version(request).await };
1433 Box::pin(fut)
1434 }
1435 }
1436 let accept_compression_encodings = self.accept_compression_encodings;
1437 let send_compression_encodings = self.send_compression_encodings;
1438 let inner = self.inner.clone();
1439 let fut = async move {
1440 let inner = inner.0;
1441 let method = VersionSvc(inner);
1442 let codec = tonic::codec::ProstCodec::default();
1443 let mut grpc = tonic::server::Grpc::new(codec)
1444 .apply_compression_config(
1445 accept_compression_encodings,
1446 send_compression_encodings,
1447 );
1448 let res = grpc.unary(method, req).await;
1449 Ok(res)
1450 };
1451 Box::pin(fut)
1452 }
1453 "/vm.VM/AppRequest" => {
1454 #[allow(non_camel_case_types)]
1455 struct AppRequestSvc<T: Vm>(pub Arc<T>);
1456 impl<T: Vm> tonic::server::UnaryService<super::AppRequestMsg>
1457 for AppRequestSvc<T> {
1458 type Response = super::super::google::protobuf::Empty;
1459 type Future = BoxFuture<
1460 tonic::Response<Self::Response>,
1461 tonic::Status,
1462 >;
1463 fn call(
1464 &mut self,
1465 request: tonic::Request<super::AppRequestMsg>,
1466 ) -> Self::Future {
1467 let inner = self.0.clone();
1468 let fut = async move { (*inner).app_request(request).await };
1469 Box::pin(fut)
1470 }
1471 }
1472 let accept_compression_encodings = self.accept_compression_encodings;
1473 let send_compression_encodings = self.send_compression_encodings;
1474 let inner = self.inner.clone();
1475 let fut = async move {
1476 let inner = inner.0;
1477 let method = AppRequestSvc(inner);
1478 let codec = tonic::codec::ProstCodec::default();
1479 let mut grpc = tonic::server::Grpc::new(codec)
1480 .apply_compression_config(
1481 accept_compression_encodings,
1482 send_compression_encodings,
1483 );
1484 let res = grpc.unary(method, req).await;
1485 Ok(res)
1486 };
1487 Box::pin(fut)
1488 }
1489 "/vm.VM/AppRequestFailed" => {
1490 #[allow(non_camel_case_types)]
1491 struct AppRequestFailedSvc<T: Vm>(pub Arc<T>);
1492 impl<T: Vm> tonic::server::UnaryService<super::AppRequestFailedMsg>
1493 for AppRequestFailedSvc<T> {
1494 type Response = super::super::google::protobuf::Empty;
1495 type Future = BoxFuture<
1496 tonic::Response<Self::Response>,
1497 tonic::Status,
1498 >;
1499 fn call(
1500 &mut self,
1501 request: tonic::Request<super::AppRequestFailedMsg>,
1502 ) -> Self::Future {
1503 let inner = self.0.clone();
1504 let fut = async move {
1505 (*inner).app_request_failed(request).await
1506 };
1507 Box::pin(fut)
1508 }
1509 }
1510 let accept_compression_encodings = self.accept_compression_encodings;
1511 let send_compression_encodings = self.send_compression_encodings;
1512 let inner = self.inner.clone();
1513 let fut = async move {
1514 let inner = inner.0;
1515 let method = AppRequestFailedSvc(inner);
1516 let codec = tonic::codec::ProstCodec::default();
1517 let mut grpc = tonic::server::Grpc::new(codec)
1518 .apply_compression_config(
1519 accept_compression_encodings,
1520 send_compression_encodings,
1521 );
1522 let res = grpc.unary(method, req).await;
1523 Ok(res)
1524 };
1525 Box::pin(fut)
1526 }
1527 "/vm.VM/AppResponse" => {
1528 #[allow(non_camel_case_types)]
1529 struct AppResponseSvc<T: Vm>(pub Arc<T>);
1530 impl<T: Vm> tonic::server::UnaryService<super::AppResponseMsg>
1531 for AppResponseSvc<T> {
1532 type Response = super::super::google::protobuf::Empty;
1533 type Future = BoxFuture<
1534 tonic::Response<Self::Response>,
1535 tonic::Status,
1536 >;
1537 fn call(
1538 &mut self,
1539 request: tonic::Request<super::AppResponseMsg>,
1540 ) -> Self::Future {
1541 let inner = self.0.clone();
1542 let fut = async move {
1543 (*inner).app_response(request).await
1544 };
1545 Box::pin(fut)
1546 }
1547 }
1548 let accept_compression_encodings = self.accept_compression_encodings;
1549 let send_compression_encodings = self.send_compression_encodings;
1550 let inner = self.inner.clone();
1551 let fut = async move {
1552 let inner = inner.0;
1553 let method = AppResponseSvc(inner);
1554 let codec = tonic::codec::ProstCodec::default();
1555 let mut grpc = tonic::server::Grpc::new(codec)
1556 .apply_compression_config(
1557 accept_compression_encodings,
1558 send_compression_encodings,
1559 );
1560 let res = grpc.unary(method, req).await;
1561 Ok(res)
1562 };
1563 Box::pin(fut)
1564 }
1565 "/vm.VM/AppGossip" => {
1566 #[allow(non_camel_case_types)]
1567 struct AppGossipSvc<T: Vm>(pub Arc<T>);
1568 impl<T: Vm> tonic::server::UnaryService<super::AppGossipMsg>
1569 for AppGossipSvc<T> {
1570 type Response = super::super::google::protobuf::Empty;
1571 type Future = BoxFuture<
1572 tonic::Response<Self::Response>,
1573 tonic::Status,
1574 >;
1575 fn call(
1576 &mut self,
1577 request: tonic::Request<super::AppGossipMsg>,
1578 ) -> Self::Future {
1579 let inner = self.0.clone();
1580 let fut = async move { (*inner).app_gossip(request).await };
1581 Box::pin(fut)
1582 }
1583 }
1584 let accept_compression_encodings = self.accept_compression_encodings;
1585 let send_compression_encodings = self.send_compression_encodings;
1586 let inner = self.inner.clone();
1587 let fut = async move {
1588 let inner = inner.0;
1589 let method = AppGossipSvc(inner);
1590 let codec = tonic::codec::ProstCodec::default();
1591 let mut grpc = tonic::server::Grpc::new(codec)
1592 .apply_compression_config(
1593 accept_compression_encodings,
1594 send_compression_encodings,
1595 );
1596 let res = grpc.unary(method, req).await;
1597 Ok(res)
1598 };
1599 Box::pin(fut)
1600 }
1601 "/vm.VM/Gather" => {
1602 #[allow(non_camel_case_types)]
1603 struct GatherSvc<T: Vm>(pub Arc<T>);
1604 impl<
1605 T: Vm,
1606 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1607 for GatherSvc<T> {
1608 type Response = super::GatherResponse;
1609 type Future = BoxFuture<
1610 tonic::Response<Self::Response>,
1611 tonic::Status,
1612 >;
1613 fn call(
1614 &mut self,
1615 request: tonic::Request<
1616 super::super::google::protobuf::Empty,
1617 >,
1618 ) -> Self::Future {
1619 let inner = self.0.clone();
1620 let fut = async move { (*inner).gather(request).await };
1621 Box::pin(fut)
1622 }
1623 }
1624 let accept_compression_encodings = self.accept_compression_encodings;
1625 let send_compression_encodings = self.send_compression_encodings;
1626 let inner = self.inner.clone();
1627 let fut = async move {
1628 let inner = inner.0;
1629 let method = GatherSvc(inner);
1630 let codec = tonic::codec::ProstCodec::default();
1631 let mut grpc = tonic::server::Grpc::new(codec)
1632 .apply_compression_config(
1633 accept_compression_encodings,
1634 send_compression_encodings,
1635 );
1636 let res = grpc.unary(method, req).await;
1637 Ok(res)
1638 };
1639 Box::pin(fut)
1640 }
1641 "/vm.VM/CrossChainAppRequest" => {
1642 #[allow(non_camel_case_types)]
1643 struct CrossChainAppRequestSvc<T: Vm>(pub Arc<T>);
1644 impl<
1645 T: Vm,
1646 > tonic::server::UnaryService<super::CrossChainAppRequestMsg>
1647 for CrossChainAppRequestSvc<T> {
1648 type Response = super::super::google::protobuf::Empty;
1649 type Future = BoxFuture<
1650 tonic::Response<Self::Response>,
1651 tonic::Status,
1652 >;
1653 fn call(
1654 &mut self,
1655 request: tonic::Request<super::CrossChainAppRequestMsg>,
1656 ) -> Self::Future {
1657 let inner = self.0.clone();
1658 let fut = async move {
1659 (*inner).cross_chain_app_request(request).await
1660 };
1661 Box::pin(fut)
1662 }
1663 }
1664 let accept_compression_encodings = self.accept_compression_encodings;
1665 let send_compression_encodings = self.send_compression_encodings;
1666 let inner = self.inner.clone();
1667 let fut = async move {
1668 let inner = inner.0;
1669 let method = CrossChainAppRequestSvc(inner);
1670 let codec = tonic::codec::ProstCodec::default();
1671 let mut grpc = tonic::server::Grpc::new(codec)
1672 .apply_compression_config(
1673 accept_compression_encodings,
1674 send_compression_encodings,
1675 );
1676 let res = grpc.unary(method, req).await;
1677 Ok(res)
1678 };
1679 Box::pin(fut)
1680 }
1681 "/vm.VM/CrossChainAppRequestFailed" => {
1682 #[allow(non_camel_case_types)]
1683 struct CrossChainAppRequestFailedSvc<T: Vm>(pub Arc<T>);
1684 impl<
1685 T: Vm,
1686 > tonic::server::UnaryService<super::CrossChainAppRequestFailedMsg>
1687 for CrossChainAppRequestFailedSvc<T> {
1688 type Response = super::super::google::protobuf::Empty;
1689 type Future = BoxFuture<
1690 tonic::Response<Self::Response>,
1691 tonic::Status,
1692 >;
1693 fn call(
1694 &mut self,
1695 request: tonic::Request<super::CrossChainAppRequestFailedMsg>,
1696 ) -> Self::Future {
1697 let inner = self.0.clone();
1698 let fut = async move {
1699 (*inner).cross_chain_app_request_failed(request).await
1700 };
1701 Box::pin(fut)
1702 }
1703 }
1704 let accept_compression_encodings = self.accept_compression_encodings;
1705 let send_compression_encodings = self.send_compression_encodings;
1706 let inner = self.inner.clone();
1707 let fut = async move {
1708 let inner = inner.0;
1709 let method = CrossChainAppRequestFailedSvc(inner);
1710 let codec = tonic::codec::ProstCodec::default();
1711 let mut grpc = tonic::server::Grpc::new(codec)
1712 .apply_compression_config(
1713 accept_compression_encodings,
1714 send_compression_encodings,
1715 );
1716 let res = grpc.unary(method, req).await;
1717 Ok(res)
1718 };
1719 Box::pin(fut)
1720 }
1721 "/vm.VM/CrossChainAppResponse" => {
1722 #[allow(non_camel_case_types)]
1723 struct CrossChainAppResponseSvc<T: Vm>(pub Arc<T>);
1724 impl<
1725 T: Vm,
1726 > tonic::server::UnaryService<super::CrossChainAppResponseMsg>
1727 for CrossChainAppResponseSvc<T> {
1728 type Response = super::super::google::protobuf::Empty;
1729 type Future = BoxFuture<
1730 tonic::Response<Self::Response>,
1731 tonic::Status,
1732 >;
1733 fn call(
1734 &mut self,
1735 request: tonic::Request<super::CrossChainAppResponseMsg>,
1736 ) -> Self::Future {
1737 let inner = self.0.clone();
1738 let fut = async move {
1739 (*inner).cross_chain_app_response(request).await
1740 };
1741 Box::pin(fut)
1742 }
1743 }
1744 let accept_compression_encodings = self.accept_compression_encodings;
1745 let send_compression_encodings = self.send_compression_encodings;
1746 let inner = self.inner.clone();
1747 let fut = async move {
1748 let inner = inner.0;
1749 let method = CrossChainAppResponseSvc(inner);
1750 let codec = tonic::codec::ProstCodec::default();
1751 let mut grpc = tonic::server::Grpc::new(codec)
1752 .apply_compression_config(
1753 accept_compression_encodings,
1754 send_compression_encodings,
1755 );
1756 let res = grpc.unary(method, req).await;
1757 Ok(res)
1758 };
1759 Box::pin(fut)
1760 }
1761 "/vm.VM/GetAncestors" => {
1762 #[allow(non_camel_case_types)]
1763 struct GetAncestorsSvc<T: Vm>(pub Arc<T>);
1764 impl<T: Vm> tonic::server::UnaryService<super::GetAncestorsRequest>
1765 for GetAncestorsSvc<T> {
1766 type Response = super::GetAncestorsResponse;
1767 type Future = BoxFuture<
1768 tonic::Response<Self::Response>,
1769 tonic::Status,
1770 >;
1771 fn call(
1772 &mut self,
1773 request: tonic::Request<super::GetAncestorsRequest>,
1774 ) -> Self::Future {
1775 let inner = self.0.clone();
1776 let fut = async move {
1777 (*inner).get_ancestors(request).await
1778 };
1779 Box::pin(fut)
1780 }
1781 }
1782 let accept_compression_encodings = self.accept_compression_encodings;
1783 let send_compression_encodings = self.send_compression_encodings;
1784 let inner = self.inner.clone();
1785 let fut = async move {
1786 let inner = inner.0;
1787 let method = GetAncestorsSvc(inner);
1788 let codec = tonic::codec::ProstCodec::default();
1789 let mut grpc = tonic::server::Grpc::new(codec)
1790 .apply_compression_config(
1791 accept_compression_encodings,
1792 send_compression_encodings,
1793 );
1794 let res = grpc.unary(method, req).await;
1795 Ok(res)
1796 };
1797 Box::pin(fut)
1798 }
1799 "/vm.VM/BatchedParseBlock" => {
1800 #[allow(non_camel_case_types)]
1801 struct BatchedParseBlockSvc<T: Vm>(pub Arc<T>);
1802 impl<
1803 T: Vm,
1804 > tonic::server::UnaryService<super::BatchedParseBlockRequest>
1805 for BatchedParseBlockSvc<T> {
1806 type Response = super::BatchedParseBlockResponse;
1807 type Future = BoxFuture<
1808 tonic::Response<Self::Response>,
1809 tonic::Status,
1810 >;
1811 fn call(
1812 &mut self,
1813 request: tonic::Request<super::BatchedParseBlockRequest>,
1814 ) -> Self::Future {
1815 let inner = self.0.clone();
1816 let fut = async move {
1817 (*inner).batched_parse_block(request).await
1818 };
1819 Box::pin(fut)
1820 }
1821 }
1822 let accept_compression_encodings = self.accept_compression_encodings;
1823 let send_compression_encodings = self.send_compression_encodings;
1824 let inner = self.inner.clone();
1825 let fut = async move {
1826 let inner = inner.0;
1827 let method = BatchedParseBlockSvc(inner);
1828 let codec = tonic::codec::ProstCodec::default();
1829 let mut grpc = tonic::server::Grpc::new(codec)
1830 .apply_compression_config(
1831 accept_compression_encodings,
1832 send_compression_encodings,
1833 );
1834 let res = grpc.unary(method, req).await;
1835 Ok(res)
1836 };
1837 Box::pin(fut)
1838 }
1839 "/vm.VM/VerifyHeightIndex" => {
1840 #[allow(non_camel_case_types)]
1841 struct VerifyHeightIndexSvc<T: Vm>(pub Arc<T>);
1842 impl<
1843 T: Vm,
1844 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1845 for VerifyHeightIndexSvc<T> {
1846 type Response = super::VerifyHeightIndexResponse;
1847 type Future = BoxFuture<
1848 tonic::Response<Self::Response>,
1849 tonic::Status,
1850 >;
1851 fn call(
1852 &mut self,
1853 request: tonic::Request<
1854 super::super::google::protobuf::Empty,
1855 >,
1856 ) -> Self::Future {
1857 let inner = self.0.clone();
1858 let fut = async move {
1859 (*inner).verify_height_index(request).await
1860 };
1861 Box::pin(fut)
1862 }
1863 }
1864 let accept_compression_encodings = self.accept_compression_encodings;
1865 let send_compression_encodings = self.send_compression_encodings;
1866 let inner = self.inner.clone();
1867 let fut = async move {
1868 let inner = inner.0;
1869 let method = VerifyHeightIndexSvc(inner);
1870 let codec = tonic::codec::ProstCodec::default();
1871 let mut grpc = tonic::server::Grpc::new(codec)
1872 .apply_compression_config(
1873 accept_compression_encodings,
1874 send_compression_encodings,
1875 );
1876 let res = grpc.unary(method, req).await;
1877 Ok(res)
1878 };
1879 Box::pin(fut)
1880 }
1881 "/vm.VM/GetBlockIDAtHeight" => {
1882 #[allow(non_camel_case_types)]
1883 struct GetBlockIDAtHeightSvc<T: Vm>(pub Arc<T>);
1884 impl<
1885 T: Vm,
1886 > tonic::server::UnaryService<super::GetBlockIdAtHeightRequest>
1887 for GetBlockIDAtHeightSvc<T> {
1888 type Response = super::GetBlockIdAtHeightResponse;
1889 type Future = BoxFuture<
1890 tonic::Response<Self::Response>,
1891 tonic::Status,
1892 >;
1893 fn call(
1894 &mut self,
1895 request: tonic::Request<super::GetBlockIdAtHeightRequest>,
1896 ) -> Self::Future {
1897 let inner = self.0.clone();
1898 let fut = async move {
1899 (*inner).get_block_id_at_height(request).await
1900 };
1901 Box::pin(fut)
1902 }
1903 }
1904 let accept_compression_encodings = self.accept_compression_encodings;
1905 let send_compression_encodings = self.send_compression_encodings;
1906 let inner = self.inner.clone();
1907 let fut = async move {
1908 let inner = inner.0;
1909 let method = GetBlockIDAtHeightSvc(inner);
1910 let codec = tonic::codec::ProstCodec::default();
1911 let mut grpc = tonic::server::Grpc::new(codec)
1912 .apply_compression_config(
1913 accept_compression_encodings,
1914 send_compression_encodings,
1915 );
1916 let res = grpc.unary(method, req).await;
1917 Ok(res)
1918 };
1919 Box::pin(fut)
1920 }
1921 "/vm.VM/StateSyncEnabled" => {
1922 #[allow(non_camel_case_types)]
1923 struct StateSyncEnabledSvc<T: Vm>(pub Arc<T>);
1924 impl<
1925 T: Vm,
1926 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1927 for StateSyncEnabledSvc<T> {
1928 type Response = super::StateSyncEnabledResponse;
1929 type Future = BoxFuture<
1930 tonic::Response<Self::Response>,
1931 tonic::Status,
1932 >;
1933 fn call(
1934 &mut self,
1935 request: tonic::Request<
1936 super::super::google::protobuf::Empty,
1937 >,
1938 ) -> Self::Future {
1939 let inner = self.0.clone();
1940 let fut = async move {
1941 (*inner).state_sync_enabled(request).await
1942 };
1943 Box::pin(fut)
1944 }
1945 }
1946 let accept_compression_encodings = self.accept_compression_encodings;
1947 let send_compression_encodings = self.send_compression_encodings;
1948 let inner = self.inner.clone();
1949 let fut = async move {
1950 let inner = inner.0;
1951 let method = StateSyncEnabledSvc(inner);
1952 let codec = tonic::codec::ProstCodec::default();
1953 let mut grpc = tonic::server::Grpc::new(codec)
1954 .apply_compression_config(
1955 accept_compression_encodings,
1956 send_compression_encodings,
1957 );
1958 let res = grpc.unary(method, req).await;
1959 Ok(res)
1960 };
1961 Box::pin(fut)
1962 }
1963 "/vm.VM/GetOngoingSyncStateSummary" => {
1964 #[allow(non_camel_case_types)]
1965 struct GetOngoingSyncStateSummarySvc<T: Vm>(pub Arc<T>);
1966 impl<
1967 T: Vm,
1968 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
1969 for GetOngoingSyncStateSummarySvc<T> {
1970 type Response = super::GetOngoingSyncStateSummaryResponse;
1971 type Future = BoxFuture<
1972 tonic::Response<Self::Response>,
1973 tonic::Status,
1974 >;
1975 fn call(
1976 &mut self,
1977 request: tonic::Request<
1978 super::super::google::protobuf::Empty,
1979 >,
1980 ) -> Self::Future {
1981 let inner = self.0.clone();
1982 let fut = async move {
1983 (*inner).get_ongoing_sync_state_summary(request).await
1984 };
1985 Box::pin(fut)
1986 }
1987 }
1988 let accept_compression_encodings = self.accept_compression_encodings;
1989 let send_compression_encodings = self.send_compression_encodings;
1990 let inner = self.inner.clone();
1991 let fut = async move {
1992 let inner = inner.0;
1993 let method = GetOngoingSyncStateSummarySvc(inner);
1994 let codec = tonic::codec::ProstCodec::default();
1995 let mut grpc = tonic::server::Grpc::new(codec)
1996 .apply_compression_config(
1997 accept_compression_encodings,
1998 send_compression_encodings,
1999 );
2000 let res = grpc.unary(method, req).await;
2001 Ok(res)
2002 };
2003 Box::pin(fut)
2004 }
2005 "/vm.VM/GetLastStateSummary" => {
2006 #[allow(non_camel_case_types)]
2007 struct GetLastStateSummarySvc<T: Vm>(pub Arc<T>);
2008 impl<
2009 T: Vm,
2010 > tonic::server::UnaryService<super::super::google::protobuf::Empty>
2011 for GetLastStateSummarySvc<T> {
2012 type Response = super::GetLastStateSummaryResponse;
2013 type Future = BoxFuture<
2014 tonic::Response<Self::Response>,
2015 tonic::Status,
2016 >;
2017 fn call(
2018 &mut self,
2019 request: tonic::Request<
2020 super::super::google::protobuf::Empty,
2021 >,
2022 ) -> Self::Future {
2023 let inner = self.0.clone();
2024 let fut = async move {
2025 (*inner).get_last_state_summary(request).await
2026 };
2027 Box::pin(fut)
2028 }
2029 }
2030 let accept_compression_encodings = self.accept_compression_encodings;
2031 let send_compression_encodings = self.send_compression_encodings;
2032 let inner = self.inner.clone();
2033 let fut = async move {
2034 let inner = inner.0;
2035 let method = GetLastStateSummarySvc(inner);
2036 let codec = tonic::codec::ProstCodec::default();
2037 let mut grpc = tonic::server::Grpc::new(codec)
2038 .apply_compression_config(
2039 accept_compression_encodings,
2040 send_compression_encodings,
2041 );
2042 let res = grpc.unary(method, req).await;
2043 Ok(res)
2044 };
2045 Box::pin(fut)
2046 }
2047 "/vm.VM/ParseStateSummary" => {
2048 #[allow(non_camel_case_types)]
2049 struct ParseStateSummarySvc<T: Vm>(pub Arc<T>);
2050 impl<
2051 T: Vm,
2052 > tonic::server::UnaryService<super::ParseStateSummaryRequest>
2053 for ParseStateSummarySvc<T> {
2054 type Response = super::ParseStateSummaryResponse;
2055 type Future = BoxFuture<
2056 tonic::Response<Self::Response>,
2057 tonic::Status,
2058 >;
2059 fn call(
2060 &mut self,
2061 request: tonic::Request<super::ParseStateSummaryRequest>,
2062 ) -> Self::Future {
2063 let inner = self.0.clone();
2064 let fut = async move {
2065 (*inner).parse_state_summary(request).await
2066 };
2067 Box::pin(fut)
2068 }
2069 }
2070 let accept_compression_encodings = self.accept_compression_encodings;
2071 let send_compression_encodings = self.send_compression_encodings;
2072 let inner = self.inner.clone();
2073 let fut = async move {
2074 let inner = inner.0;
2075 let method = ParseStateSummarySvc(inner);
2076 let codec = tonic::codec::ProstCodec::default();
2077 let mut grpc = tonic::server::Grpc::new(codec)
2078 .apply_compression_config(
2079 accept_compression_encodings,
2080 send_compression_encodings,
2081 );
2082 let res = grpc.unary(method, req).await;
2083 Ok(res)
2084 };
2085 Box::pin(fut)
2086 }
2087 "/vm.VM/GetStateSummary" => {
2088 #[allow(non_camel_case_types)]
2089 struct GetStateSummarySvc<T: Vm>(pub Arc<T>);
2090 impl<
2091 T: Vm,
2092 > tonic::server::UnaryService<super::GetStateSummaryRequest>
2093 for GetStateSummarySvc<T> {
2094 type Response = super::GetStateSummaryResponse;
2095 type Future = BoxFuture<
2096 tonic::Response<Self::Response>,
2097 tonic::Status,
2098 >;
2099 fn call(
2100 &mut self,
2101 request: tonic::Request<super::GetStateSummaryRequest>,
2102 ) -> Self::Future {
2103 let inner = self.0.clone();
2104 let fut = async move {
2105 (*inner).get_state_summary(request).await
2106 };
2107 Box::pin(fut)
2108 }
2109 }
2110 let accept_compression_encodings = self.accept_compression_encodings;
2111 let send_compression_encodings = self.send_compression_encodings;
2112 let inner = self.inner.clone();
2113 let fut = async move {
2114 let inner = inner.0;
2115 let method = GetStateSummarySvc(inner);
2116 let codec = tonic::codec::ProstCodec::default();
2117 let mut grpc = tonic::server::Grpc::new(codec)
2118 .apply_compression_config(
2119 accept_compression_encodings,
2120 send_compression_encodings,
2121 );
2122 let res = grpc.unary(method, req).await;
2123 Ok(res)
2124 };
2125 Box::pin(fut)
2126 }
2127 "/vm.VM/BlockVerify" => {
2128 #[allow(non_camel_case_types)]
2129 struct BlockVerifySvc<T: Vm>(pub Arc<T>);
2130 impl<T: Vm> tonic::server::UnaryService<super::BlockVerifyRequest>
2131 for BlockVerifySvc<T> {
2132 type Response = super::BlockVerifyResponse;
2133 type Future = BoxFuture<
2134 tonic::Response<Self::Response>,
2135 tonic::Status,
2136 >;
2137 fn call(
2138 &mut self,
2139 request: tonic::Request<super::BlockVerifyRequest>,
2140 ) -> Self::Future {
2141 let inner = self.0.clone();
2142 let fut = async move {
2143 (*inner).block_verify(request).await
2144 };
2145 Box::pin(fut)
2146 }
2147 }
2148 let accept_compression_encodings = self.accept_compression_encodings;
2149 let send_compression_encodings = self.send_compression_encodings;
2150 let inner = self.inner.clone();
2151 let fut = async move {
2152 let inner = inner.0;
2153 let method = BlockVerifySvc(inner);
2154 let codec = tonic::codec::ProstCodec::default();
2155 let mut grpc = tonic::server::Grpc::new(codec)
2156 .apply_compression_config(
2157 accept_compression_encodings,
2158 send_compression_encodings,
2159 );
2160 let res = grpc.unary(method, req).await;
2161 Ok(res)
2162 };
2163 Box::pin(fut)
2164 }
2165 "/vm.VM/BlockAccept" => {
2166 #[allow(non_camel_case_types)]
2167 struct BlockAcceptSvc<T: Vm>(pub Arc<T>);
2168 impl<T: Vm> tonic::server::UnaryService<super::BlockAcceptRequest>
2169 for BlockAcceptSvc<T> {
2170 type Response = super::super::google::protobuf::Empty;
2171 type Future = BoxFuture<
2172 tonic::Response<Self::Response>,
2173 tonic::Status,
2174 >;
2175 fn call(
2176 &mut self,
2177 request: tonic::Request<super::BlockAcceptRequest>,
2178 ) -> Self::Future {
2179 let inner = self.0.clone();
2180 let fut = async move {
2181 (*inner).block_accept(request).await
2182 };
2183 Box::pin(fut)
2184 }
2185 }
2186 let accept_compression_encodings = self.accept_compression_encodings;
2187 let send_compression_encodings = self.send_compression_encodings;
2188 let inner = self.inner.clone();
2189 let fut = async move {
2190 let inner = inner.0;
2191 let method = BlockAcceptSvc(inner);
2192 let codec = tonic::codec::ProstCodec::default();
2193 let mut grpc = tonic::server::Grpc::new(codec)
2194 .apply_compression_config(
2195 accept_compression_encodings,
2196 send_compression_encodings,
2197 );
2198 let res = grpc.unary(method, req).await;
2199 Ok(res)
2200 };
2201 Box::pin(fut)
2202 }
2203 "/vm.VM/BlockReject" => {
2204 #[allow(non_camel_case_types)]
2205 struct BlockRejectSvc<T: Vm>(pub Arc<T>);
2206 impl<T: Vm> tonic::server::UnaryService<super::BlockRejectRequest>
2207 for BlockRejectSvc<T> {
2208 type Response = super::super::google::protobuf::Empty;
2209 type Future = BoxFuture<
2210 tonic::Response<Self::Response>,
2211 tonic::Status,
2212 >;
2213 fn call(
2214 &mut self,
2215 request: tonic::Request<super::BlockRejectRequest>,
2216 ) -> Self::Future {
2217 let inner = self.0.clone();
2218 let fut = async move {
2219 (*inner).block_reject(request).await
2220 };
2221 Box::pin(fut)
2222 }
2223 }
2224 let accept_compression_encodings = self.accept_compression_encodings;
2225 let send_compression_encodings = self.send_compression_encodings;
2226 let inner = self.inner.clone();
2227 let fut = async move {
2228 let inner = inner.0;
2229 let method = BlockRejectSvc(inner);
2230 let codec = tonic::codec::ProstCodec::default();
2231 let mut grpc = tonic::server::Grpc::new(codec)
2232 .apply_compression_config(
2233 accept_compression_encodings,
2234 send_compression_encodings,
2235 );
2236 let res = grpc.unary(method, req).await;
2237 Ok(res)
2238 };
2239 Box::pin(fut)
2240 }
2241 "/vm.VM/StateSummaryAccept" => {
2242 #[allow(non_camel_case_types)]
2243 struct StateSummaryAcceptSvc<T: Vm>(pub Arc<T>);
2244 impl<
2245 T: Vm,
2246 > tonic::server::UnaryService<super::StateSummaryAcceptRequest>
2247 for StateSummaryAcceptSvc<T> {
2248 type Response = super::StateSummaryAcceptResponse;
2249 type Future = BoxFuture<
2250 tonic::Response<Self::Response>,
2251 tonic::Status,
2252 >;
2253 fn call(
2254 &mut self,
2255 request: tonic::Request<super::StateSummaryAcceptRequest>,
2256 ) -> Self::Future {
2257 let inner = self.0.clone();
2258 let fut = async move {
2259 (*inner).state_summary_accept(request).await
2260 };
2261 Box::pin(fut)
2262 }
2263 }
2264 let accept_compression_encodings = self.accept_compression_encodings;
2265 let send_compression_encodings = self.send_compression_encodings;
2266 let inner = self.inner.clone();
2267 let fut = async move {
2268 let inner = inner.0;
2269 let method = StateSummaryAcceptSvc(inner);
2270 let codec = tonic::codec::ProstCodec::default();
2271 let mut grpc = tonic::server::Grpc::new(codec)
2272 .apply_compression_config(
2273 accept_compression_encodings,
2274 send_compression_encodings,
2275 );
2276 let res = grpc.unary(method, req).await;
2277 Ok(res)
2278 };
2279 Box::pin(fut)
2280 }
2281 _ => {
2282 Box::pin(async move {
2283 Ok(
2284 http::Response::builder()
2285 .status(200)
2286 .header("grpc-status", "12")
2287 .header("content-type", "application/grpc")
2288 .body(empty_body())
2289 .unwrap(),
2290 )
2291 })
2292 }
2293 }
2294 }
2295 }
2296 impl<T: Vm> Clone for VmServer<T> {
2297 fn clone(&self) -> Self {
2298 let inner = self.inner.clone();
2299 Self {
2300 inner,
2301 accept_compression_encodings: self.accept_compression_encodings,
2302 send_compression_encodings: self.send_compression_encodings,
2303 }
2304 }
2305 }
2306 impl<T: Vm> Clone for _Inner<T> {
2307 fn clone(&self) -> Self {
2308 Self(self.0.clone())
2309 }
2310 }
2311 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
2312 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2313 write!(f, "{:?}", self.0)
2314 }
2315 }
2316 impl<T: Vm> tonic::server::NamedService for VmServer<T> {
2317 const NAME: &'static str = "vm.VM";
2318 }
2319}