diff --git a/src/validator/mod.rs b/src/validator/mod.rs index 80b8bc0..492c8fd 100644 --- a/src/validator/mod.rs +++ b/src/validator/mod.rs @@ -164,6 +164,15 @@ pub struct NullResponse { #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] #[derive(serde::Serialize, serde::Deserialize)] #[serde(rename_all = "PascalCase")] +pub struct OperationSuccessRequest { + #[prost(uint32, tag="1")] + pub operation_id: u32, + #[prost(string, tag="2")] + pub path: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "PascalCase")] pub struct OperationFailRequest { #[prost(uint32, tag="1")] pub operation_id: u32, diff --git a/src/validator/validator.tonic.rs b/src/validator/validator.tonic.rs index 20a093c..0e5babd 100644 --- a/src/validator/validator.tonic.rs +++ b/src/validator/validator.tonic.rs @@ -2456,6 +2456,29 @@ pub mod validator_operation_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } + pub async fn success( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/validator.ValidatorOperationService/Success", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("validator.ValidatorOperationService", "Success"), + ); + self.inner.unary(req, path, codec).await + } pub async fn fail( &mut self, request: impl tonic::IntoRequest, @@ -2492,6 +2515,10 @@ pub mod validator_operation_service_server { /// Generated trait containing gRPC methods that should be implemented for use with ValidatorOperationServiceServer. #[async_trait] pub trait ValidatorOperationService: std::marker::Send + std::marker::Sync + 'static { + async fn success( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; async fn fail( &self, request: tonic::Request, @@ -2574,6 +2601,52 @@ pub mod validator_operation_service_server { } fn call(&mut self, req: http::Request) -> Self::Future { match req.uri().path() { + "/validator.ValidatorOperationService/Success" => { + #[allow(non_camel_case_types)] + struct SuccessSvc(pub Arc); + impl< + T: ValidatorOperationService, + > tonic::server::UnaryService + for SuccessSvc { + type Response = super::NullResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::success(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = SuccessSvc(inner); + let codec = tonic_prost::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/validator.ValidatorOperationService/Fail" => { #[allow(non_camel_case_types)] struct FailSvc(pub Arc);