@dashevo/dapi-grpc 1.0.0-dev.5 → 1.0.0-dev.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.
@@ -2816,3 +2816,1215 @@ pub mod platform_client {
2816
2816
  }
2817
2817
  }
2818
2818
  }
2819
+ /// Generated server implementations.
2820
+ pub mod platform_server {
2821
+ #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2822
+ use tonic::codegen::*;
2823
+ /// Generated trait containing gRPC methods that should be implemented for use with PlatformServer.
2824
+ #[async_trait]
2825
+ pub trait Platform: Send + Sync + 'static {
2826
+ async fn broadcast_state_transition(
2827
+ &self,
2828
+ request: tonic::Request<super::BroadcastStateTransitionRequest>,
2829
+ ) -> std::result::Result<
2830
+ tonic::Response<super::BroadcastStateTransitionResponse>,
2831
+ tonic::Status,
2832
+ >;
2833
+ async fn get_identity(
2834
+ &self,
2835
+ request: tonic::Request<super::GetIdentityRequest>,
2836
+ ) -> std::result::Result<
2837
+ tonic::Response<super::GetIdentityResponse>,
2838
+ tonic::Status,
2839
+ >;
2840
+ async fn get_identities(
2841
+ &self,
2842
+ request: tonic::Request<super::GetIdentitiesRequest>,
2843
+ ) -> std::result::Result<
2844
+ tonic::Response<super::GetIdentitiesResponse>,
2845
+ tonic::Status,
2846
+ >;
2847
+ async fn get_identity_keys(
2848
+ &self,
2849
+ request: tonic::Request<super::GetIdentityKeysRequest>,
2850
+ ) -> std::result::Result<
2851
+ tonic::Response<super::GetIdentityKeysResponse>,
2852
+ tonic::Status,
2853
+ >;
2854
+ async fn get_identity_nonce(
2855
+ &self,
2856
+ request: tonic::Request<super::GetIdentityNonceRequest>,
2857
+ ) -> std::result::Result<
2858
+ tonic::Response<super::GetIdentityNonceResponse>,
2859
+ tonic::Status,
2860
+ >;
2861
+ async fn get_identity_contract_nonce(
2862
+ &self,
2863
+ request: tonic::Request<super::GetIdentityContractNonceRequest>,
2864
+ ) -> std::result::Result<
2865
+ tonic::Response<super::GetIdentityContractNonceResponse>,
2866
+ tonic::Status,
2867
+ >;
2868
+ async fn get_identity_balance(
2869
+ &self,
2870
+ request: tonic::Request<super::GetIdentityBalanceRequest>,
2871
+ ) -> std::result::Result<
2872
+ tonic::Response<super::GetIdentityBalanceResponse>,
2873
+ tonic::Status,
2874
+ >;
2875
+ async fn get_identity_balance_and_revision(
2876
+ &self,
2877
+ request: tonic::Request<super::GetIdentityBalanceAndRevisionRequest>,
2878
+ ) -> std::result::Result<
2879
+ tonic::Response<super::GetIdentityBalanceAndRevisionResponse>,
2880
+ tonic::Status,
2881
+ >;
2882
+ async fn get_proofs(
2883
+ &self,
2884
+ request: tonic::Request<super::GetProofsRequest>,
2885
+ ) -> std::result::Result<
2886
+ tonic::Response<super::GetProofsResponse>,
2887
+ tonic::Status,
2888
+ >;
2889
+ async fn get_data_contract(
2890
+ &self,
2891
+ request: tonic::Request<super::GetDataContractRequest>,
2892
+ ) -> std::result::Result<
2893
+ tonic::Response<super::GetDataContractResponse>,
2894
+ tonic::Status,
2895
+ >;
2896
+ async fn get_data_contract_history(
2897
+ &self,
2898
+ request: tonic::Request<super::GetDataContractHistoryRequest>,
2899
+ ) -> std::result::Result<
2900
+ tonic::Response<super::GetDataContractHistoryResponse>,
2901
+ tonic::Status,
2902
+ >;
2903
+ async fn get_data_contracts(
2904
+ &self,
2905
+ request: tonic::Request<super::GetDataContractsRequest>,
2906
+ ) -> std::result::Result<
2907
+ tonic::Response<super::GetDataContractsResponse>,
2908
+ tonic::Status,
2909
+ >;
2910
+ async fn get_documents(
2911
+ &self,
2912
+ request: tonic::Request<super::GetDocumentsRequest>,
2913
+ ) -> std::result::Result<
2914
+ tonic::Response<super::GetDocumentsResponse>,
2915
+ tonic::Status,
2916
+ >;
2917
+ async fn get_identities_by_public_key_hashes(
2918
+ &self,
2919
+ request: tonic::Request<super::GetIdentitiesByPublicKeyHashesRequest>,
2920
+ ) -> std::result::Result<
2921
+ tonic::Response<super::GetIdentitiesByPublicKeyHashesResponse>,
2922
+ tonic::Status,
2923
+ >;
2924
+ async fn get_identity_by_public_key_hash(
2925
+ &self,
2926
+ request: tonic::Request<super::GetIdentityByPublicKeyHashRequest>,
2927
+ ) -> std::result::Result<
2928
+ tonic::Response<super::GetIdentityByPublicKeyHashResponse>,
2929
+ tonic::Status,
2930
+ >;
2931
+ async fn wait_for_state_transition_result(
2932
+ &self,
2933
+ request: tonic::Request<super::WaitForStateTransitionResultRequest>,
2934
+ ) -> std::result::Result<
2935
+ tonic::Response<super::WaitForStateTransitionResultResponse>,
2936
+ tonic::Status,
2937
+ >;
2938
+ async fn get_consensus_params(
2939
+ &self,
2940
+ request: tonic::Request<super::GetConsensusParamsRequest>,
2941
+ ) -> std::result::Result<
2942
+ tonic::Response<super::GetConsensusParamsResponse>,
2943
+ tonic::Status,
2944
+ >;
2945
+ async fn get_protocol_version_upgrade_state(
2946
+ &self,
2947
+ request: tonic::Request<super::GetProtocolVersionUpgradeStateRequest>,
2948
+ ) -> std::result::Result<
2949
+ tonic::Response<super::GetProtocolVersionUpgradeStateResponse>,
2950
+ tonic::Status,
2951
+ >;
2952
+ async fn get_protocol_version_upgrade_vote_status(
2953
+ &self,
2954
+ request: tonic::Request<super::GetProtocolVersionUpgradeVoteStatusRequest>,
2955
+ ) -> std::result::Result<
2956
+ tonic::Response<super::GetProtocolVersionUpgradeVoteStatusResponse>,
2957
+ tonic::Status,
2958
+ >;
2959
+ async fn get_epochs_info(
2960
+ &self,
2961
+ request: tonic::Request<super::GetEpochsInfoRequest>,
2962
+ ) -> std::result::Result<
2963
+ tonic::Response<super::GetEpochsInfoResponse>,
2964
+ tonic::Status,
2965
+ >;
2966
+ }
2967
+ #[derive(Debug)]
2968
+ pub struct PlatformServer<T: Platform> {
2969
+ inner: _Inner<T>,
2970
+ accept_compression_encodings: EnabledCompressionEncodings,
2971
+ send_compression_encodings: EnabledCompressionEncodings,
2972
+ max_decoding_message_size: Option<usize>,
2973
+ max_encoding_message_size: Option<usize>,
2974
+ }
2975
+ struct _Inner<T>(Arc<T>);
2976
+ impl<T: Platform> PlatformServer<T> {
2977
+ pub fn new(inner: T) -> Self {
2978
+ Self::from_arc(Arc::new(inner))
2979
+ }
2980
+ pub fn from_arc(inner: Arc<T>) -> Self {
2981
+ let inner = _Inner(inner);
2982
+ Self {
2983
+ inner,
2984
+ accept_compression_encodings: Default::default(),
2985
+ send_compression_encodings: Default::default(),
2986
+ max_decoding_message_size: None,
2987
+ max_encoding_message_size: None,
2988
+ }
2989
+ }
2990
+ pub fn with_interceptor<F>(
2991
+ inner: T,
2992
+ interceptor: F,
2993
+ ) -> InterceptedService<Self, F>
2994
+ where
2995
+ F: tonic::service::Interceptor,
2996
+ {
2997
+ InterceptedService::new(Self::new(inner), interceptor)
2998
+ }
2999
+ /// Enable decompressing requests with the given encoding.
3000
+ #[must_use]
3001
+ pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3002
+ self.accept_compression_encodings.enable(encoding);
3003
+ self
3004
+ }
3005
+ /// Compress responses with the given encoding, if the client supports it.
3006
+ #[must_use]
3007
+ pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3008
+ self.send_compression_encodings.enable(encoding);
3009
+ self
3010
+ }
3011
+ /// Limits the maximum size of a decoded message.
3012
+ ///
3013
+ /// Default: `4MB`
3014
+ #[must_use]
3015
+ pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3016
+ self.max_decoding_message_size = Some(limit);
3017
+ self
3018
+ }
3019
+ /// Limits the maximum size of an encoded message.
3020
+ ///
3021
+ /// Default: `usize::MAX`
3022
+ #[must_use]
3023
+ pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3024
+ self.max_encoding_message_size = Some(limit);
3025
+ self
3026
+ }
3027
+ }
3028
+ impl<T, B> tonic::codegen::Service<http::Request<B>> for PlatformServer<T>
3029
+ where
3030
+ T: Platform,
3031
+ B: Body + Send + 'static,
3032
+ B::Error: Into<StdError> + Send + 'static,
3033
+ {
3034
+ type Response = http::Response<tonic::body::BoxBody>;
3035
+ type Error = std::convert::Infallible;
3036
+ type Future = BoxFuture<Self::Response, Self::Error>;
3037
+ fn poll_ready(
3038
+ &mut self,
3039
+ _cx: &mut Context<'_>,
3040
+ ) -> Poll<std::result::Result<(), Self::Error>> {
3041
+ Poll::Ready(Ok(()))
3042
+ }
3043
+ fn call(&mut self, req: http::Request<B>) -> Self::Future {
3044
+ let inner = self.inner.clone();
3045
+ match req.uri().path() {
3046
+ "/org.dash.platform.dapi.v0.Platform/broadcastStateTransition" => {
3047
+ #[allow(non_camel_case_types)]
3048
+ struct broadcastStateTransitionSvc<T: Platform>(pub Arc<T>);
3049
+ impl<
3050
+ T: Platform,
3051
+ > tonic::server::UnaryService<super::BroadcastStateTransitionRequest>
3052
+ for broadcastStateTransitionSvc<T> {
3053
+ type Response = super::BroadcastStateTransitionResponse;
3054
+ type Future = BoxFuture<
3055
+ tonic::Response<Self::Response>,
3056
+ tonic::Status,
3057
+ >;
3058
+ fn call(
3059
+ &mut self,
3060
+ request: tonic::Request<
3061
+ super::BroadcastStateTransitionRequest,
3062
+ >,
3063
+ ) -> Self::Future {
3064
+ let inner = Arc::clone(&self.0);
3065
+ let fut = async move {
3066
+ (*inner).broadcast_state_transition(request).await
3067
+ };
3068
+ Box::pin(fut)
3069
+ }
3070
+ }
3071
+ let accept_compression_encodings = self.accept_compression_encodings;
3072
+ let send_compression_encodings = self.send_compression_encodings;
3073
+ let max_decoding_message_size = self.max_decoding_message_size;
3074
+ let max_encoding_message_size = self.max_encoding_message_size;
3075
+ let inner = self.inner.clone();
3076
+ let fut = async move {
3077
+ let inner = inner.0;
3078
+ let method = broadcastStateTransitionSvc(inner);
3079
+ let codec = tonic::codec::ProstCodec::default();
3080
+ let mut grpc = tonic::server::Grpc::new(codec)
3081
+ .apply_compression_config(
3082
+ accept_compression_encodings,
3083
+ send_compression_encodings,
3084
+ )
3085
+ .apply_max_message_size_config(
3086
+ max_decoding_message_size,
3087
+ max_encoding_message_size,
3088
+ );
3089
+ let res = grpc.unary(method, req).await;
3090
+ Ok(res)
3091
+ };
3092
+ Box::pin(fut)
3093
+ }
3094
+ "/org.dash.platform.dapi.v0.Platform/getIdentity" => {
3095
+ #[allow(non_camel_case_types)]
3096
+ struct getIdentitySvc<T: Platform>(pub Arc<T>);
3097
+ impl<
3098
+ T: Platform,
3099
+ > tonic::server::UnaryService<super::GetIdentityRequest>
3100
+ for getIdentitySvc<T> {
3101
+ type Response = super::GetIdentityResponse;
3102
+ type Future = BoxFuture<
3103
+ tonic::Response<Self::Response>,
3104
+ tonic::Status,
3105
+ >;
3106
+ fn call(
3107
+ &mut self,
3108
+ request: tonic::Request<super::GetIdentityRequest>,
3109
+ ) -> Self::Future {
3110
+ let inner = Arc::clone(&self.0);
3111
+ let fut = async move {
3112
+ (*inner).get_identity(request).await
3113
+ };
3114
+ Box::pin(fut)
3115
+ }
3116
+ }
3117
+ let accept_compression_encodings = self.accept_compression_encodings;
3118
+ let send_compression_encodings = self.send_compression_encodings;
3119
+ let max_decoding_message_size = self.max_decoding_message_size;
3120
+ let max_encoding_message_size = self.max_encoding_message_size;
3121
+ let inner = self.inner.clone();
3122
+ let fut = async move {
3123
+ let inner = inner.0;
3124
+ let method = getIdentitySvc(inner);
3125
+ let codec = tonic::codec::ProstCodec::default();
3126
+ let mut grpc = tonic::server::Grpc::new(codec)
3127
+ .apply_compression_config(
3128
+ accept_compression_encodings,
3129
+ send_compression_encodings,
3130
+ )
3131
+ .apply_max_message_size_config(
3132
+ max_decoding_message_size,
3133
+ max_encoding_message_size,
3134
+ );
3135
+ let res = grpc.unary(method, req).await;
3136
+ Ok(res)
3137
+ };
3138
+ Box::pin(fut)
3139
+ }
3140
+ "/org.dash.platform.dapi.v0.Platform/getIdentities" => {
3141
+ #[allow(non_camel_case_types)]
3142
+ struct getIdentitiesSvc<T: Platform>(pub Arc<T>);
3143
+ impl<
3144
+ T: Platform,
3145
+ > tonic::server::UnaryService<super::GetIdentitiesRequest>
3146
+ for getIdentitiesSvc<T> {
3147
+ type Response = super::GetIdentitiesResponse;
3148
+ type Future = BoxFuture<
3149
+ tonic::Response<Self::Response>,
3150
+ tonic::Status,
3151
+ >;
3152
+ fn call(
3153
+ &mut self,
3154
+ request: tonic::Request<super::GetIdentitiesRequest>,
3155
+ ) -> Self::Future {
3156
+ let inner = Arc::clone(&self.0);
3157
+ let fut = async move {
3158
+ (*inner).get_identities(request).await
3159
+ };
3160
+ Box::pin(fut)
3161
+ }
3162
+ }
3163
+ let accept_compression_encodings = self.accept_compression_encodings;
3164
+ let send_compression_encodings = self.send_compression_encodings;
3165
+ let max_decoding_message_size = self.max_decoding_message_size;
3166
+ let max_encoding_message_size = self.max_encoding_message_size;
3167
+ let inner = self.inner.clone();
3168
+ let fut = async move {
3169
+ let inner = inner.0;
3170
+ let method = getIdentitiesSvc(inner);
3171
+ let codec = tonic::codec::ProstCodec::default();
3172
+ let mut grpc = tonic::server::Grpc::new(codec)
3173
+ .apply_compression_config(
3174
+ accept_compression_encodings,
3175
+ send_compression_encodings,
3176
+ )
3177
+ .apply_max_message_size_config(
3178
+ max_decoding_message_size,
3179
+ max_encoding_message_size,
3180
+ );
3181
+ let res = grpc.unary(method, req).await;
3182
+ Ok(res)
3183
+ };
3184
+ Box::pin(fut)
3185
+ }
3186
+ "/org.dash.platform.dapi.v0.Platform/getIdentityKeys" => {
3187
+ #[allow(non_camel_case_types)]
3188
+ struct getIdentityKeysSvc<T: Platform>(pub Arc<T>);
3189
+ impl<
3190
+ T: Platform,
3191
+ > tonic::server::UnaryService<super::GetIdentityKeysRequest>
3192
+ for getIdentityKeysSvc<T> {
3193
+ type Response = super::GetIdentityKeysResponse;
3194
+ type Future = BoxFuture<
3195
+ tonic::Response<Self::Response>,
3196
+ tonic::Status,
3197
+ >;
3198
+ fn call(
3199
+ &mut self,
3200
+ request: tonic::Request<super::GetIdentityKeysRequest>,
3201
+ ) -> Self::Future {
3202
+ let inner = Arc::clone(&self.0);
3203
+ let fut = async move {
3204
+ (*inner).get_identity_keys(request).await
3205
+ };
3206
+ Box::pin(fut)
3207
+ }
3208
+ }
3209
+ let accept_compression_encodings = self.accept_compression_encodings;
3210
+ let send_compression_encodings = self.send_compression_encodings;
3211
+ let max_decoding_message_size = self.max_decoding_message_size;
3212
+ let max_encoding_message_size = self.max_encoding_message_size;
3213
+ let inner = self.inner.clone();
3214
+ let fut = async move {
3215
+ let inner = inner.0;
3216
+ let method = getIdentityKeysSvc(inner);
3217
+ let codec = tonic::codec::ProstCodec::default();
3218
+ let mut grpc = tonic::server::Grpc::new(codec)
3219
+ .apply_compression_config(
3220
+ accept_compression_encodings,
3221
+ send_compression_encodings,
3222
+ )
3223
+ .apply_max_message_size_config(
3224
+ max_decoding_message_size,
3225
+ max_encoding_message_size,
3226
+ );
3227
+ let res = grpc.unary(method, req).await;
3228
+ Ok(res)
3229
+ };
3230
+ Box::pin(fut)
3231
+ }
3232
+ "/org.dash.platform.dapi.v0.Platform/getIdentityNonce" => {
3233
+ #[allow(non_camel_case_types)]
3234
+ struct getIdentityNonceSvc<T: Platform>(pub Arc<T>);
3235
+ impl<
3236
+ T: Platform,
3237
+ > tonic::server::UnaryService<super::GetIdentityNonceRequest>
3238
+ for getIdentityNonceSvc<T> {
3239
+ type Response = super::GetIdentityNonceResponse;
3240
+ type Future = BoxFuture<
3241
+ tonic::Response<Self::Response>,
3242
+ tonic::Status,
3243
+ >;
3244
+ fn call(
3245
+ &mut self,
3246
+ request: tonic::Request<super::GetIdentityNonceRequest>,
3247
+ ) -> Self::Future {
3248
+ let inner = Arc::clone(&self.0);
3249
+ let fut = async move {
3250
+ (*inner).get_identity_nonce(request).await
3251
+ };
3252
+ Box::pin(fut)
3253
+ }
3254
+ }
3255
+ let accept_compression_encodings = self.accept_compression_encodings;
3256
+ let send_compression_encodings = self.send_compression_encodings;
3257
+ let max_decoding_message_size = self.max_decoding_message_size;
3258
+ let max_encoding_message_size = self.max_encoding_message_size;
3259
+ let inner = self.inner.clone();
3260
+ let fut = async move {
3261
+ let inner = inner.0;
3262
+ let method = getIdentityNonceSvc(inner);
3263
+ let codec = tonic::codec::ProstCodec::default();
3264
+ let mut grpc = tonic::server::Grpc::new(codec)
3265
+ .apply_compression_config(
3266
+ accept_compression_encodings,
3267
+ send_compression_encodings,
3268
+ )
3269
+ .apply_max_message_size_config(
3270
+ max_decoding_message_size,
3271
+ max_encoding_message_size,
3272
+ );
3273
+ let res = grpc.unary(method, req).await;
3274
+ Ok(res)
3275
+ };
3276
+ Box::pin(fut)
3277
+ }
3278
+ "/org.dash.platform.dapi.v0.Platform/getIdentityContractNonce" => {
3279
+ #[allow(non_camel_case_types)]
3280
+ struct getIdentityContractNonceSvc<T: Platform>(pub Arc<T>);
3281
+ impl<
3282
+ T: Platform,
3283
+ > tonic::server::UnaryService<super::GetIdentityContractNonceRequest>
3284
+ for getIdentityContractNonceSvc<T> {
3285
+ type Response = super::GetIdentityContractNonceResponse;
3286
+ type Future = BoxFuture<
3287
+ tonic::Response<Self::Response>,
3288
+ tonic::Status,
3289
+ >;
3290
+ fn call(
3291
+ &mut self,
3292
+ request: tonic::Request<
3293
+ super::GetIdentityContractNonceRequest,
3294
+ >,
3295
+ ) -> Self::Future {
3296
+ let inner = Arc::clone(&self.0);
3297
+ let fut = async move {
3298
+ (*inner).get_identity_contract_nonce(request).await
3299
+ };
3300
+ Box::pin(fut)
3301
+ }
3302
+ }
3303
+ let accept_compression_encodings = self.accept_compression_encodings;
3304
+ let send_compression_encodings = self.send_compression_encodings;
3305
+ let max_decoding_message_size = self.max_decoding_message_size;
3306
+ let max_encoding_message_size = self.max_encoding_message_size;
3307
+ let inner = self.inner.clone();
3308
+ let fut = async move {
3309
+ let inner = inner.0;
3310
+ let method = getIdentityContractNonceSvc(inner);
3311
+ let codec = tonic::codec::ProstCodec::default();
3312
+ let mut grpc = tonic::server::Grpc::new(codec)
3313
+ .apply_compression_config(
3314
+ accept_compression_encodings,
3315
+ send_compression_encodings,
3316
+ )
3317
+ .apply_max_message_size_config(
3318
+ max_decoding_message_size,
3319
+ max_encoding_message_size,
3320
+ );
3321
+ let res = grpc.unary(method, req).await;
3322
+ Ok(res)
3323
+ };
3324
+ Box::pin(fut)
3325
+ }
3326
+ "/org.dash.platform.dapi.v0.Platform/getIdentityBalance" => {
3327
+ #[allow(non_camel_case_types)]
3328
+ struct getIdentityBalanceSvc<T: Platform>(pub Arc<T>);
3329
+ impl<
3330
+ T: Platform,
3331
+ > tonic::server::UnaryService<super::GetIdentityBalanceRequest>
3332
+ for getIdentityBalanceSvc<T> {
3333
+ type Response = super::GetIdentityBalanceResponse;
3334
+ type Future = BoxFuture<
3335
+ tonic::Response<Self::Response>,
3336
+ tonic::Status,
3337
+ >;
3338
+ fn call(
3339
+ &mut self,
3340
+ request: tonic::Request<super::GetIdentityBalanceRequest>,
3341
+ ) -> Self::Future {
3342
+ let inner = Arc::clone(&self.0);
3343
+ let fut = async move {
3344
+ (*inner).get_identity_balance(request).await
3345
+ };
3346
+ Box::pin(fut)
3347
+ }
3348
+ }
3349
+ let accept_compression_encodings = self.accept_compression_encodings;
3350
+ let send_compression_encodings = self.send_compression_encodings;
3351
+ let max_decoding_message_size = self.max_decoding_message_size;
3352
+ let max_encoding_message_size = self.max_encoding_message_size;
3353
+ let inner = self.inner.clone();
3354
+ let fut = async move {
3355
+ let inner = inner.0;
3356
+ let method = getIdentityBalanceSvc(inner);
3357
+ let codec = tonic::codec::ProstCodec::default();
3358
+ let mut grpc = tonic::server::Grpc::new(codec)
3359
+ .apply_compression_config(
3360
+ accept_compression_encodings,
3361
+ send_compression_encodings,
3362
+ )
3363
+ .apply_max_message_size_config(
3364
+ max_decoding_message_size,
3365
+ max_encoding_message_size,
3366
+ );
3367
+ let res = grpc.unary(method, req).await;
3368
+ Ok(res)
3369
+ };
3370
+ Box::pin(fut)
3371
+ }
3372
+ "/org.dash.platform.dapi.v0.Platform/getIdentityBalanceAndRevision" => {
3373
+ #[allow(non_camel_case_types)]
3374
+ struct getIdentityBalanceAndRevisionSvc<T: Platform>(pub Arc<T>);
3375
+ impl<
3376
+ T: Platform,
3377
+ > tonic::server::UnaryService<
3378
+ super::GetIdentityBalanceAndRevisionRequest,
3379
+ > for getIdentityBalanceAndRevisionSvc<T> {
3380
+ type Response = super::GetIdentityBalanceAndRevisionResponse;
3381
+ type Future = BoxFuture<
3382
+ tonic::Response<Self::Response>,
3383
+ tonic::Status,
3384
+ >;
3385
+ fn call(
3386
+ &mut self,
3387
+ request: tonic::Request<
3388
+ super::GetIdentityBalanceAndRevisionRequest,
3389
+ >,
3390
+ ) -> Self::Future {
3391
+ let inner = Arc::clone(&self.0);
3392
+ let fut = async move {
3393
+ (*inner).get_identity_balance_and_revision(request).await
3394
+ };
3395
+ Box::pin(fut)
3396
+ }
3397
+ }
3398
+ let accept_compression_encodings = self.accept_compression_encodings;
3399
+ let send_compression_encodings = self.send_compression_encodings;
3400
+ let max_decoding_message_size = self.max_decoding_message_size;
3401
+ let max_encoding_message_size = self.max_encoding_message_size;
3402
+ let inner = self.inner.clone();
3403
+ let fut = async move {
3404
+ let inner = inner.0;
3405
+ let method = getIdentityBalanceAndRevisionSvc(inner);
3406
+ let codec = tonic::codec::ProstCodec::default();
3407
+ let mut grpc = tonic::server::Grpc::new(codec)
3408
+ .apply_compression_config(
3409
+ accept_compression_encodings,
3410
+ send_compression_encodings,
3411
+ )
3412
+ .apply_max_message_size_config(
3413
+ max_decoding_message_size,
3414
+ max_encoding_message_size,
3415
+ );
3416
+ let res = grpc.unary(method, req).await;
3417
+ Ok(res)
3418
+ };
3419
+ Box::pin(fut)
3420
+ }
3421
+ "/org.dash.platform.dapi.v0.Platform/getProofs" => {
3422
+ #[allow(non_camel_case_types)]
3423
+ struct getProofsSvc<T: Platform>(pub Arc<T>);
3424
+ impl<
3425
+ T: Platform,
3426
+ > tonic::server::UnaryService<super::GetProofsRequest>
3427
+ for getProofsSvc<T> {
3428
+ type Response = super::GetProofsResponse;
3429
+ type Future = BoxFuture<
3430
+ tonic::Response<Self::Response>,
3431
+ tonic::Status,
3432
+ >;
3433
+ fn call(
3434
+ &mut self,
3435
+ request: tonic::Request<super::GetProofsRequest>,
3436
+ ) -> Self::Future {
3437
+ let inner = Arc::clone(&self.0);
3438
+ let fut = async move { (*inner).get_proofs(request).await };
3439
+ Box::pin(fut)
3440
+ }
3441
+ }
3442
+ let accept_compression_encodings = self.accept_compression_encodings;
3443
+ let send_compression_encodings = self.send_compression_encodings;
3444
+ let max_decoding_message_size = self.max_decoding_message_size;
3445
+ let max_encoding_message_size = self.max_encoding_message_size;
3446
+ let inner = self.inner.clone();
3447
+ let fut = async move {
3448
+ let inner = inner.0;
3449
+ let method = getProofsSvc(inner);
3450
+ let codec = tonic::codec::ProstCodec::default();
3451
+ let mut grpc = tonic::server::Grpc::new(codec)
3452
+ .apply_compression_config(
3453
+ accept_compression_encodings,
3454
+ send_compression_encodings,
3455
+ )
3456
+ .apply_max_message_size_config(
3457
+ max_decoding_message_size,
3458
+ max_encoding_message_size,
3459
+ );
3460
+ let res = grpc.unary(method, req).await;
3461
+ Ok(res)
3462
+ };
3463
+ Box::pin(fut)
3464
+ }
3465
+ "/org.dash.platform.dapi.v0.Platform/getDataContract" => {
3466
+ #[allow(non_camel_case_types)]
3467
+ struct getDataContractSvc<T: Platform>(pub Arc<T>);
3468
+ impl<
3469
+ T: Platform,
3470
+ > tonic::server::UnaryService<super::GetDataContractRequest>
3471
+ for getDataContractSvc<T> {
3472
+ type Response = super::GetDataContractResponse;
3473
+ type Future = BoxFuture<
3474
+ tonic::Response<Self::Response>,
3475
+ tonic::Status,
3476
+ >;
3477
+ fn call(
3478
+ &mut self,
3479
+ request: tonic::Request<super::GetDataContractRequest>,
3480
+ ) -> Self::Future {
3481
+ let inner = Arc::clone(&self.0);
3482
+ let fut = async move {
3483
+ (*inner).get_data_contract(request).await
3484
+ };
3485
+ Box::pin(fut)
3486
+ }
3487
+ }
3488
+ let accept_compression_encodings = self.accept_compression_encodings;
3489
+ let send_compression_encodings = self.send_compression_encodings;
3490
+ let max_decoding_message_size = self.max_decoding_message_size;
3491
+ let max_encoding_message_size = self.max_encoding_message_size;
3492
+ let inner = self.inner.clone();
3493
+ let fut = async move {
3494
+ let inner = inner.0;
3495
+ let method = getDataContractSvc(inner);
3496
+ let codec = tonic::codec::ProstCodec::default();
3497
+ let mut grpc = tonic::server::Grpc::new(codec)
3498
+ .apply_compression_config(
3499
+ accept_compression_encodings,
3500
+ send_compression_encodings,
3501
+ )
3502
+ .apply_max_message_size_config(
3503
+ max_decoding_message_size,
3504
+ max_encoding_message_size,
3505
+ );
3506
+ let res = grpc.unary(method, req).await;
3507
+ Ok(res)
3508
+ };
3509
+ Box::pin(fut)
3510
+ }
3511
+ "/org.dash.platform.dapi.v0.Platform/getDataContractHistory" => {
3512
+ #[allow(non_camel_case_types)]
3513
+ struct getDataContractHistorySvc<T: Platform>(pub Arc<T>);
3514
+ impl<
3515
+ T: Platform,
3516
+ > tonic::server::UnaryService<super::GetDataContractHistoryRequest>
3517
+ for getDataContractHistorySvc<T> {
3518
+ type Response = super::GetDataContractHistoryResponse;
3519
+ type Future = BoxFuture<
3520
+ tonic::Response<Self::Response>,
3521
+ tonic::Status,
3522
+ >;
3523
+ fn call(
3524
+ &mut self,
3525
+ request: tonic::Request<super::GetDataContractHistoryRequest>,
3526
+ ) -> Self::Future {
3527
+ let inner = Arc::clone(&self.0);
3528
+ let fut = async move {
3529
+ (*inner).get_data_contract_history(request).await
3530
+ };
3531
+ Box::pin(fut)
3532
+ }
3533
+ }
3534
+ let accept_compression_encodings = self.accept_compression_encodings;
3535
+ let send_compression_encodings = self.send_compression_encodings;
3536
+ let max_decoding_message_size = self.max_decoding_message_size;
3537
+ let max_encoding_message_size = self.max_encoding_message_size;
3538
+ let inner = self.inner.clone();
3539
+ let fut = async move {
3540
+ let inner = inner.0;
3541
+ let method = getDataContractHistorySvc(inner);
3542
+ let codec = tonic::codec::ProstCodec::default();
3543
+ let mut grpc = tonic::server::Grpc::new(codec)
3544
+ .apply_compression_config(
3545
+ accept_compression_encodings,
3546
+ send_compression_encodings,
3547
+ )
3548
+ .apply_max_message_size_config(
3549
+ max_decoding_message_size,
3550
+ max_encoding_message_size,
3551
+ );
3552
+ let res = grpc.unary(method, req).await;
3553
+ Ok(res)
3554
+ };
3555
+ Box::pin(fut)
3556
+ }
3557
+ "/org.dash.platform.dapi.v0.Platform/getDataContracts" => {
3558
+ #[allow(non_camel_case_types)]
3559
+ struct getDataContractsSvc<T: Platform>(pub Arc<T>);
3560
+ impl<
3561
+ T: Platform,
3562
+ > tonic::server::UnaryService<super::GetDataContractsRequest>
3563
+ for getDataContractsSvc<T> {
3564
+ type Response = super::GetDataContractsResponse;
3565
+ type Future = BoxFuture<
3566
+ tonic::Response<Self::Response>,
3567
+ tonic::Status,
3568
+ >;
3569
+ fn call(
3570
+ &mut self,
3571
+ request: tonic::Request<super::GetDataContractsRequest>,
3572
+ ) -> Self::Future {
3573
+ let inner = Arc::clone(&self.0);
3574
+ let fut = async move {
3575
+ (*inner).get_data_contracts(request).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 = getDataContractsSvc(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/getDocuments" => {
3604
+ #[allow(non_camel_case_types)]
3605
+ struct getDocumentsSvc<T: Platform>(pub Arc<T>);
3606
+ impl<
3607
+ T: Platform,
3608
+ > tonic::server::UnaryService<super::GetDocumentsRequest>
3609
+ for getDocumentsSvc<T> {
3610
+ type Response = super::GetDocumentsResponse;
3611
+ type Future = BoxFuture<
3612
+ tonic::Response<Self::Response>,
3613
+ tonic::Status,
3614
+ >;
3615
+ fn call(
3616
+ &mut self,
3617
+ request: tonic::Request<super::GetDocumentsRequest>,
3618
+ ) -> Self::Future {
3619
+ let inner = Arc::clone(&self.0);
3620
+ let fut = async move {
3621
+ (*inner).get_documents(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 = getDocumentsSvc(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
+ "/org.dash.platform.dapi.v0.Platform/getIdentitiesByPublicKeyHashes" => {
3650
+ #[allow(non_camel_case_types)]
3651
+ struct getIdentitiesByPublicKeyHashesSvc<T: Platform>(pub Arc<T>);
3652
+ impl<
3653
+ T: Platform,
3654
+ > tonic::server::UnaryService<
3655
+ super::GetIdentitiesByPublicKeyHashesRequest,
3656
+ > for getIdentitiesByPublicKeyHashesSvc<T> {
3657
+ type Response = super::GetIdentitiesByPublicKeyHashesResponse;
3658
+ type Future = BoxFuture<
3659
+ tonic::Response<Self::Response>,
3660
+ tonic::Status,
3661
+ >;
3662
+ fn call(
3663
+ &mut self,
3664
+ request: tonic::Request<
3665
+ super::GetIdentitiesByPublicKeyHashesRequest,
3666
+ >,
3667
+ ) -> Self::Future {
3668
+ let inner = Arc::clone(&self.0);
3669
+ let fut = async move {
3670
+ (*inner).get_identities_by_public_key_hashes(request).await
3671
+ };
3672
+ Box::pin(fut)
3673
+ }
3674
+ }
3675
+ let accept_compression_encodings = self.accept_compression_encodings;
3676
+ let send_compression_encodings = self.send_compression_encodings;
3677
+ let max_decoding_message_size = self.max_decoding_message_size;
3678
+ let max_encoding_message_size = self.max_encoding_message_size;
3679
+ let inner = self.inner.clone();
3680
+ let fut = async move {
3681
+ let inner = inner.0;
3682
+ let method = getIdentitiesByPublicKeyHashesSvc(inner);
3683
+ let codec = tonic::codec::ProstCodec::default();
3684
+ let mut grpc = tonic::server::Grpc::new(codec)
3685
+ .apply_compression_config(
3686
+ accept_compression_encodings,
3687
+ send_compression_encodings,
3688
+ )
3689
+ .apply_max_message_size_config(
3690
+ max_decoding_message_size,
3691
+ max_encoding_message_size,
3692
+ );
3693
+ let res = grpc.unary(method, req).await;
3694
+ Ok(res)
3695
+ };
3696
+ Box::pin(fut)
3697
+ }
3698
+ "/org.dash.platform.dapi.v0.Platform/getIdentityByPublicKeyHash" => {
3699
+ #[allow(non_camel_case_types)]
3700
+ struct getIdentityByPublicKeyHashSvc<T: Platform>(pub Arc<T>);
3701
+ impl<
3702
+ T: Platform,
3703
+ > tonic::server::UnaryService<
3704
+ super::GetIdentityByPublicKeyHashRequest,
3705
+ > for getIdentityByPublicKeyHashSvc<T> {
3706
+ type Response = super::GetIdentityByPublicKeyHashResponse;
3707
+ type Future = BoxFuture<
3708
+ tonic::Response<Self::Response>,
3709
+ tonic::Status,
3710
+ >;
3711
+ fn call(
3712
+ &mut self,
3713
+ request: tonic::Request<
3714
+ super::GetIdentityByPublicKeyHashRequest,
3715
+ >,
3716
+ ) -> Self::Future {
3717
+ let inner = Arc::clone(&self.0);
3718
+ let fut = async move {
3719
+ (*inner).get_identity_by_public_key_hash(request).await
3720
+ };
3721
+ Box::pin(fut)
3722
+ }
3723
+ }
3724
+ let accept_compression_encodings = self.accept_compression_encodings;
3725
+ let send_compression_encodings = self.send_compression_encodings;
3726
+ let max_decoding_message_size = self.max_decoding_message_size;
3727
+ let max_encoding_message_size = self.max_encoding_message_size;
3728
+ let inner = self.inner.clone();
3729
+ let fut = async move {
3730
+ let inner = inner.0;
3731
+ let method = getIdentityByPublicKeyHashSvc(inner);
3732
+ let codec = tonic::codec::ProstCodec::default();
3733
+ let mut grpc = tonic::server::Grpc::new(codec)
3734
+ .apply_compression_config(
3735
+ accept_compression_encodings,
3736
+ send_compression_encodings,
3737
+ )
3738
+ .apply_max_message_size_config(
3739
+ max_decoding_message_size,
3740
+ max_encoding_message_size,
3741
+ );
3742
+ let res = grpc.unary(method, req).await;
3743
+ Ok(res)
3744
+ };
3745
+ Box::pin(fut)
3746
+ }
3747
+ "/org.dash.platform.dapi.v0.Platform/waitForStateTransitionResult" => {
3748
+ #[allow(non_camel_case_types)]
3749
+ struct waitForStateTransitionResultSvc<T: Platform>(pub Arc<T>);
3750
+ impl<
3751
+ T: Platform,
3752
+ > tonic::server::UnaryService<
3753
+ super::WaitForStateTransitionResultRequest,
3754
+ > for waitForStateTransitionResultSvc<T> {
3755
+ type Response = super::WaitForStateTransitionResultResponse;
3756
+ type Future = BoxFuture<
3757
+ tonic::Response<Self::Response>,
3758
+ tonic::Status,
3759
+ >;
3760
+ fn call(
3761
+ &mut self,
3762
+ request: tonic::Request<
3763
+ super::WaitForStateTransitionResultRequest,
3764
+ >,
3765
+ ) -> Self::Future {
3766
+ let inner = Arc::clone(&self.0);
3767
+ let fut = async move {
3768
+ (*inner).wait_for_state_transition_result(request).await
3769
+ };
3770
+ Box::pin(fut)
3771
+ }
3772
+ }
3773
+ let accept_compression_encodings = self.accept_compression_encodings;
3774
+ let send_compression_encodings = self.send_compression_encodings;
3775
+ let max_decoding_message_size = self.max_decoding_message_size;
3776
+ let max_encoding_message_size = self.max_encoding_message_size;
3777
+ let inner = self.inner.clone();
3778
+ let fut = async move {
3779
+ let inner = inner.0;
3780
+ let method = waitForStateTransitionResultSvc(inner);
3781
+ let codec = tonic::codec::ProstCodec::default();
3782
+ let mut grpc = tonic::server::Grpc::new(codec)
3783
+ .apply_compression_config(
3784
+ accept_compression_encodings,
3785
+ send_compression_encodings,
3786
+ )
3787
+ .apply_max_message_size_config(
3788
+ max_decoding_message_size,
3789
+ max_encoding_message_size,
3790
+ );
3791
+ let res = grpc.unary(method, req).await;
3792
+ Ok(res)
3793
+ };
3794
+ Box::pin(fut)
3795
+ }
3796
+ "/org.dash.platform.dapi.v0.Platform/getConsensusParams" => {
3797
+ #[allow(non_camel_case_types)]
3798
+ struct getConsensusParamsSvc<T: Platform>(pub Arc<T>);
3799
+ impl<
3800
+ T: Platform,
3801
+ > tonic::server::UnaryService<super::GetConsensusParamsRequest>
3802
+ for getConsensusParamsSvc<T> {
3803
+ type Response = super::GetConsensusParamsResponse;
3804
+ type Future = BoxFuture<
3805
+ tonic::Response<Self::Response>,
3806
+ tonic::Status,
3807
+ >;
3808
+ fn call(
3809
+ &mut self,
3810
+ request: tonic::Request<super::GetConsensusParamsRequest>,
3811
+ ) -> Self::Future {
3812
+ let inner = Arc::clone(&self.0);
3813
+ let fut = async move {
3814
+ (*inner).get_consensus_params(request).await
3815
+ };
3816
+ Box::pin(fut)
3817
+ }
3818
+ }
3819
+ let accept_compression_encodings = self.accept_compression_encodings;
3820
+ let send_compression_encodings = self.send_compression_encodings;
3821
+ let max_decoding_message_size = self.max_decoding_message_size;
3822
+ let max_encoding_message_size = self.max_encoding_message_size;
3823
+ let inner = self.inner.clone();
3824
+ let fut = async move {
3825
+ let inner = inner.0;
3826
+ let method = getConsensusParamsSvc(inner);
3827
+ let codec = tonic::codec::ProstCodec::default();
3828
+ let mut grpc = tonic::server::Grpc::new(codec)
3829
+ .apply_compression_config(
3830
+ accept_compression_encodings,
3831
+ send_compression_encodings,
3832
+ )
3833
+ .apply_max_message_size_config(
3834
+ max_decoding_message_size,
3835
+ max_encoding_message_size,
3836
+ );
3837
+ let res = grpc.unary(method, req).await;
3838
+ Ok(res)
3839
+ };
3840
+ Box::pin(fut)
3841
+ }
3842
+ "/org.dash.platform.dapi.v0.Platform/getProtocolVersionUpgradeState" => {
3843
+ #[allow(non_camel_case_types)]
3844
+ struct getProtocolVersionUpgradeStateSvc<T: Platform>(pub Arc<T>);
3845
+ impl<
3846
+ T: Platform,
3847
+ > tonic::server::UnaryService<
3848
+ super::GetProtocolVersionUpgradeStateRequest,
3849
+ > for getProtocolVersionUpgradeStateSvc<T> {
3850
+ type Response = super::GetProtocolVersionUpgradeStateResponse;
3851
+ type Future = BoxFuture<
3852
+ tonic::Response<Self::Response>,
3853
+ tonic::Status,
3854
+ >;
3855
+ fn call(
3856
+ &mut self,
3857
+ request: tonic::Request<
3858
+ super::GetProtocolVersionUpgradeStateRequest,
3859
+ >,
3860
+ ) -> Self::Future {
3861
+ let inner = Arc::clone(&self.0);
3862
+ let fut = async move {
3863
+ (*inner).get_protocol_version_upgrade_state(request).await
3864
+ };
3865
+ Box::pin(fut)
3866
+ }
3867
+ }
3868
+ let accept_compression_encodings = self.accept_compression_encodings;
3869
+ let send_compression_encodings = self.send_compression_encodings;
3870
+ let max_decoding_message_size = self.max_decoding_message_size;
3871
+ let max_encoding_message_size = self.max_encoding_message_size;
3872
+ let inner = self.inner.clone();
3873
+ let fut = async move {
3874
+ let inner = inner.0;
3875
+ let method = getProtocolVersionUpgradeStateSvc(inner);
3876
+ let codec = tonic::codec::ProstCodec::default();
3877
+ let mut grpc = tonic::server::Grpc::new(codec)
3878
+ .apply_compression_config(
3879
+ accept_compression_encodings,
3880
+ send_compression_encodings,
3881
+ )
3882
+ .apply_max_message_size_config(
3883
+ max_decoding_message_size,
3884
+ max_encoding_message_size,
3885
+ );
3886
+ let res = grpc.unary(method, req).await;
3887
+ Ok(res)
3888
+ };
3889
+ Box::pin(fut)
3890
+ }
3891
+ "/org.dash.platform.dapi.v0.Platform/getProtocolVersionUpgradeVoteStatus" => {
3892
+ #[allow(non_camel_case_types)]
3893
+ struct getProtocolVersionUpgradeVoteStatusSvc<T: Platform>(
3894
+ pub Arc<T>,
3895
+ );
3896
+ impl<
3897
+ T: Platform,
3898
+ > tonic::server::UnaryService<
3899
+ super::GetProtocolVersionUpgradeVoteStatusRequest,
3900
+ > for getProtocolVersionUpgradeVoteStatusSvc<T> {
3901
+ type Response = super::GetProtocolVersionUpgradeVoteStatusResponse;
3902
+ type Future = BoxFuture<
3903
+ tonic::Response<Self::Response>,
3904
+ tonic::Status,
3905
+ >;
3906
+ fn call(
3907
+ &mut self,
3908
+ request: tonic::Request<
3909
+ super::GetProtocolVersionUpgradeVoteStatusRequest,
3910
+ >,
3911
+ ) -> Self::Future {
3912
+ let inner = Arc::clone(&self.0);
3913
+ let fut = async move {
3914
+ (*inner)
3915
+ .get_protocol_version_upgrade_vote_status(request)
3916
+ .await
3917
+ };
3918
+ Box::pin(fut)
3919
+ }
3920
+ }
3921
+ let accept_compression_encodings = self.accept_compression_encodings;
3922
+ let send_compression_encodings = self.send_compression_encodings;
3923
+ let max_decoding_message_size = self.max_decoding_message_size;
3924
+ let max_encoding_message_size = self.max_encoding_message_size;
3925
+ let inner = self.inner.clone();
3926
+ let fut = async move {
3927
+ let inner = inner.0;
3928
+ let method = getProtocolVersionUpgradeVoteStatusSvc(inner);
3929
+ let codec = tonic::codec::ProstCodec::default();
3930
+ let mut grpc = tonic::server::Grpc::new(codec)
3931
+ .apply_compression_config(
3932
+ accept_compression_encodings,
3933
+ send_compression_encodings,
3934
+ )
3935
+ .apply_max_message_size_config(
3936
+ max_decoding_message_size,
3937
+ max_encoding_message_size,
3938
+ );
3939
+ let res = grpc.unary(method, req).await;
3940
+ Ok(res)
3941
+ };
3942
+ Box::pin(fut)
3943
+ }
3944
+ "/org.dash.platform.dapi.v0.Platform/getEpochsInfo" => {
3945
+ #[allow(non_camel_case_types)]
3946
+ struct getEpochsInfoSvc<T: Platform>(pub Arc<T>);
3947
+ impl<
3948
+ T: Platform,
3949
+ > tonic::server::UnaryService<super::GetEpochsInfoRequest>
3950
+ for getEpochsInfoSvc<T> {
3951
+ type Response = super::GetEpochsInfoResponse;
3952
+ type Future = BoxFuture<
3953
+ tonic::Response<Self::Response>,
3954
+ tonic::Status,
3955
+ >;
3956
+ fn call(
3957
+ &mut self,
3958
+ request: tonic::Request<super::GetEpochsInfoRequest>,
3959
+ ) -> Self::Future {
3960
+ let inner = Arc::clone(&self.0);
3961
+ let fut = async move {
3962
+ (*inner).get_epochs_info(request).await
3963
+ };
3964
+ Box::pin(fut)
3965
+ }
3966
+ }
3967
+ let accept_compression_encodings = self.accept_compression_encodings;
3968
+ let send_compression_encodings = self.send_compression_encodings;
3969
+ let max_decoding_message_size = self.max_decoding_message_size;
3970
+ let max_encoding_message_size = self.max_encoding_message_size;
3971
+ let inner = self.inner.clone();
3972
+ let fut = async move {
3973
+ let inner = inner.0;
3974
+ let method = getEpochsInfoSvc(inner);
3975
+ let codec = tonic::codec::ProstCodec::default();
3976
+ let mut grpc = tonic::server::Grpc::new(codec)
3977
+ .apply_compression_config(
3978
+ accept_compression_encodings,
3979
+ send_compression_encodings,
3980
+ )
3981
+ .apply_max_message_size_config(
3982
+ max_decoding_message_size,
3983
+ max_encoding_message_size,
3984
+ );
3985
+ let res = grpc.unary(method, req).await;
3986
+ Ok(res)
3987
+ };
3988
+ Box::pin(fut)
3989
+ }
3990
+ _ => {
3991
+ Box::pin(async move {
3992
+ Ok(
3993
+ http::Response::builder()
3994
+ .status(200)
3995
+ .header("grpc-status", "12")
3996
+ .header("content-type", "application/grpc")
3997
+ .body(empty_body())
3998
+ .unwrap(),
3999
+ )
4000
+ })
4001
+ }
4002
+ }
4003
+ }
4004
+ }
4005
+ impl<T: Platform> Clone for PlatformServer<T> {
4006
+ fn clone(&self) -> Self {
4007
+ let inner = self.inner.clone();
4008
+ Self {
4009
+ inner,
4010
+ accept_compression_encodings: self.accept_compression_encodings,
4011
+ send_compression_encodings: self.send_compression_encodings,
4012
+ max_decoding_message_size: self.max_decoding_message_size,
4013
+ max_encoding_message_size: self.max_encoding_message_size,
4014
+ }
4015
+ }
4016
+ }
4017
+ impl<T: Platform> Clone for _Inner<T> {
4018
+ fn clone(&self) -> Self {
4019
+ Self(Arc::clone(&self.0))
4020
+ }
4021
+ }
4022
+ impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
4023
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4024
+ write!(f, "{:?}", self.0)
4025
+ }
4026
+ }
4027
+ impl<T: Platform> tonic::server::NamedService for PlatformServer<T> {
4028
+ const NAME: &'static str = "org.dash.platform.dapi.v0.Platform";
4029
+ }
4030
+ }