Skip to content

Commit

Permalink
chore: fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Fumuran committed Sep 30, 2024
1 parent 466910a commit 869e968
Showing 1 changed file with 53 additions and 29 deletions.
82 changes: 53 additions & 29 deletions bin/tx-prover/src/server/generated/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pub struct ProveTransactionResponse {
/// Generated client implementations.
pub mod api_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ApiClient<T> {
inner: tonic::client::Grpc<T>,
Expand Down Expand Up @@ -46,7 +46,10 @@ pub mod api_client {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(inner: T, interceptor: F) -> ApiClient<InterceptedService<T, F>>
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ApiClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
Expand All @@ -56,8 +59,9 @@ pub mod api_client {
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
ApiClient::new(InterceptedService::new(inner, interceptor))
}
Expand Down Expand Up @@ -95,14 +99,19 @@ pub mod api_client {
pub async fn prove_transaction(
&mut self,
request: impl tonic::IntoRequest<super::ProveTransactionRequest>,
) -> std::result::Result<tonic::Response<super::ProveTransactionResponse>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
) -> std::result::Result<
tonic::Response<super::ProveTransactionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Api/ProveTransaction");
let mut req = request.into_request();
Expand All @@ -121,7 +130,10 @@ pub mod api_server {
async fn prove_transaction(
&self,
request: tonic::Request<super::ProveTransactionRequest>,
) -> std::result::Result<tonic::Response<super::ProveTransactionResponse>, tonic::Status>;
) -> std::result::Result<
tonic::Response<super::ProveTransactionResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ApiServer<T: Api> {
Expand All @@ -146,7 +158,10 @@ pub mod api_server {
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
Expand Down Expand Up @@ -202,18 +217,23 @@ pub mod api_server {
"/api.Api/ProveTransaction" => {
#[allow(non_camel_case_types)]
struct ProveTransactionSvc<T: Api>(pub Arc<T>);
impl<T: Api> tonic::server::UnaryService<super::ProveTransactionRequest>
for ProveTransactionSvc<T>
{
impl<
T: Api,
> tonic::server::UnaryService<super::ProveTransactionRequest>
for ProveTransactionSvc<T> {
type Response = super::ProveTransactionResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ProveTransactionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut =
async move { <T as Api>::prove_transaction(&inner, request).await };
let fut = async move {
<T as Api>::prove_transaction(&inner, request).await
};
Box::pin(fut)
}
}
Expand All @@ -239,15 +259,19 @@ pub mod api_server {
Ok(res)
};
Box::pin(fut)
},
_ => Box::pin(async move {
Ok(http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap())
}),
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
Expand Down

0 comments on commit 869e968

Please sign in to comment.