@dashevo/dapi-grpc 1.0.0-pr.1694.5 → 1.0.0-pr.1694.6
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.
package/Cargo.toml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "dapi-grpc"
|
|
3
3
|
description = "GRPC client for Dash Platform"
|
|
4
|
-
version = "1.0.0-pr.1694.
|
|
4
|
+
version = "1.0.0-pr.1694.6"
|
|
5
5
|
authors = [
|
|
6
6
|
"Samuel Westrich <sam@dash.org>",
|
|
7
7
|
"Igor Markin <igor.markin@dash.org>",
|
|
@@ -20,19 +20,21 @@ platform = []
|
|
|
20
20
|
# Re-export Dash Platform protobuf types as `dapi_grpc::platform::proto`
|
|
21
21
|
tenderdash-proto = []
|
|
22
22
|
client = ["tonic/channel", "tonic/tls", "tonic/tls-roots", "platform"]
|
|
23
|
+
server = ["tonic/channel", "tonic/tls", "tonic/tls-roots", "platform"]
|
|
23
24
|
serde = ["dep:serde", "dep:serde_bytes"]
|
|
24
25
|
mocks = ["dep:serde_json"]
|
|
25
26
|
|
|
26
27
|
[dependencies]
|
|
27
|
-
prost = { version = "0.
|
|
28
|
-
|
|
28
|
+
prost = { version = "0.12.3" }
|
|
29
|
+
futures-core = "0.3.30"
|
|
30
|
+
tonic = { version = "0.11", features = [
|
|
29
31
|
"codegen",
|
|
30
32
|
"prost",
|
|
31
33
|
], default-features = false }
|
|
32
34
|
serde = { version = "1.0.171", optional = true, features = ["derive"] }
|
|
33
35
|
serde_bytes = { version = "0.11.12", optional = true }
|
|
34
36
|
serde_json = { version = "1.0", optional = true }
|
|
35
|
-
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci",
|
|
37
|
+
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", rev = "271dc51ea60625b3503a09e58882e680ade9da8c", features = ["grpc-server"] }
|
|
36
38
|
dapi-grpc-macros = { path = "../rs-dapi-grpc-macros" }
|
|
37
39
|
platform-version = { path = "../rs-platform-version" }
|
|
38
40
|
|
package/build.rs
CHANGED
|
@@ -160,16 +160,16 @@ impl MappingConfig {
|
|
|
160
160
|
let protobuf_file = abs_path(&protobuf_file);
|
|
161
161
|
let out_dir = abs_path(&out_dir);
|
|
162
162
|
|
|
163
|
+
let build_server = cfg!(feature = "server");
|
|
164
|
+
let build_client = cfg!(feature = "client");
|
|
165
|
+
|
|
163
166
|
let builder = tonic_build::configure()
|
|
164
|
-
.build_server(
|
|
167
|
+
.build_server(build_server)
|
|
168
|
+
.build_client(build_client)
|
|
169
|
+
.build_transport(build_server || build_client)
|
|
165
170
|
.out_dir(out_dir.clone())
|
|
166
171
|
.protoc_arg("--experimental_allow_proto3_optional");
|
|
167
172
|
|
|
168
|
-
#[cfg(feature = "client")]
|
|
169
|
-
let builder = builder.build_client(true).build_transport(true);
|
|
170
|
-
#[cfg(not(feature = "client"))]
|
|
171
|
-
let builder = builder.build_client(false).build_transport(false);
|
|
172
|
-
|
|
173
173
|
Self {
|
|
174
174
|
protobuf_file,
|
|
175
175
|
out_dir,
|
|
@@ -48,6 +48,8 @@ const {
|
|
|
48
48
|
PBJSGetProtocolVersionUpgradeVoteStatusResponse,
|
|
49
49
|
GetProtocolVersionUpgradeStateRequest: PBJSGetProtocolVersionUpgradeStateRequest,
|
|
50
50
|
GetProtocolVersionUpgradeStateResponse: PBJSGetProtocolVersionUpgradeStateResponse,
|
|
51
|
+
GetProofsRequest: PBJSGetProofsRequest,
|
|
52
|
+
GetProofsResponse: PBJSGetProofsResponse,
|
|
51
53
|
},
|
|
52
54
|
},
|
|
53
55
|
},
|
|
@@ -67,6 +69,7 @@ const {
|
|
|
67
69
|
GetEpochsInfoResponse: ProtocGetEpochsInfoResponse,
|
|
68
70
|
GetProtocolVersionUpgradeVoteStatusResponse: ProtocGetProtocolVersionUpgradeVoteStatusResponse,
|
|
69
71
|
GetProtocolVersionUpgradeStateResponse: ProtocGetProtocolVersionUpgradeStateResponse,
|
|
72
|
+
GetProofsResponse: ProtocGetProofsResponse,
|
|
70
73
|
} = require('./platform_protoc');
|
|
71
74
|
|
|
72
75
|
const getPlatformDefinition = require('../../../../lib/getPlatformDefinition');
|
|
@@ -137,6 +140,10 @@ class PlatformPromiseClient {
|
|
|
137
140
|
this.client.getProtocolVersionUpgradeState.bind(this.client),
|
|
138
141
|
);
|
|
139
142
|
|
|
143
|
+
this.client.getProofs = promisify(
|
|
144
|
+
this.client.getProofs.bind(this.client),
|
|
145
|
+
);
|
|
146
|
+
|
|
140
147
|
this.protocolVersion = undefined;
|
|
141
148
|
}
|
|
142
149
|
|
|
@@ -496,6 +503,38 @@ class PlatformPromiseClient {
|
|
|
496
503
|
);
|
|
497
504
|
}
|
|
498
505
|
|
|
506
|
+
/**
|
|
507
|
+
*
|
|
508
|
+
* @param {!GetProofsRequest} request
|
|
509
|
+
* @param {?Object<string, string>} metadata
|
|
510
|
+
* @param {CallOptions} [options={}]
|
|
511
|
+
* @returns {Promise<!GetProofsResponse>}
|
|
512
|
+
*/
|
|
513
|
+
getProofs(request, metadata = {}, options = {}) {
|
|
514
|
+
if (!isObject(metadata)) {
|
|
515
|
+
throw new Error('metadata must be an object');
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return this.client.getProofs(
|
|
519
|
+
request,
|
|
520
|
+
convertObjectToMetadata(metadata),
|
|
521
|
+
{
|
|
522
|
+
interceptors: [
|
|
523
|
+
jsonToProtobufInterceptorFactory(
|
|
524
|
+
jsonToProtobufFactory(
|
|
525
|
+
ProtocGetProofsResponse,
|
|
526
|
+
PBJSGetProofsResponse,
|
|
527
|
+
),
|
|
528
|
+
protobufToJsonFactory(
|
|
529
|
+
PBJSGetProofsRequest,
|
|
530
|
+
),
|
|
531
|
+
),
|
|
532
|
+
],
|
|
533
|
+
...options,
|
|
534
|
+
},
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
|
|
499
538
|
/**
|
|
500
539
|
* @param {string} protocolVersion
|
|
501
540
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "1.0.0-pr.1694.
|
|
3
|
+
"version": "1.0.0-pr.1694.6",
|
|
4
4
|
"description": "DAPI GRPC definition file and generated clients",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "node.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/dashevo/dapi-grpc#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@dashevo/grpc-common": "1.0.0-pr.1694.
|
|
48
|
+
"@dashevo/grpc-common": "1.0.0-pr.1694.6",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "1.4.4",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -2583,3 +2583,1107 @@ pub mod platform_client {
|
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
2585
|
}
|
|
2586
|
+
/// Generated server implementations.
|
|
2587
|
+
pub mod platform_server {
|
|
2588
|
+
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
|
|
2589
|
+
use tonic::codegen::*;
|
|
2590
|
+
/// Generated trait containing gRPC methods that should be implemented for use with PlatformServer.
|
|
2591
|
+
#[async_trait]
|
|
2592
|
+
pub trait Platform: Send + Sync + 'static {
|
|
2593
|
+
async fn broadcast_state_transition(
|
|
2594
|
+
&self,
|
|
2595
|
+
request: tonic::Request<super::BroadcastStateTransitionRequest>,
|
|
2596
|
+
) -> std::result::Result<
|
|
2597
|
+
tonic::Response<super::BroadcastStateTransitionResponse>,
|
|
2598
|
+
tonic::Status,
|
|
2599
|
+
>;
|
|
2600
|
+
async fn get_identity(
|
|
2601
|
+
&self,
|
|
2602
|
+
request: tonic::Request<super::GetIdentityRequest>,
|
|
2603
|
+
) -> std::result::Result<
|
|
2604
|
+
tonic::Response<super::GetIdentityResponse>,
|
|
2605
|
+
tonic::Status,
|
|
2606
|
+
>;
|
|
2607
|
+
async fn get_identities(
|
|
2608
|
+
&self,
|
|
2609
|
+
request: tonic::Request<super::GetIdentitiesRequest>,
|
|
2610
|
+
) -> std::result::Result<
|
|
2611
|
+
tonic::Response<super::GetIdentitiesResponse>,
|
|
2612
|
+
tonic::Status,
|
|
2613
|
+
>;
|
|
2614
|
+
async fn get_identity_keys(
|
|
2615
|
+
&self,
|
|
2616
|
+
request: tonic::Request<super::GetIdentityKeysRequest>,
|
|
2617
|
+
) -> std::result::Result<
|
|
2618
|
+
tonic::Response<super::GetIdentityKeysResponse>,
|
|
2619
|
+
tonic::Status,
|
|
2620
|
+
>;
|
|
2621
|
+
async fn get_identity_balance(
|
|
2622
|
+
&self,
|
|
2623
|
+
request: tonic::Request<super::GetIdentityBalanceRequest>,
|
|
2624
|
+
) -> std::result::Result<
|
|
2625
|
+
tonic::Response<super::GetIdentityBalanceResponse>,
|
|
2626
|
+
tonic::Status,
|
|
2627
|
+
>;
|
|
2628
|
+
async fn get_identity_balance_and_revision(
|
|
2629
|
+
&self,
|
|
2630
|
+
request: tonic::Request<super::GetIdentityBalanceAndRevisionRequest>,
|
|
2631
|
+
) -> std::result::Result<
|
|
2632
|
+
tonic::Response<super::GetIdentityBalanceAndRevisionResponse>,
|
|
2633
|
+
tonic::Status,
|
|
2634
|
+
>;
|
|
2635
|
+
async fn get_proofs(
|
|
2636
|
+
&self,
|
|
2637
|
+
request: tonic::Request<super::GetProofsRequest>,
|
|
2638
|
+
) -> std::result::Result<
|
|
2639
|
+
tonic::Response<super::GetProofsResponse>,
|
|
2640
|
+
tonic::Status,
|
|
2641
|
+
>;
|
|
2642
|
+
async fn get_data_contract(
|
|
2643
|
+
&self,
|
|
2644
|
+
request: tonic::Request<super::GetDataContractRequest>,
|
|
2645
|
+
) -> std::result::Result<
|
|
2646
|
+
tonic::Response<super::GetDataContractResponse>,
|
|
2647
|
+
tonic::Status,
|
|
2648
|
+
>;
|
|
2649
|
+
async fn get_data_contract_history(
|
|
2650
|
+
&self,
|
|
2651
|
+
request: tonic::Request<super::GetDataContractHistoryRequest>,
|
|
2652
|
+
) -> std::result::Result<
|
|
2653
|
+
tonic::Response<super::GetDataContractHistoryResponse>,
|
|
2654
|
+
tonic::Status,
|
|
2655
|
+
>;
|
|
2656
|
+
async fn get_data_contracts(
|
|
2657
|
+
&self,
|
|
2658
|
+
request: tonic::Request<super::GetDataContractsRequest>,
|
|
2659
|
+
) -> std::result::Result<
|
|
2660
|
+
tonic::Response<super::GetDataContractsResponse>,
|
|
2661
|
+
tonic::Status,
|
|
2662
|
+
>;
|
|
2663
|
+
async fn get_documents(
|
|
2664
|
+
&self,
|
|
2665
|
+
request: tonic::Request<super::GetDocumentsRequest>,
|
|
2666
|
+
) -> std::result::Result<
|
|
2667
|
+
tonic::Response<super::GetDocumentsResponse>,
|
|
2668
|
+
tonic::Status,
|
|
2669
|
+
>;
|
|
2670
|
+
async fn get_identities_by_public_key_hashes(
|
|
2671
|
+
&self,
|
|
2672
|
+
request: tonic::Request<super::GetIdentitiesByPublicKeyHashesRequest>,
|
|
2673
|
+
) -> std::result::Result<
|
|
2674
|
+
tonic::Response<super::GetIdentitiesByPublicKeyHashesResponse>,
|
|
2675
|
+
tonic::Status,
|
|
2676
|
+
>;
|
|
2677
|
+
async fn get_identity_by_public_key_hash(
|
|
2678
|
+
&self,
|
|
2679
|
+
request: tonic::Request<super::GetIdentityByPublicKeyHashRequest>,
|
|
2680
|
+
) -> std::result::Result<
|
|
2681
|
+
tonic::Response<super::GetIdentityByPublicKeyHashResponse>,
|
|
2682
|
+
tonic::Status,
|
|
2683
|
+
>;
|
|
2684
|
+
async fn wait_for_state_transition_result(
|
|
2685
|
+
&self,
|
|
2686
|
+
request: tonic::Request<super::WaitForStateTransitionResultRequest>,
|
|
2687
|
+
) -> std::result::Result<
|
|
2688
|
+
tonic::Response<super::WaitForStateTransitionResultResponse>,
|
|
2689
|
+
tonic::Status,
|
|
2690
|
+
>;
|
|
2691
|
+
async fn get_consensus_params(
|
|
2692
|
+
&self,
|
|
2693
|
+
request: tonic::Request<super::GetConsensusParamsRequest>,
|
|
2694
|
+
) -> std::result::Result<
|
|
2695
|
+
tonic::Response<super::GetConsensusParamsResponse>,
|
|
2696
|
+
tonic::Status,
|
|
2697
|
+
>;
|
|
2698
|
+
async fn get_protocol_version_upgrade_state(
|
|
2699
|
+
&self,
|
|
2700
|
+
request: tonic::Request<super::GetProtocolVersionUpgradeStateRequest>,
|
|
2701
|
+
) -> std::result::Result<
|
|
2702
|
+
tonic::Response<super::GetProtocolVersionUpgradeStateResponse>,
|
|
2703
|
+
tonic::Status,
|
|
2704
|
+
>;
|
|
2705
|
+
async fn get_protocol_version_upgrade_vote_status(
|
|
2706
|
+
&self,
|
|
2707
|
+
request: tonic::Request<super::GetProtocolVersionUpgradeVoteStatusRequest>,
|
|
2708
|
+
) -> std::result::Result<
|
|
2709
|
+
tonic::Response<super::GetProtocolVersionUpgradeVoteStatusResponse>,
|
|
2710
|
+
tonic::Status,
|
|
2711
|
+
>;
|
|
2712
|
+
async fn get_epochs_info(
|
|
2713
|
+
&self,
|
|
2714
|
+
request: tonic::Request<super::GetEpochsInfoRequest>,
|
|
2715
|
+
) -> std::result::Result<
|
|
2716
|
+
tonic::Response<super::GetEpochsInfoResponse>,
|
|
2717
|
+
tonic::Status,
|
|
2718
|
+
>;
|
|
2719
|
+
}
|
|
2720
|
+
#[derive(Debug)]
|
|
2721
|
+
pub struct PlatformServer<T: Platform> {
|
|
2722
|
+
inner: _Inner<T>,
|
|
2723
|
+
accept_compression_encodings: EnabledCompressionEncodings,
|
|
2724
|
+
send_compression_encodings: EnabledCompressionEncodings,
|
|
2725
|
+
max_decoding_message_size: Option<usize>,
|
|
2726
|
+
max_encoding_message_size: Option<usize>,
|
|
2727
|
+
}
|
|
2728
|
+
struct _Inner<T>(Arc<T>);
|
|
2729
|
+
impl<T: Platform> PlatformServer<T> {
|
|
2730
|
+
pub fn new(inner: T) -> Self {
|
|
2731
|
+
Self::from_arc(Arc::new(inner))
|
|
2732
|
+
}
|
|
2733
|
+
pub fn from_arc(inner: Arc<T>) -> Self {
|
|
2734
|
+
let inner = _Inner(inner);
|
|
2735
|
+
Self {
|
|
2736
|
+
inner,
|
|
2737
|
+
accept_compression_encodings: Default::default(),
|
|
2738
|
+
send_compression_encodings: Default::default(),
|
|
2739
|
+
max_decoding_message_size: None,
|
|
2740
|
+
max_encoding_message_size: None,
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
pub fn with_interceptor<F>(
|
|
2744
|
+
inner: T,
|
|
2745
|
+
interceptor: F,
|
|
2746
|
+
) -> InterceptedService<Self, F>
|
|
2747
|
+
where
|
|
2748
|
+
F: tonic::service::Interceptor,
|
|
2749
|
+
{
|
|
2750
|
+
InterceptedService::new(Self::new(inner), interceptor)
|
|
2751
|
+
}
|
|
2752
|
+
/// Enable decompressing requests with the given encoding.
|
|
2753
|
+
#[must_use]
|
|
2754
|
+
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
|
2755
|
+
self.accept_compression_encodings.enable(encoding);
|
|
2756
|
+
self
|
|
2757
|
+
}
|
|
2758
|
+
/// Compress responses with the given encoding, if the client supports it.
|
|
2759
|
+
#[must_use]
|
|
2760
|
+
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
|
2761
|
+
self.send_compression_encodings.enable(encoding);
|
|
2762
|
+
self
|
|
2763
|
+
}
|
|
2764
|
+
/// Limits the maximum size of a decoded message.
|
|
2765
|
+
///
|
|
2766
|
+
/// Default: `4MB`
|
|
2767
|
+
#[must_use]
|
|
2768
|
+
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
|
|
2769
|
+
self.max_decoding_message_size = Some(limit);
|
|
2770
|
+
self
|
|
2771
|
+
}
|
|
2772
|
+
/// Limits the maximum size of an encoded message.
|
|
2773
|
+
///
|
|
2774
|
+
/// Default: `usize::MAX`
|
|
2775
|
+
#[must_use]
|
|
2776
|
+
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
|
|
2777
|
+
self.max_encoding_message_size = Some(limit);
|
|
2778
|
+
self
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
impl<T, B> tonic::codegen::Service<http::Request<B>> for PlatformServer<T>
|
|
2782
|
+
where
|
|
2783
|
+
T: Platform,
|
|
2784
|
+
B: Body + Send + 'static,
|
|
2785
|
+
B::Error: Into<StdError> + Send + 'static,
|
|
2786
|
+
{
|
|
2787
|
+
type Response = http::Response<tonic::body::BoxBody>;
|
|
2788
|
+
type Error = std::convert::Infallible;
|
|
2789
|
+
type Future = BoxFuture<Self::Response, Self::Error>;
|
|
2790
|
+
fn poll_ready(
|
|
2791
|
+
&mut self,
|
|
2792
|
+
_cx: &mut Context<'_>,
|
|
2793
|
+
) -> Poll<std::result::Result<(), Self::Error>> {
|
|
2794
|
+
Poll::Ready(Ok(()))
|
|
2795
|
+
}
|
|
2796
|
+
fn call(&mut self, req: http::Request<B>) -> Self::Future {
|
|
2797
|
+
let inner = self.inner.clone();
|
|
2798
|
+
match req.uri().path() {
|
|
2799
|
+
"/org.dash.platform.dapi.v0.Platform/broadcastStateTransition" => {
|
|
2800
|
+
#[allow(non_camel_case_types)]
|
|
2801
|
+
struct broadcastStateTransitionSvc<T: Platform>(pub Arc<T>);
|
|
2802
|
+
impl<
|
|
2803
|
+
T: Platform,
|
|
2804
|
+
> tonic::server::UnaryService<super::BroadcastStateTransitionRequest>
|
|
2805
|
+
for broadcastStateTransitionSvc<T> {
|
|
2806
|
+
type Response = super::BroadcastStateTransitionResponse;
|
|
2807
|
+
type Future = BoxFuture<
|
|
2808
|
+
tonic::Response<Self::Response>,
|
|
2809
|
+
tonic::Status,
|
|
2810
|
+
>;
|
|
2811
|
+
fn call(
|
|
2812
|
+
&mut self,
|
|
2813
|
+
request: tonic::Request<
|
|
2814
|
+
super::BroadcastStateTransitionRequest,
|
|
2815
|
+
>,
|
|
2816
|
+
) -> Self::Future {
|
|
2817
|
+
let inner = Arc::clone(&self.0);
|
|
2818
|
+
let fut = async move {
|
|
2819
|
+
(*inner).broadcast_state_transition(request).await
|
|
2820
|
+
};
|
|
2821
|
+
Box::pin(fut)
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
2825
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
2826
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
2827
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
2828
|
+
let inner = self.inner.clone();
|
|
2829
|
+
let fut = async move {
|
|
2830
|
+
let inner = inner.0;
|
|
2831
|
+
let method = broadcastStateTransitionSvc(inner);
|
|
2832
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
2833
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
2834
|
+
.apply_compression_config(
|
|
2835
|
+
accept_compression_encodings,
|
|
2836
|
+
send_compression_encodings,
|
|
2837
|
+
)
|
|
2838
|
+
.apply_max_message_size_config(
|
|
2839
|
+
max_decoding_message_size,
|
|
2840
|
+
max_encoding_message_size,
|
|
2841
|
+
);
|
|
2842
|
+
let res = grpc.unary(method, req).await;
|
|
2843
|
+
Ok(res)
|
|
2844
|
+
};
|
|
2845
|
+
Box::pin(fut)
|
|
2846
|
+
}
|
|
2847
|
+
"/org.dash.platform.dapi.v0.Platform/getIdentity" => {
|
|
2848
|
+
#[allow(non_camel_case_types)]
|
|
2849
|
+
struct getIdentitySvc<T: Platform>(pub Arc<T>);
|
|
2850
|
+
impl<
|
|
2851
|
+
T: Platform,
|
|
2852
|
+
> tonic::server::UnaryService<super::GetIdentityRequest>
|
|
2853
|
+
for getIdentitySvc<T> {
|
|
2854
|
+
type Response = super::GetIdentityResponse;
|
|
2855
|
+
type Future = BoxFuture<
|
|
2856
|
+
tonic::Response<Self::Response>,
|
|
2857
|
+
tonic::Status,
|
|
2858
|
+
>;
|
|
2859
|
+
fn call(
|
|
2860
|
+
&mut self,
|
|
2861
|
+
request: tonic::Request<super::GetIdentityRequest>,
|
|
2862
|
+
) -> Self::Future {
|
|
2863
|
+
let inner = Arc::clone(&self.0);
|
|
2864
|
+
let fut = async move {
|
|
2865
|
+
(*inner).get_identity(request).await
|
|
2866
|
+
};
|
|
2867
|
+
Box::pin(fut)
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
2871
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
2872
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
2873
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
2874
|
+
let inner = self.inner.clone();
|
|
2875
|
+
let fut = async move {
|
|
2876
|
+
let inner = inner.0;
|
|
2877
|
+
let method = getIdentitySvc(inner);
|
|
2878
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
2879
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
2880
|
+
.apply_compression_config(
|
|
2881
|
+
accept_compression_encodings,
|
|
2882
|
+
send_compression_encodings,
|
|
2883
|
+
)
|
|
2884
|
+
.apply_max_message_size_config(
|
|
2885
|
+
max_decoding_message_size,
|
|
2886
|
+
max_encoding_message_size,
|
|
2887
|
+
);
|
|
2888
|
+
let res = grpc.unary(method, req).await;
|
|
2889
|
+
Ok(res)
|
|
2890
|
+
};
|
|
2891
|
+
Box::pin(fut)
|
|
2892
|
+
}
|
|
2893
|
+
"/org.dash.platform.dapi.v0.Platform/getIdentities" => {
|
|
2894
|
+
#[allow(non_camel_case_types)]
|
|
2895
|
+
struct getIdentitiesSvc<T: Platform>(pub Arc<T>);
|
|
2896
|
+
impl<
|
|
2897
|
+
T: Platform,
|
|
2898
|
+
> tonic::server::UnaryService<super::GetIdentitiesRequest>
|
|
2899
|
+
for getIdentitiesSvc<T> {
|
|
2900
|
+
type Response = super::GetIdentitiesResponse;
|
|
2901
|
+
type Future = BoxFuture<
|
|
2902
|
+
tonic::Response<Self::Response>,
|
|
2903
|
+
tonic::Status,
|
|
2904
|
+
>;
|
|
2905
|
+
fn call(
|
|
2906
|
+
&mut self,
|
|
2907
|
+
request: tonic::Request<super::GetIdentitiesRequest>,
|
|
2908
|
+
) -> Self::Future {
|
|
2909
|
+
let inner = Arc::clone(&self.0);
|
|
2910
|
+
let fut = async move {
|
|
2911
|
+
(*inner).get_identities(request).await
|
|
2912
|
+
};
|
|
2913
|
+
Box::pin(fut)
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
2917
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
2918
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
2919
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
2920
|
+
let inner = self.inner.clone();
|
|
2921
|
+
let fut = async move {
|
|
2922
|
+
let inner = inner.0;
|
|
2923
|
+
let method = getIdentitiesSvc(inner);
|
|
2924
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
2925
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
2926
|
+
.apply_compression_config(
|
|
2927
|
+
accept_compression_encodings,
|
|
2928
|
+
send_compression_encodings,
|
|
2929
|
+
)
|
|
2930
|
+
.apply_max_message_size_config(
|
|
2931
|
+
max_decoding_message_size,
|
|
2932
|
+
max_encoding_message_size,
|
|
2933
|
+
);
|
|
2934
|
+
let res = grpc.unary(method, req).await;
|
|
2935
|
+
Ok(res)
|
|
2936
|
+
};
|
|
2937
|
+
Box::pin(fut)
|
|
2938
|
+
}
|
|
2939
|
+
"/org.dash.platform.dapi.v0.Platform/getIdentityKeys" => {
|
|
2940
|
+
#[allow(non_camel_case_types)]
|
|
2941
|
+
struct getIdentityKeysSvc<T: Platform>(pub Arc<T>);
|
|
2942
|
+
impl<
|
|
2943
|
+
T: Platform,
|
|
2944
|
+
> tonic::server::UnaryService<super::GetIdentityKeysRequest>
|
|
2945
|
+
for getIdentityKeysSvc<T> {
|
|
2946
|
+
type Response = super::GetIdentityKeysResponse;
|
|
2947
|
+
type Future = BoxFuture<
|
|
2948
|
+
tonic::Response<Self::Response>,
|
|
2949
|
+
tonic::Status,
|
|
2950
|
+
>;
|
|
2951
|
+
fn call(
|
|
2952
|
+
&mut self,
|
|
2953
|
+
request: tonic::Request<super::GetIdentityKeysRequest>,
|
|
2954
|
+
) -> Self::Future {
|
|
2955
|
+
let inner = Arc::clone(&self.0);
|
|
2956
|
+
let fut = async move {
|
|
2957
|
+
(*inner).get_identity_keys(request).await
|
|
2958
|
+
};
|
|
2959
|
+
Box::pin(fut)
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
2963
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
2964
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
2965
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
2966
|
+
let inner = self.inner.clone();
|
|
2967
|
+
let fut = async move {
|
|
2968
|
+
let inner = inner.0;
|
|
2969
|
+
let method = getIdentityKeysSvc(inner);
|
|
2970
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
2971
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
2972
|
+
.apply_compression_config(
|
|
2973
|
+
accept_compression_encodings,
|
|
2974
|
+
send_compression_encodings,
|
|
2975
|
+
)
|
|
2976
|
+
.apply_max_message_size_config(
|
|
2977
|
+
max_decoding_message_size,
|
|
2978
|
+
max_encoding_message_size,
|
|
2979
|
+
);
|
|
2980
|
+
let res = grpc.unary(method, req).await;
|
|
2981
|
+
Ok(res)
|
|
2982
|
+
};
|
|
2983
|
+
Box::pin(fut)
|
|
2984
|
+
}
|
|
2985
|
+
"/org.dash.platform.dapi.v0.Platform/getIdentityBalance" => {
|
|
2986
|
+
#[allow(non_camel_case_types)]
|
|
2987
|
+
struct getIdentityBalanceSvc<T: Platform>(pub Arc<T>);
|
|
2988
|
+
impl<
|
|
2989
|
+
T: Platform,
|
|
2990
|
+
> tonic::server::UnaryService<super::GetIdentityBalanceRequest>
|
|
2991
|
+
for getIdentityBalanceSvc<T> {
|
|
2992
|
+
type Response = super::GetIdentityBalanceResponse;
|
|
2993
|
+
type Future = BoxFuture<
|
|
2994
|
+
tonic::Response<Self::Response>,
|
|
2995
|
+
tonic::Status,
|
|
2996
|
+
>;
|
|
2997
|
+
fn call(
|
|
2998
|
+
&mut self,
|
|
2999
|
+
request: tonic::Request<super::GetIdentityBalanceRequest>,
|
|
3000
|
+
) -> Self::Future {
|
|
3001
|
+
let inner = Arc::clone(&self.0);
|
|
3002
|
+
let fut = async move {
|
|
3003
|
+
(*inner).get_identity_balance(request).await
|
|
3004
|
+
};
|
|
3005
|
+
Box::pin(fut)
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3009
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3010
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3011
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3012
|
+
let inner = self.inner.clone();
|
|
3013
|
+
let fut = async move {
|
|
3014
|
+
let inner = inner.0;
|
|
3015
|
+
let method = getIdentityBalanceSvc(inner);
|
|
3016
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3017
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3018
|
+
.apply_compression_config(
|
|
3019
|
+
accept_compression_encodings,
|
|
3020
|
+
send_compression_encodings,
|
|
3021
|
+
)
|
|
3022
|
+
.apply_max_message_size_config(
|
|
3023
|
+
max_decoding_message_size,
|
|
3024
|
+
max_encoding_message_size,
|
|
3025
|
+
);
|
|
3026
|
+
let res = grpc.unary(method, req).await;
|
|
3027
|
+
Ok(res)
|
|
3028
|
+
};
|
|
3029
|
+
Box::pin(fut)
|
|
3030
|
+
}
|
|
3031
|
+
"/org.dash.platform.dapi.v0.Platform/getIdentityBalanceAndRevision" => {
|
|
3032
|
+
#[allow(non_camel_case_types)]
|
|
3033
|
+
struct getIdentityBalanceAndRevisionSvc<T: Platform>(pub Arc<T>);
|
|
3034
|
+
impl<
|
|
3035
|
+
T: Platform,
|
|
3036
|
+
> tonic::server::UnaryService<
|
|
3037
|
+
super::GetIdentityBalanceAndRevisionRequest,
|
|
3038
|
+
> for getIdentityBalanceAndRevisionSvc<T> {
|
|
3039
|
+
type Response = super::GetIdentityBalanceAndRevisionResponse;
|
|
3040
|
+
type Future = BoxFuture<
|
|
3041
|
+
tonic::Response<Self::Response>,
|
|
3042
|
+
tonic::Status,
|
|
3043
|
+
>;
|
|
3044
|
+
fn call(
|
|
3045
|
+
&mut self,
|
|
3046
|
+
request: tonic::Request<
|
|
3047
|
+
super::GetIdentityBalanceAndRevisionRequest,
|
|
3048
|
+
>,
|
|
3049
|
+
) -> Self::Future {
|
|
3050
|
+
let inner = Arc::clone(&self.0);
|
|
3051
|
+
let fut = async move {
|
|
3052
|
+
(*inner).get_identity_balance_and_revision(request).await
|
|
3053
|
+
};
|
|
3054
|
+
Box::pin(fut)
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3058
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3059
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3060
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3061
|
+
let inner = self.inner.clone();
|
|
3062
|
+
let fut = async move {
|
|
3063
|
+
let inner = inner.0;
|
|
3064
|
+
let method = getIdentityBalanceAndRevisionSvc(inner);
|
|
3065
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3066
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3067
|
+
.apply_compression_config(
|
|
3068
|
+
accept_compression_encodings,
|
|
3069
|
+
send_compression_encodings,
|
|
3070
|
+
)
|
|
3071
|
+
.apply_max_message_size_config(
|
|
3072
|
+
max_decoding_message_size,
|
|
3073
|
+
max_encoding_message_size,
|
|
3074
|
+
);
|
|
3075
|
+
let res = grpc.unary(method, req).await;
|
|
3076
|
+
Ok(res)
|
|
3077
|
+
};
|
|
3078
|
+
Box::pin(fut)
|
|
3079
|
+
}
|
|
3080
|
+
"/org.dash.platform.dapi.v0.Platform/getProofs" => {
|
|
3081
|
+
#[allow(non_camel_case_types)]
|
|
3082
|
+
struct getProofsSvc<T: Platform>(pub Arc<T>);
|
|
3083
|
+
impl<
|
|
3084
|
+
T: Platform,
|
|
3085
|
+
> tonic::server::UnaryService<super::GetProofsRequest>
|
|
3086
|
+
for getProofsSvc<T> {
|
|
3087
|
+
type Response = super::GetProofsResponse;
|
|
3088
|
+
type Future = BoxFuture<
|
|
3089
|
+
tonic::Response<Self::Response>,
|
|
3090
|
+
tonic::Status,
|
|
3091
|
+
>;
|
|
3092
|
+
fn call(
|
|
3093
|
+
&mut self,
|
|
3094
|
+
request: tonic::Request<super::GetProofsRequest>,
|
|
3095
|
+
) -> Self::Future {
|
|
3096
|
+
let inner = Arc::clone(&self.0);
|
|
3097
|
+
let fut = async move { (*inner).get_proofs(request).await };
|
|
3098
|
+
Box::pin(fut)
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3102
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3103
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3104
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3105
|
+
let inner = self.inner.clone();
|
|
3106
|
+
let fut = async move {
|
|
3107
|
+
let inner = inner.0;
|
|
3108
|
+
let method = getProofsSvc(inner);
|
|
3109
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3110
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3111
|
+
.apply_compression_config(
|
|
3112
|
+
accept_compression_encodings,
|
|
3113
|
+
send_compression_encodings,
|
|
3114
|
+
)
|
|
3115
|
+
.apply_max_message_size_config(
|
|
3116
|
+
max_decoding_message_size,
|
|
3117
|
+
max_encoding_message_size,
|
|
3118
|
+
);
|
|
3119
|
+
let res = grpc.unary(method, req).await;
|
|
3120
|
+
Ok(res)
|
|
3121
|
+
};
|
|
3122
|
+
Box::pin(fut)
|
|
3123
|
+
}
|
|
3124
|
+
"/org.dash.platform.dapi.v0.Platform/getDataContract" => {
|
|
3125
|
+
#[allow(non_camel_case_types)]
|
|
3126
|
+
struct getDataContractSvc<T: Platform>(pub Arc<T>);
|
|
3127
|
+
impl<
|
|
3128
|
+
T: Platform,
|
|
3129
|
+
> tonic::server::UnaryService<super::GetDataContractRequest>
|
|
3130
|
+
for getDataContractSvc<T> {
|
|
3131
|
+
type Response = super::GetDataContractResponse;
|
|
3132
|
+
type Future = BoxFuture<
|
|
3133
|
+
tonic::Response<Self::Response>,
|
|
3134
|
+
tonic::Status,
|
|
3135
|
+
>;
|
|
3136
|
+
fn call(
|
|
3137
|
+
&mut self,
|
|
3138
|
+
request: tonic::Request<super::GetDataContractRequest>,
|
|
3139
|
+
) -> Self::Future {
|
|
3140
|
+
let inner = Arc::clone(&self.0);
|
|
3141
|
+
let fut = async move {
|
|
3142
|
+
(*inner).get_data_contract(request).await
|
|
3143
|
+
};
|
|
3144
|
+
Box::pin(fut)
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3147
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3148
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3149
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3150
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3151
|
+
let inner = self.inner.clone();
|
|
3152
|
+
let fut = async move {
|
|
3153
|
+
let inner = inner.0;
|
|
3154
|
+
let method = getDataContractSvc(inner);
|
|
3155
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3156
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3157
|
+
.apply_compression_config(
|
|
3158
|
+
accept_compression_encodings,
|
|
3159
|
+
send_compression_encodings,
|
|
3160
|
+
)
|
|
3161
|
+
.apply_max_message_size_config(
|
|
3162
|
+
max_decoding_message_size,
|
|
3163
|
+
max_encoding_message_size,
|
|
3164
|
+
);
|
|
3165
|
+
let res = grpc.unary(method, req).await;
|
|
3166
|
+
Ok(res)
|
|
3167
|
+
};
|
|
3168
|
+
Box::pin(fut)
|
|
3169
|
+
}
|
|
3170
|
+
"/org.dash.platform.dapi.v0.Platform/getDataContractHistory" => {
|
|
3171
|
+
#[allow(non_camel_case_types)]
|
|
3172
|
+
struct getDataContractHistorySvc<T: Platform>(pub Arc<T>);
|
|
3173
|
+
impl<
|
|
3174
|
+
T: Platform,
|
|
3175
|
+
> tonic::server::UnaryService<super::GetDataContractHistoryRequest>
|
|
3176
|
+
for getDataContractHistorySvc<T> {
|
|
3177
|
+
type Response = super::GetDataContractHistoryResponse;
|
|
3178
|
+
type Future = BoxFuture<
|
|
3179
|
+
tonic::Response<Self::Response>,
|
|
3180
|
+
tonic::Status,
|
|
3181
|
+
>;
|
|
3182
|
+
fn call(
|
|
3183
|
+
&mut self,
|
|
3184
|
+
request: tonic::Request<super::GetDataContractHistoryRequest>,
|
|
3185
|
+
) -> Self::Future {
|
|
3186
|
+
let inner = Arc::clone(&self.0);
|
|
3187
|
+
let fut = async move {
|
|
3188
|
+
(*inner).get_data_contract_history(request).await
|
|
3189
|
+
};
|
|
3190
|
+
Box::pin(fut)
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3194
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3195
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3196
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3197
|
+
let inner = self.inner.clone();
|
|
3198
|
+
let fut = async move {
|
|
3199
|
+
let inner = inner.0;
|
|
3200
|
+
let method = getDataContractHistorySvc(inner);
|
|
3201
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3202
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3203
|
+
.apply_compression_config(
|
|
3204
|
+
accept_compression_encodings,
|
|
3205
|
+
send_compression_encodings,
|
|
3206
|
+
)
|
|
3207
|
+
.apply_max_message_size_config(
|
|
3208
|
+
max_decoding_message_size,
|
|
3209
|
+
max_encoding_message_size,
|
|
3210
|
+
);
|
|
3211
|
+
let res = grpc.unary(method, req).await;
|
|
3212
|
+
Ok(res)
|
|
3213
|
+
};
|
|
3214
|
+
Box::pin(fut)
|
|
3215
|
+
}
|
|
3216
|
+
"/org.dash.platform.dapi.v0.Platform/getDataContracts" => {
|
|
3217
|
+
#[allow(non_camel_case_types)]
|
|
3218
|
+
struct getDataContractsSvc<T: Platform>(pub Arc<T>);
|
|
3219
|
+
impl<
|
|
3220
|
+
T: Platform,
|
|
3221
|
+
> tonic::server::UnaryService<super::GetDataContractsRequest>
|
|
3222
|
+
for getDataContractsSvc<T> {
|
|
3223
|
+
type Response = super::GetDataContractsResponse;
|
|
3224
|
+
type Future = BoxFuture<
|
|
3225
|
+
tonic::Response<Self::Response>,
|
|
3226
|
+
tonic::Status,
|
|
3227
|
+
>;
|
|
3228
|
+
fn call(
|
|
3229
|
+
&mut self,
|
|
3230
|
+
request: tonic::Request<super::GetDataContractsRequest>,
|
|
3231
|
+
) -> Self::Future {
|
|
3232
|
+
let inner = Arc::clone(&self.0);
|
|
3233
|
+
let fut = async move {
|
|
3234
|
+
(*inner).get_data_contracts(request).await
|
|
3235
|
+
};
|
|
3236
|
+
Box::pin(fut)
|
|
3237
|
+
}
|
|
3238
|
+
}
|
|
3239
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3240
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3241
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3242
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3243
|
+
let inner = self.inner.clone();
|
|
3244
|
+
let fut = async move {
|
|
3245
|
+
let inner = inner.0;
|
|
3246
|
+
let method = getDataContractsSvc(inner);
|
|
3247
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3248
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3249
|
+
.apply_compression_config(
|
|
3250
|
+
accept_compression_encodings,
|
|
3251
|
+
send_compression_encodings,
|
|
3252
|
+
)
|
|
3253
|
+
.apply_max_message_size_config(
|
|
3254
|
+
max_decoding_message_size,
|
|
3255
|
+
max_encoding_message_size,
|
|
3256
|
+
);
|
|
3257
|
+
let res = grpc.unary(method, req).await;
|
|
3258
|
+
Ok(res)
|
|
3259
|
+
};
|
|
3260
|
+
Box::pin(fut)
|
|
3261
|
+
}
|
|
3262
|
+
"/org.dash.platform.dapi.v0.Platform/getDocuments" => {
|
|
3263
|
+
#[allow(non_camel_case_types)]
|
|
3264
|
+
struct getDocumentsSvc<T: Platform>(pub Arc<T>);
|
|
3265
|
+
impl<
|
|
3266
|
+
T: Platform,
|
|
3267
|
+
> tonic::server::UnaryService<super::GetDocumentsRequest>
|
|
3268
|
+
for getDocumentsSvc<T> {
|
|
3269
|
+
type Response = super::GetDocumentsResponse;
|
|
3270
|
+
type Future = BoxFuture<
|
|
3271
|
+
tonic::Response<Self::Response>,
|
|
3272
|
+
tonic::Status,
|
|
3273
|
+
>;
|
|
3274
|
+
fn call(
|
|
3275
|
+
&mut self,
|
|
3276
|
+
request: tonic::Request<super::GetDocumentsRequest>,
|
|
3277
|
+
) -> Self::Future {
|
|
3278
|
+
let inner = Arc::clone(&self.0);
|
|
3279
|
+
let fut = async move {
|
|
3280
|
+
(*inner).get_documents(request).await
|
|
3281
|
+
};
|
|
3282
|
+
Box::pin(fut)
|
|
3283
|
+
}
|
|
3284
|
+
}
|
|
3285
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3286
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3287
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3288
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3289
|
+
let inner = self.inner.clone();
|
|
3290
|
+
let fut = async move {
|
|
3291
|
+
let inner = inner.0;
|
|
3292
|
+
let method = getDocumentsSvc(inner);
|
|
3293
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3294
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3295
|
+
.apply_compression_config(
|
|
3296
|
+
accept_compression_encodings,
|
|
3297
|
+
send_compression_encodings,
|
|
3298
|
+
)
|
|
3299
|
+
.apply_max_message_size_config(
|
|
3300
|
+
max_decoding_message_size,
|
|
3301
|
+
max_encoding_message_size,
|
|
3302
|
+
);
|
|
3303
|
+
let res = grpc.unary(method, req).await;
|
|
3304
|
+
Ok(res)
|
|
3305
|
+
};
|
|
3306
|
+
Box::pin(fut)
|
|
3307
|
+
}
|
|
3308
|
+
"/org.dash.platform.dapi.v0.Platform/getIdentitiesByPublicKeyHashes" => {
|
|
3309
|
+
#[allow(non_camel_case_types)]
|
|
3310
|
+
struct getIdentitiesByPublicKeyHashesSvc<T: Platform>(pub Arc<T>);
|
|
3311
|
+
impl<
|
|
3312
|
+
T: Platform,
|
|
3313
|
+
> tonic::server::UnaryService<
|
|
3314
|
+
super::GetIdentitiesByPublicKeyHashesRequest,
|
|
3315
|
+
> for getIdentitiesByPublicKeyHashesSvc<T> {
|
|
3316
|
+
type Response = super::GetIdentitiesByPublicKeyHashesResponse;
|
|
3317
|
+
type Future = BoxFuture<
|
|
3318
|
+
tonic::Response<Self::Response>,
|
|
3319
|
+
tonic::Status,
|
|
3320
|
+
>;
|
|
3321
|
+
fn call(
|
|
3322
|
+
&mut self,
|
|
3323
|
+
request: tonic::Request<
|
|
3324
|
+
super::GetIdentitiesByPublicKeyHashesRequest,
|
|
3325
|
+
>,
|
|
3326
|
+
) -> Self::Future {
|
|
3327
|
+
let inner = Arc::clone(&self.0);
|
|
3328
|
+
let fut = async move {
|
|
3329
|
+
(*inner).get_identities_by_public_key_hashes(request).await
|
|
3330
|
+
};
|
|
3331
|
+
Box::pin(fut)
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3335
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3336
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3337
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3338
|
+
let inner = self.inner.clone();
|
|
3339
|
+
let fut = async move {
|
|
3340
|
+
let inner = inner.0;
|
|
3341
|
+
let method = getIdentitiesByPublicKeyHashesSvc(inner);
|
|
3342
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3343
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3344
|
+
.apply_compression_config(
|
|
3345
|
+
accept_compression_encodings,
|
|
3346
|
+
send_compression_encodings,
|
|
3347
|
+
)
|
|
3348
|
+
.apply_max_message_size_config(
|
|
3349
|
+
max_decoding_message_size,
|
|
3350
|
+
max_encoding_message_size,
|
|
3351
|
+
);
|
|
3352
|
+
let res = grpc.unary(method, req).await;
|
|
3353
|
+
Ok(res)
|
|
3354
|
+
};
|
|
3355
|
+
Box::pin(fut)
|
|
3356
|
+
}
|
|
3357
|
+
"/org.dash.platform.dapi.v0.Platform/getIdentityByPublicKeyHash" => {
|
|
3358
|
+
#[allow(non_camel_case_types)]
|
|
3359
|
+
struct getIdentityByPublicKeyHashSvc<T: Platform>(pub Arc<T>);
|
|
3360
|
+
impl<
|
|
3361
|
+
T: Platform,
|
|
3362
|
+
> tonic::server::UnaryService<
|
|
3363
|
+
super::GetIdentityByPublicKeyHashRequest,
|
|
3364
|
+
> for getIdentityByPublicKeyHashSvc<T> {
|
|
3365
|
+
type Response = super::GetIdentityByPublicKeyHashResponse;
|
|
3366
|
+
type Future = BoxFuture<
|
|
3367
|
+
tonic::Response<Self::Response>,
|
|
3368
|
+
tonic::Status,
|
|
3369
|
+
>;
|
|
3370
|
+
fn call(
|
|
3371
|
+
&mut self,
|
|
3372
|
+
request: tonic::Request<
|
|
3373
|
+
super::GetIdentityByPublicKeyHashRequest,
|
|
3374
|
+
>,
|
|
3375
|
+
) -> Self::Future {
|
|
3376
|
+
let inner = Arc::clone(&self.0);
|
|
3377
|
+
let fut = async move {
|
|
3378
|
+
(*inner).get_identity_by_public_key_hash(request).await
|
|
3379
|
+
};
|
|
3380
|
+
Box::pin(fut)
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3384
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3385
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3386
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3387
|
+
let inner = self.inner.clone();
|
|
3388
|
+
let fut = async move {
|
|
3389
|
+
let inner = inner.0;
|
|
3390
|
+
let method = getIdentityByPublicKeyHashSvc(inner);
|
|
3391
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3392
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3393
|
+
.apply_compression_config(
|
|
3394
|
+
accept_compression_encodings,
|
|
3395
|
+
send_compression_encodings,
|
|
3396
|
+
)
|
|
3397
|
+
.apply_max_message_size_config(
|
|
3398
|
+
max_decoding_message_size,
|
|
3399
|
+
max_encoding_message_size,
|
|
3400
|
+
);
|
|
3401
|
+
let res = grpc.unary(method, req).await;
|
|
3402
|
+
Ok(res)
|
|
3403
|
+
};
|
|
3404
|
+
Box::pin(fut)
|
|
3405
|
+
}
|
|
3406
|
+
"/org.dash.platform.dapi.v0.Platform/waitForStateTransitionResult" => {
|
|
3407
|
+
#[allow(non_camel_case_types)]
|
|
3408
|
+
struct waitForStateTransitionResultSvc<T: Platform>(pub Arc<T>);
|
|
3409
|
+
impl<
|
|
3410
|
+
T: Platform,
|
|
3411
|
+
> tonic::server::UnaryService<
|
|
3412
|
+
super::WaitForStateTransitionResultRequest,
|
|
3413
|
+
> for waitForStateTransitionResultSvc<T> {
|
|
3414
|
+
type Response = super::WaitForStateTransitionResultResponse;
|
|
3415
|
+
type Future = BoxFuture<
|
|
3416
|
+
tonic::Response<Self::Response>,
|
|
3417
|
+
tonic::Status,
|
|
3418
|
+
>;
|
|
3419
|
+
fn call(
|
|
3420
|
+
&mut self,
|
|
3421
|
+
request: tonic::Request<
|
|
3422
|
+
super::WaitForStateTransitionResultRequest,
|
|
3423
|
+
>,
|
|
3424
|
+
) -> Self::Future {
|
|
3425
|
+
let inner = Arc::clone(&self.0);
|
|
3426
|
+
let fut = async move {
|
|
3427
|
+
(*inner).wait_for_state_transition_result(request).await
|
|
3428
|
+
};
|
|
3429
|
+
Box::pin(fut)
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3433
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3434
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3435
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3436
|
+
let inner = self.inner.clone();
|
|
3437
|
+
let fut = async move {
|
|
3438
|
+
let inner = inner.0;
|
|
3439
|
+
let method = waitForStateTransitionResultSvc(inner);
|
|
3440
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3441
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3442
|
+
.apply_compression_config(
|
|
3443
|
+
accept_compression_encodings,
|
|
3444
|
+
send_compression_encodings,
|
|
3445
|
+
)
|
|
3446
|
+
.apply_max_message_size_config(
|
|
3447
|
+
max_decoding_message_size,
|
|
3448
|
+
max_encoding_message_size,
|
|
3449
|
+
);
|
|
3450
|
+
let res = grpc.unary(method, req).await;
|
|
3451
|
+
Ok(res)
|
|
3452
|
+
};
|
|
3453
|
+
Box::pin(fut)
|
|
3454
|
+
}
|
|
3455
|
+
"/org.dash.platform.dapi.v0.Platform/getConsensusParams" => {
|
|
3456
|
+
#[allow(non_camel_case_types)]
|
|
3457
|
+
struct getConsensusParamsSvc<T: Platform>(pub Arc<T>);
|
|
3458
|
+
impl<
|
|
3459
|
+
T: Platform,
|
|
3460
|
+
> tonic::server::UnaryService<super::GetConsensusParamsRequest>
|
|
3461
|
+
for getConsensusParamsSvc<T> {
|
|
3462
|
+
type Response = super::GetConsensusParamsResponse;
|
|
3463
|
+
type Future = BoxFuture<
|
|
3464
|
+
tonic::Response<Self::Response>,
|
|
3465
|
+
tonic::Status,
|
|
3466
|
+
>;
|
|
3467
|
+
fn call(
|
|
3468
|
+
&mut self,
|
|
3469
|
+
request: tonic::Request<super::GetConsensusParamsRequest>,
|
|
3470
|
+
) -> Self::Future {
|
|
3471
|
+
let inner = Arc::clone(&self.0);
|
|
3472
|
+
let fut = async move {
|
|
3473
|
+
(*inner).get_consensus_params(request).await
|
|
3474
|
+
};
|
|
3475
|
+
Box::pin(fut)
|
|
3476
|
+
}
|
|
3477
|
+
}
|
|
3478
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3479
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3480
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3481
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3482
|
+
let inner = self.inner.clone();
|
|
3483
|
+
let fut = async move {
|
|
3484
|
+
let inner = inner.0;
|
|
3485
|
+
let method = getConsensusParamsSvc(inner);
|
|
3486
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3487
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3488
|
+
.apply_compression_config(
|
|
3489
|
+
accept_compression_encodings,
|
|
3490
|
+
send_compression_encodings,
|
|
3491
|
+
)
|
|
3492
|
+
.apply_max_message_size_config(
|
|
3493
|
+
max_decoding_message_size,
|
|
3494
|
+
max_encoding_message_size,
|
|
3495
|
+
);
|
|
3496
|
+
let res = grpc.unary(method, req).await;
|
|
3497
|
+
Ok(res)
|
|
3498
|
+
};
|
|
3499
|
+
Box::pin(fut)
|
|
3500
|
+
}
|
|
3501
|
+
"/org.dash.platform.dapi.v0.Platform/getProtocolVersionUpgradeState" => {
|
|
3502
|
+
#[allow(non_camel_case_types)]
|
|
3503
|
+
struct getProtocolVersionUpgradeStateSvc<T: Platform>(pub Arc<T>);
|
|
3504
|
+
impl<
|
|
3505
|
+
T: Platform,
|
|
3506
|
+
> tonic::server::UnaryService<
|
|
3507
|
+
super::GetProtocolVersionUpgradeStateRequest,
|
|
3508
|
+
> for getProtocolVersionUpgradeStateSvc<T> {
|
|
3509
|
+
type Response = super::GetProtocolVersionUpgradeStateResponse;
|
|
3510
|
+
type Future = BoxFuture<
|
|
3511
|
+
tonic::Response<Self::Response>,
|
|
3512
|
+
tonic::Status,
|
|
3513
|
+
>;
|
|
3514
|
+
fn call(
|
|
3515
|
+
&mut self,
|
|
3516
|
+
request: tonic::Request<
|
|
3517
|
+
super::GetProtocolVersionUpgradeStateRequest,
|
|
3518
|
+
>,
|
|
3519
|
+
) -> Self::Future {
|
|
3520
|
+
let inner = Arc::clone(&self.0);
|
|
3521
|
+
let fut = async move {
|
|
3522
|
+
(*inner).get_protocol_version_upgrade_state(request).await
|
|
3523
|
+
};
|
|
3524
|
+
Box::pin(fut)
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3528
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3529
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3530
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3531
|
+
let inner = self.inner.clone();
|
|
3532
|
+
let fut = async move {
|
|
3533
|
+
let inner = inner.0;
|
|
3534
|
+
let method = getProtocolVersionUpgradeStateSvc(inner);
|
|
3535
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3536
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3537
|
+
.apply_compression_config(
|
|
3538
|
+
accept_compression_encodings,
|
|
3539
|
+
send_compression_encodings,
|
|
3540
|
+
)
|
|
3541
|
+
.apply_max_message_size_config(
|
|
3542
|
+
max_decoding_message_size,
|
|
3543
|
+
max_encoding_message_size,
|
|
3544
|
+
);
|
|
3545
|
+
let res = grpc.unary(method, req).await;
|
|
3546
|
+
Ok(res)
|
|
3547
|
+
};
|
|
3548
|
+
Box::pin(fut)
|
|
3549
|
+
}
|
|
3550
|
+
"/org.dash.platform.dapi.v0.Platform/getProtocolVersionUpgradeVoteStatus" => {
|
|
3551
|
+
#[allow(non_camel_case_types)]
|
|
3552
|
+
struct getProtocolVersionUpgradeVoteStatusSvc<T: Platform>(
|
|
3553
|
+
pub Arc<T>,
|
|
3554
|
+
);
|
|
3555
|
+
impl<
|
|
3556
|
+
T: Platform,
|
|
3557
|
+
> tonic::server::UnaryService<
|
|
3558
|
+
super::GetProtocolVersionUpgradeVoteStatusRequest,
|
|
3559
|
+
> for getProtocolVersionUpgradeVoteStatusSvc<T> {
|
|
3560
|
+
type Response = super::GetProtocolVersionUpgradeVoteStatusResponse;
|
|
3561
|
+
type Future = BoxFuture<
|
|
3562
|
+
tonic::Response<Self::Response>,
|
|
3563
|
+
tonic::Status,
|
|
3564
|
+
>;
|
|
3565
|
+
fn call(
|
|
3566
|
+
&mut self,
|
|
3567
|
+
request: tonic::Request<
|
|
3568
|
+
super::GetProtocolVersionUpgradeVoteStatusRequest,
|
|
3569
|
+
>,
|
|
3570
|
+
) -> Self::Future {
|
|
3571
|
+
let inner = Arc::clone(&self.0);
|
|
3572
|
+
let fut = async move {
|
|
3573
|
+
(*inner)
|
|
3574
|
+
.get_protocol_version_upgrade_vote_status(request)
|
|
3575
|
+
.await
|
|
3576
|
+
};
|
|
3577
|
+
Box::pin(fut)
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3581
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3582
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3583
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3584
|
+
let inner = self.inner.clone();
|
|
3585
|
+
let fut = async move {
|
|
3586
|
+
let inner = inner.0;
|
|
3587
|
+
let method = getProtocolVersionUpgradeVoteStatusSvc(inner);
|
|
3588
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3589
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3590
|
+
.apply_compression_config(
|
|
3591
|
+
accept_compression_encodings,
|
|
3592
|
+
send_compression_encodings,
|
|
3593
|
+
)
|
|
3594
|
+
.apply_max_message_size_config(
|
|
3595
|
+
max_decoding_message_size,
|
|
3596
|
+
max_encoding_message_size,
|
|
3597
|
+
);
|
|
3598
|
+
let res = grpc.unary(method, req).await;
|
|
3599
|
+
Ok(res)
|
|
3600
|
+
};
|
|
3601
|
+
Box::pin(fut)
|
|
3602
|
+
}
|
|
3603
|
+
"/org.dash.platform.dapi.v0.Platform/getEpochsInfo" => {
|
|
3604
|
+
#[allow(non_camel_case_types)]
|
|
3605
|
+
struct getEpochsInfoSvc<T: Platform>(pub Arc<T>);
|
|
3606
|
+
impl<
|
|
3607
|
+
T: Platform,
|
|
3608
|
+
> tonic::server::UnaryService<super::GetEpochsInfoRequest>
|
|
3609
|
+
for getEpochsInfoSvc<T> {
|
|
3610
|
+
type Response = super::GetEpochsInfoResponse;
|
|
3611
|
+
type Future = BoxFuture<
|
|
3612
|
+
tonic::Response<Self::Response>,
|
|
3613
|
+
tonic::Status,
|
|
3614
|
+
>;
|
|
3615
|
+
fn call(
|
|
3616
|
+
&mut self,
|
|
3617
|
+
request: tonic::Request<super::GetEpochsInfoRequest>,
|
|
3618
|
+
) -> Self::Future {
|
|
3619
|
+
let inner = Arc::clone(&self.0);
|
|
3620
|
+
let fut = async move {
|
|
3621
|
+
(*inner).get_epochs_info(request).await
|
|
3622
|
+
};
|
|
3623
|
+
Box::pin(fut)
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
let accept_compression_encodings = self.accept_compression_encodings;
|
|
3627
|
+
let send_compression_encodings = self.send_compression_encodings;
|
|
3628
|
+
let max_decoding_message_size = self.max_decoding_message_size;
|
|
3629
|
+
let max_encoding_message_size = self.max_encoding_message_size;
|
|
3630
|
+
let inner = self.inner.clone();
|
|
3631
|
+
let fut = async move {
|
|
3632
|
+
let inner = inner.0;
|
|
3633
|
+
let method = getEpochsInfoSvc(inner);
|
|
3634
|
+
let codec = tonic::codec::ProstCodec::default();
|
|
3635
|
+
let mut grpc = tonic::server::Grpc::new(codec)
|
|
3636
|
+
.apply_compression_config(
|
|
3637
|
+
accept_compression_encodings,
|
|
3638
|
+
send_compression_encodings,
|
|
3639
|
+
)
|
|
3640
|
+
.apply_max_message_size_config(
|
|
3641
|
+
max_decoding_message_size,
|
|
3642
|
+
max_encoding_message_size,
|
|
3643
|
+
);
|
|
3644
|
+
let res = grpc.unary(method, req).await;
|
|
3645
|
+
Ok(res)
|
|
3646
|
+
};
|
|
3647
|
+
Box::pin(fut)
|
|
3648
|
+
}
|
|
3649
|
+
_ => {
|
|
3650
|
+
Box::pin(async move {
|
|
3651
|
+
Ok(
|
|
3652
|
+
http::Response::builder()
|
|
3653
|
+
.status(200)
|
|
3654
|
+
.header("grpc-status", "12")
|
|
3655
|
+
.header("content-type", "application/grpc")
|
|
3656
|
+
.body(empty_body())
|
|
3657
|
+
.unwrap(),
|
|
3658
|
+
)
|
|
3659
|
+
})
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
impl<T: Platform> Clone for PlatformServer<T> {
|
|
3665
|
+
fn clone(&self) -> Self {
|
|
3666
|
+
let inner = self.inner.clone();
|
|
3667
|
+
Self {
|
|
3668
|
+
inner,
|
|
3669
|
+
accept_compression_encodings: self.accept_compression_encodings,
|
|
3670
|
+
send_compression_encodings: self.send_compression_encodings,
|
|
3671
|
+
max_decoding_message_size: self.max_decoding_message_size,
|
|
3672
|
+
max_encoding_message_size: self.max_encoding_message_size,
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
}
|
|
3676
|
+
impl<T: Platform> Clone for _Inner<T> {
|
|
3677
|
+
fn clone(&self) -> Self {
|
|
3678
|
+
Self(Arc::clone(&self.0))
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
|
|
3682
|
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
3683
|
+
write!(f, "{:?}", self.0)
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3686
|
+
impl<T: Platform> tonic::server::NamedService for PlatformServer<T> {
|
|
3687
|
+
const NAME: &'static str = "org.dash.platform.dapi.v0.Platform";
|
|
3688
|
+
}
|
|
3689
|
+
}
|