Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
phklive committed Oct 1, 2024
1 parent 65915d3 commit 816fbb7
Showing 1 changed file with 29 additions and 54 deletions.
83 changes: 29 additions & 54 deletions bin/tx-prover/src/server/generated/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ pub struct ProveTransactionResponse {
/// Generated client implementations.
pub mod api_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
use tonic::codegen::{http::Uri, *};
#[derive(Debug, Clone)]
pub struct ApiClient<T> {
inner: tonic::client::Grpc<T>,
Expand Down Expand Up @@ -46,10 +45,7 @@ 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 @@ -59,9 +55,8 @@ 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 @@ -99,19 +94,14 @@ 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 @@ -130,10 +120,7 @@ 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 @@ -158,10 +145,7 @@ 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 @@ -217,23 +201,18 @@ 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 @@ -259,19 +238,15 @@ 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 816fbb7

Please sign in to comment.