@dashevo/dapi-grpc 3.0.1-hotfix.4 → 3.1.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,132 +0,0 @@
1
- // This file is @generated by prost-build.
2
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
3
- #[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
4
- #[derive(::dash_platform_macros::Mockable)]
5
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6
- pub struct GetProofsRequest {
7
- #[prost(bytes = "vec", tag = "1")]
8
- pub state_transition: ::prost::alloc::vec::Vec<u8>,
9
- }
10
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
11
- #[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
12
- #[derive(::dash_platform_macros::Mockable)]
13
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
14
- pub struct GetProofsResponse {
15
- /// Cryptographic proof for the requested data
16
- #[prost(message, optional, tag = "1")]
17
- pub proof: ::core::option::Option<super::super::dapi::v0::Proof>,
18
- /// Metadata about the blockchain state
19
- #[prost(message, optional, tag = "2")]
20
- pub metadata: ::core::option::Option<super::super::dapi::v0::ResponseMetadata>,
21
- }
22
- /// Generated client implementations.
23
- pub mod drive_internal_client {
24
- #![allow(
25
- unused_variables,
26
- dead_code,
27
- missing_docs,
28
- clippy::wildcard_imports,
29
- clippy::let_unit_value,
30
- )]
31
- use tonic::codegen::*;
32
- use tonic::codegen::http::Uri;
33
- #[derive(Debug, Clone)]
34
- pub struct DriveInternalClient<T> {
35
- inner: tonic::client::Grpc<T>,
36
- }
37
- impl<T> DriveInternalClient<T>
38
- where
39
- T: tonic::client::GrpcService<tonic::body::Body>,
40
- T::Error: Into<StdError>,
41
- T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
42
- <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
43
- {
44
- pub fn new(inner: T) -> Self {
45
- let inner = tonic::client::Grpc::new(inner);
46
- Self { inner }
47
- }
48
- pub fn with_origin(inner: T, origin: Uri) -> Self {
49
- let inner = tonic::client::Grpc::with_origin(inner, origin);
50
- Self { inner }
51
- }
52
- pub fn with_interceptor<F>(
53
- inner: T,
54
- interceptor: F,
55
- ) -> DriveInternalClient<InterceptedService<T, F>>
56
- where
57
- F: tonic::service::Interceptor,
58
- T::ResponseBody: Default,
59
- T: tonic::codegen::Service<
60
- http::Request<tonic::body::Body>,
61
- Response = http::Response<
62
- <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
63
- >,
64
- >,
65
- <T as tonic::codegen::Service<
66
- http::Request<tonic::body::Body>,
67
- >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
68
- {
69
- DriveInternalClient::new(InterceptedService::new(inner, interceptor))
70
- }
71
- /// Compress requests with the given encoding.
72
- ///
73
- /// This requires the server to support it otherwise it might respond with an
74
- /// error.
75
- #[must_use]
76
- pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
77
- self.inner = self.inner.send_compressed(encoding);
78
- self
79
- }
80
- /// Enable decompressing responses.
81
- #[must_use]
82
- pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
83
- self.inner = self.inner.accept_compressed(encoding);
84
- self
85
- }
86
- /// Limits the maximum size of a decoded message.
87
- ///
88
- /// Default: `4MB`
89
- #[must_use]
90
- pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
91
- self.inner = self.inner.max_decoding_message_size(limit);
92
- self
93
- }
94
- /// Limits the maximum size of an encoded message.
95
- ///
96
- /// Default: `usize::MAX`
97
- #[must_use]
98
- pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
99
- self.inner = self.inner.max_encoding_message_size(limit);
100
- self
101
- }
102
- pub async fn get_proofs(
103
- &mut self,
104
- request: impl tonic::IntoRequest<super::GetProofsRequest>,
105
- ) -> std::result::Result<
106
- tonic::Response<super::GetProofsResponse>,
107
- tonic::Status,
108
- > {
109
- self.inner
110
- .ready()
111
- .await
112
- .map_err(|e| {
113
- tonic::Status::unknown(
114
- format!("Service was not ready: {}", e.into()),
115
- )
116
- })?;
117
- let codec = tonic_prost::ProstCodec::default();
118
- let path = http::uri::PathAndQuery::from_static(
119
- "/org.dash.platform.drive.v0.DriveInternal/getProofs",
120
- );
121
- let mut req = request.into_request();
122
- req.extensions_mut()
123
- .insert(
124
- GrpcMethod::new(
125
- "org.dash.platform.drive.v0.DriveInternal",
126
- "getProofs",
127
- ),
128
- );
129
- self.inner.unary(req, path, codec).await
130
- }
131
- }
132
- }