@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,143 +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 DriveInternalClient<tonic::transport::Channel> {
38
- /// Attempt to create a new client by connecting to a given endpoint.
39
- pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
40
- where
41
- D: TryInto<tonic::transport::Endpoint>,
42
- D::Error: Into<StdError>,
43
- {
44
- let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
45
- Ok(Self::new(conn))
46
- }
47
- }
48
- impl<T> DriveInternalClient<T>
49
- where
50
- T: tonic::client::GrpcService<tonic::body::Body>,
51
- T::Error: Into<StdError>,
52
- T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
53
- <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
54
- {
55
- pub fn new(inner: T) -> Self {
56
- let inner = tonic::client::Grpc::new(inner);
57
- Self { inner }
58
- }
59
- pub fn with_origin(inner: T, origin: Uri) -> Self {
60
- let inner = tonic::client::Grpc::with_origin(inner, origin);
61
- Self { inner }
62
- }
63
- pub fn with_interceptor<F>(
64
- inner: T,
65
- interceptor: F,
66
- ) -> DriveInternalClient<InterceptedService<T, F>>
67
- where
68
- F: tonic::service::Interceptor,
69
- T::ResponseBody: Default,
70
- T: tonic::codegen::Service<
71
- http::Request<tonic::body::Body>,
72
- Response = http::Response<
73
- <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
74
- >,
75
- >,
76
- <T as tonic::codegen::Service<
77
- http::Request<tonic::body::Body>,
78
- >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
79
- {
80
- DriveInternalClient::new(InterceptedService::new(inner, interceptor))
81
- }
82
- /// Compress requests with the given encoding.
83
- ///
84
- /// This requires the server to support it otherwise it might respond with an
85
- /// error.
86
- #[must_use]
87
- pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
88
- self.inner = self.inner.send_compressed(encoding);
89
- self
90
- }
91
- /// Enable decompressing responses.
92
- #[must_use]
93
- pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
94
- self.inner = self.inner.accept_compressed(encoding);
95
- self
96
- }
97
- /// Limits the maximum size of a decoded message.
98
- ///
99
- /// Default: `4MB`
100
- #[must_use]
101
- pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
102
- self.inner = self.inner.max_decoding_message_size(limit);
103
- self
104
- }
105
- /// Limits the maximum size of an encoded message.
106
- ///
107
- /// Default: `usize::MAX`
108
- #[must_use]
109
- pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
110
- self.inner = self.inner.max_encoding_message_size(limit);
111
- self
112
- }
113
- pub async fn get_proofs(
114
- &mut self,
115
- request: impl tonic::IntoRequest<super::GetProofsRequest>,
116
- ) -> std::result::Result<
117
- tonic::Response<super::GetProofsResponse>,
118
- tonic::Status,
119
- > {
120
- self.inner
121
- .ready()
122
- .await
123
- .map_err(|e| {
124
- tonic::Status::unknown(
125
- format!("Service was not ready: {}", e.into()),
126
- )
127
- })?;
128
- let codec = tonic_prost::ProstCodec::default();
129
- let path = http::uri::PathAndQuery::from_static(
130
- "/org.dash.platform.drive.v0.DriveInternal/getProofs",
131
- );
132
- let mut req = request.into_request();
133
- req.extensions_mut()
134
- .insert(
135
- GrpcMethod::new(
136
- "org.dash.platform.drive.v0.DriveInternal",
137
- "getProofs",
138
- ),
139
- );
140
- self.inner.unary(req, path, codec).await
141
- }
142
- }
143
- }