#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Request {
#[prost(
oneof = "request::Value",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15"
)]
pub value: ::core::option::Option<request::Value>,
}
pub mod request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
#[prost(message, tag = "1")]
Echo(super::RequestEcho),
#[prost(message, tag = "2")]
Flush(super::RequestFlush),
#[prost(message, tag = "3")]
Info(super::RequestInfo),
#[prost(message, tag = "4")]
SetOption(super::RequestSetOption),
#[prost(message, tag = "5")]
InitChain(super::RequestInitChain),
#[prost(message, tag = "6")]
Query(super::RequestQuery),
#[prost(message, tag = "7")]
BeginBlock(super::RequestBeginBlock),
#[prost(message, tag = "8")]
CheckTx(super::RequestCheckTx),
#[prost(message, tag = "9")]
DeliverTx(super::RequestDeliverTx),
#[prost(message, tag = "10")]
EndBlock(super::RequestEndBlock),
#[prost(message, tag = "11")]
Commit(super::RequestCommit),
#[prost(message, tag = "12")]
ListSnapshots(super::RequestListSnapshots),
#[prost(message, tag = "13")]
OfferSnapshot(super::RequestOfferSnapshot),
#[prost(message, tag = "14")]
LoadSnapshotChunk(super::RequestLoadSnapshotChunk),
#[prost(message, tag = "15")]
ApplySnapshotChunk(super::RequestApplySnapshotChunk),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestEcho {
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestFlush {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestInfo {
#[prost(string, tag = "1")]
pub version: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub block_version: u64,
#[prost(uint64, tag = "3")]
pub p2p_version: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestSetOption {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestInitChain {
#[prost(message, optional, tag = "1")]
pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
#[prost(string, tag = "2")]
pub chain_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub consensus_params: ::core::option::Option<ConsensusParams>,
#[prost(message, repeated, tag = "4")]
pub validators: ::prost::alloc::vec::Vec<ValidatorUpdate>,
#[prost(bytes = "bytes", tag = "5")]
pub app_state_bytes: ::prost::bytes::Bytes,
#[prost(int64, tag = "6")]
pub initial_height: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestQuery {
#[prost(bytes = "bytes", tag = "1")]
pub data: ::prost::bytes::Bytes,
#[prost(string, tag = "2")]
pub path: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub height: i64,
#[prost(bool, tag = "4")]
pub prove: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestBeginBlock {
#[prost(bytes = "bytes", tag = "1")]
pub hash: ::prost::bytes::Bytes,
#[prost(message, optional, tag = "2")]
pub header: ::core::option::Option<super::types::Header>,
#[prost(message, optional, tag = "3")]
pub last_commit_info: ::core::option::Option<LastCommitInfo>,
#[prost(message, repeated, tag = "4")]
pub byzantine_validators: ::prost::alloc::vec::Vec<Evidence>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestCheckTx {
#[prost(bytes = "bytes", tag = "1")]
pub tx: ::prost::bytes::Bytes,
#[prost(enumeration = "CheckTxType", tag = "2")]
pub r#type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestDeliverTx {
#[prost(bytes = "bytes", tag = "1")]
pub tx: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestEndBlock {
#[prost(int64, tag = "1")]
pub height: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestCommit {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestListSnapshots {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestOfferSnapshot {
#[prost(message, optional, tag = "1")]
pub snapshot: ::core::option::Option<Snapshot>,
#[prost(bytes = "bytes", tag = "2")]
pub app_hash: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestLoadSnapshotChunk {
#[prost(uint64, tag = "1")]
pub height: u64,
#[prost(uint32, tag = "2")]
pub format: u32,
#[prost(uint32, tag = "3")]
pub chunk: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestApplySnapshotChunk {
#[prost(uint32, tag = "1")]
pub index: u32,
#[prost(bytes = "bytes", tag = "2")]
pub chunk: ::prost::bytes::Bytes,
#[prost(string, tag = "3")]
pub sender: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
#[prost(
oneof = "response::Value",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16"
)]
pub value: ::core::option::Option<response::Value>,
}
pub mod response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
#[prost(message, tag = "1")]
Exception(super::ResponseException),
#[prost(message, tag = "2")]
Echo(super::ResponseEcho),
#[prost(message, tag = "3")]
Flush(super::ResponseFlush),
#[prost(message, tag = "4")]
Info(super::ResponseInfo),
#[prost(message, tag = "5")]
SetOption(super::ResponseSetOption),
#[prost(message, tag = "6")]
InitChain(super::ResponseInitChain),
#[prost(message, tag = "7")]
Query(super::ResponseQuery),
#[prost(message, tag = "8")]
BeginBlock(super::ResponseBeginBlock),
#[prost(message, tag = "9")]
CheckTx(super::ResponseCheckTx),
#[prost(message, tag = "10")]
DeliverTx(super::ResponseDeliverTx),
#[prost(message, tag = "11")]
EndBlock(super::ResponseEndBlock),
#[prost(message, tag = "12")]
Commit(super::ResponseCommit),
#[prost(message, tag = "13")]
ListSnapshots(super::ResponseListSnapshots),
#[prost(message, tag = "14")]
OfferSnapshot(super::ResponseOfferSnapshot),
#[prost(message, tag = "15")]
LoadSnapshotChunk(super::ResponseLoadSnapshotChunk),
#[prost(message, tag = "16")]
ApplySnapshotChunk(super::ResponseApplySnapshotChunk),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseException {
#[prost(string, tag = "1")]
pub error: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseEcho {
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseFlush {}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseInfo {
#[prost(string, tag = "1")]
#[serde(default)]
pub data: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
#[serde(default)]
pub version: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
#[serde(with = "crate::serializers::from_str", default)]
pub app_version: u64,
#[prost(int64, tag = "4")]
#[serde(with = "crate::serializers::from_str", default)]
pub last_block_height: i64,
#[prost(bytes = "bytes", tag = "5")]
#[serde(default)]
#[serde(skip_serializing_if = "bytes::Bytes::is_empty")]
pub last_block_app_hash: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseSetOption {
#[prost(uint32, tag = "1")]
pub code: u32,
#[prost(string, tag = "3")]
pub log: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub info: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseInitChain {
#[prost(message, optional, tag = "1")]
pub consensus_params: ::core::option::Option<ConsensusParams>,
#[prost(message, repeated, tag = "2")]
pub validators: ::prost::alloc::vec::Vec<ValidatorUpdate>,
#[prost(bytes = "bytes", tag = "3")]
pub app_hash: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseQuery {
#[prost(uint32, tag = "1")]
pub code: u32,
#[prost(string, tag = "3")]
pub log: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub info: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub index: i64,
#[prost(bytes = "bytes", tag = "6")]
pub key: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "7")]
pub value: ::prost::bytes::Bytes,
#[prost(message, optional, tag = "8")]
pub proof_ops: ::core::option::Option<super::crypto::ProofOps>,
#[prost(int64, tag = "9")]
pub height: i64,
#[prost(string, tag = "10")]
pub codespace: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseBeginBlock {
#[prost(message, repeated, tag = "1")]
pub events: ::prost::alloc::vec::Vec<Event>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseCheckTx {
#[prost(uint32, tag = "1")]
pub code: u32,
#[prost(bytes = "bytes", tag = "2")]
pub data: ::prost::bytes::Bytes,
#[prost(string, tag = "3")]
pub log: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub info: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub gas_wanted: i64,
#[prost(int64, tag = "6")]
pub gas_used: i64,
#[prost(message, repeated, tag = "7")]
pub events: ::prost::alloc::vec::Vec<Event>,
#[prost(string, tag = "8")]
pub codespace: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub sender: ::prost::alloc::string::String,
#[prost(int64, tag = "10")]
pub priority: i64,
#[prost(string, tag = "11")]
pub mempool_error: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseDeliverTx {
#[prost(uint32, tag = "1")]
pub code: u32,
#[prost(bytes = "bytes", tag = "2")]
pub data: ::prost::bytes::Bytes,
#[prost(string, tag = "3")]
pub log: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub info: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub gas_wanted: i64,
#[prost(int64, tag = "6")]
pub gas_used: i64,
#[prost(message, repeated, tag = "7")]
pub events: ::prost::alloc::vec::Vec<Event>,
#[prost(string, tag = "8")]
pub codespace: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseEndBlock {
#[prost(message, repeated, tag = "1")]
pub validator_updates: ::prost::alloc::vec::Vec<ValidatorUpdate>,
#[prost(message, optional, tag = "2")]
pub consensus_param_updates: ::core::option::Option<ConsensusParams>,
#[prost(message, repeated, tag = "3")]
pub events: ::prost::alloc::vec::Vec<Event>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseCommit {
#[prost(bytes = "bytes", tag = "2")]
pub data: ::prost::bytes::Bytes,
#[prost(int64, tag = "3")]
pub retain_height: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseListSnapshots {
#[prost(message, repeated, tag = "1")]
pub snapshots: ::prost::alloc::vec::Vec<Snapshot>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseOfferSnapshot {
#[prost(enumeration = "response_offer_snapshot::Result", tag = "1")]
pub result: i32,
}
pub mod response_offer_snapshot {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Result {
Unknown = 0,
Accept = 1,
Abort = 2,
Reject = 3,
RejectFormat = 4,
RejectSender = 5,
}
impl Result {
pub fn as_str_name(&self) -> &'static str {
match self {
Result::Unknown => "UNKNOWN",
Result::Accept => "ACCEPT",
Result::Abort => "ABORT",
Result::Reject => "REJECT",
Result::RejectFormat => "REJECT_FORMAT",
Result::RejectSender => "REJECT_SENDER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"ACCEPT" => Some(Self::Accept),
"ABORT" => Some(Self::Abort),
"REJECT" => Some(Self::Reject),
"REJECT_FORMAT" => Some(Self::RejectFormat),
"REJECT_SENDER" => Some(Self::RejectSender),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseLoadSnapshotChunk {
#[prost(bytes = "bytes", tag = "1")]
pub chunk: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseApplySnapshotChunk {
#[prost(enumeration = "response_apply_snapshot_chunk::Result", tag = "1")]
pub result: i32,
#[prost(uint32, repeated, tag = "2")]
pub refetch_chunks: ::prost::alloc::vec::Vec<u32>,
#[prost(string, repeated, tag = "3")]
pub reject_senders: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
pub mod response_apply_snapshot_chunk {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Result {
Unknown = 0,
Accept = 1,
Abort = 2,
Retry = 3,
RetrySnapshot = 4,
RejectSnapshot = 5,
}
impl Result {
pub fn as_str_name(&self) -> &'static str {
match self {
Result::Unknown => "UNKNOWN",
Result::Accept => "ACCEPT",
Result::Abort => "ABORT",
Result::Retry => "RETRY",
Result::RetrySnapshot => "RETRY_SNAPSHOT",
Result::RejectSnapshot => "REJECT_SNAPSHOT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"ACCEPT" => Some(Self::Accept),
"ABORT" => Some(Self::Abort),
"RETRY" => Some(Self::Retry),
"RETRY_SNAPSHOT" => Some(Self::RetrySnapshot),
"REJECT_SNAPSHOT" => Some(Self::RejectSnapshot),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusParams {
#[prost(message, optional, tag = "1")]
pub block: ::core::option::Option<BlockParams>,
#[prost(message, optional, tag = "2")]
pub evidence: ::core::option::Option<super::types::EvidenceParams>,
#[prost(message, optional, tag = "3")]
pub validator: ::core::option::Option<super::types::ValidatorParams>,
#[prost(message, optional, tag = "4")]
pub version: ::core::option::Option<super::types::VersionParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockParams {
#[prost(int64, tag = "1")]
pub max_bytes: i64,
#[prost(int64, tag = "2")]
pub max_gas: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LastCommitInfo {
#[prost(int32, tag = "1")]
pub round: i32,
#[prost(message, repeated, tag = "2")]
pub votes: ::prost::alloc::vec::Vec<VoteInfo>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Event {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub attributes: ::prost::alloc::vec::Vec<EventAttribute>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventAttribute {
#[prost(bytes = "bytes", tag = "1")]
pub key: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "2")]
pub value: ::prost::bytes::Bytes,
#[prost(bool, tag = "3")]
pub index: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxResult {
#[prost(int64, tag = "1")]
pub height: i64,
#[prost(uint32, tag = "2")]
pub index: u32,
#[prost(bytes = "bytes", tag = "3")]
pub tx: ::prost::bytes::Bytes,
#[prost(message, optional, tag = "4")]
pub result: ::core::option::Option<ResponseDeliverTx>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Validator {
#[prost(bytes = "bytes", tag = "1")]
pub address: ::prost::bytes::Bytes,
#[prost(int64, tag = "3")]
pub power: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorUpdate {
#[prost(message, optional, tag = "1")]
pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
#[prost(int64, tag = "2")]
pub power: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VoteInfo {
#[prost(message, optional, tag = "1")]
pub validator: ::core::option::Option<Validator>,
#[prost(bool, tag = "2")]
pub signed_last_block: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Evidence {
#[prost(enumeration = "EvidenceType", tag = "1")]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub validator: ::core::option::Option<Validator>,
#[prost(int64, tag = "3")]
pub height: i64,
#[prost(message, optional, tag = "4")]
pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
#[prost(int64, tag = "5")]
pub total_voting_power: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Snapshot {
#[prost(uint64, tag = "1")]
pub height: u64,
#[prost(uint32, tag = "2")]
pub format: u32,
#[prost(uint32, tag = "3")]
pub chunks: u32,
#[prost(bytes = "bytes", tag = "4")]
pub hash: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "5")]
pub metadata: ::prost::bytes::Bytes,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CheckTxType {
New = 0,
Recheck = 1,
}
impl CheckTxType {
pub fn as_str_name(&self) -> &'static str {
match self {
CheckTxType::New => "NEW",
CheckTxType::Recheck => "RECHECK",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NEW" => Some(Self::New),
"RECHECK" => Some(Self::Recheck),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EvidenceType {
Unknown = 0,
DuplicateVote = 1,
LightClientAttack = 2,
}
impl EvidenceType {
pub fn as_str_name(&self) -> &'static str {
match self {
EvidenceType::Unknown => "UNKNOWN",
EvidenceType::DuplicateVote => "DUPLICATE_VOTE",
EvidenceType::LightClientAttack => "LIGHT_CLIENT_ATTACK",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"DUPLICATE_VOTE" => Some(Self::DuplicateVote),
"LIGHT_CLIENT_ATTACK" => Some(Self::LightClientAttack),
_ => None,
}
}
}
#[cfg(feature = "grpc-server")]
pub mod abci_application_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait AbciApplication: Send + Sync + 'static {
async fn echo(
&self,
request: tonic::Request<super::RequestEcho>,
) -> std::result::Result<tonic::Response<super::ResponseEcho>, tonic::Status>;
async fn flush(
&self,
request: tonic::Request<super::RequestFlush>,
) -> std::result::Result<tonic::Response<super::ResponseFlush>, tonic::Status>;
async fn info(
&self,
request: tonic::Request<super::RequestInfo>,
) -> std::result::Result<tonic::Response<super::ResponseInfo>, tonic::Status>;
async fn set_option(
&self,
request: tonic::Request<super::RequestSetOption>,
) -> std::result::Result<
tonic::Response<super::ResponseSetOption>,
tonic::Status,
>;
async fn deliver_tx(
&self,
request: tonic::Request<super::RequestDeliverTx>,
) -> std::result::Result<
tonic::Response<super::ResponseDeliverTx>,
tonic::Status,
>;
async fn check_tx(
&self,
request: tonic::Request<super::RequestCheckTx>,
) -> std::result::Result<tonic::Response<super::ResponseCheckTx>, tonic::Status>;
async fn query(
&self,
request: tonic::Request<super::RequestQuery>,
) -> std::result::Result<tonic::Response<super::ResponseQuery>, tonic::Status>;
async fn commit(
&self,
request: tonic::Request<super::RequestCommit>,
) -> std::result::Result<tonic::Response<super::ResponseCommit>, tonic::Status>;
async fn init_chain(
&self,
request: tonic::Request<super::RequestInitChain>,
) -> std::result::Result<
tonic::Response<super::ResponseInitChain>,
tonic::Status,
>;
async fn begin_block(
&self,
request: tonic::Request<super::RequestBeginBlock>,
) -> std::result::Result<
tonic::Response<super::ResponseBeginBlock>,
tonic::Status,
>;
async fn end_block(
&self,
request: tonic::Request<super::RequestEndBlock>,
) -> std::result::Result<
tonic::Response<super::ResponseEndBlock>,
tonic::Status,
>;
async fn list_snapshots(
&self,
request: tonic::Request<super::RequestListSnapshots>,
) -> std::result::Result<
tonic::Response<super::ResponseListSnapshots>,
tonic::Status,
>;
async fn offer_snapshot(
&self,
request: tonic::Request<super::RequestOfferSnapshot>,
) -> std::result::Result<
tonic::Response<super::ResponseOfferSnapshot>,
tonic::Status,
>;
async fn load_snapshot_chunk(
&self,
request: tonic::Request<super::RequestLoadSnapshotChunk>,
) -> std::result::Result<
tonic::Response<super::ResponseLoadSnapshotChunk>,
tonic::Status,
>;
async fn apply_snapshot_chunk(
&self,
request: tonic::Request<super::RequestApplySnapshotChunk>,
) -> std::result::Result<
tonic::Response<super::ResponseApplySnapshotChunk>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct AbciApplicationServer<T: AbciApplication> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: AbciApplication> AbciApplicationServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for AbciApplicationServer<T>
where
T: AbciApplication,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/tendermint.abci.ABCIApplication/Echo" => {
#[allow(non_camel_case_types)]
struct EchoSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestEcho> for EchoSvc<T> {
type Response = super::ResponseEcho;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestEcho>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::echo(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = EchoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/Flush" => {
#[allow(non_camel_case_types)]
struct FlushSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestFlush> for FlushSvc<T> {
type Response = super::ResponseFlush;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestFlush>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::flush(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = FlushSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/Info" => {
#[allow(non_camel_case_types)]
struct InfoSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestInfo> for InfoSvc<T> {
type Response = super::ResponseInfo;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestInfo>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::info(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = InfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/SetOption" => {
#[allow(non_camel_case_types)]
struct SetOptionSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestSetOption>
for SetOptionSvc<T> {
type Response = super::ResponseSetOption;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestSetOption>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::set_option(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SetOptionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/DeliverTx" => {
#[allow(non_camel_case_types)]
struct DeliverTxSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestDeliverTx>
for DeliverTxSvc<T> {
type Response = super::ResponseDeliverTx;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestDeliverTx>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::deliver_tx(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DeliverTxSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/CheckTx" => {
#[allow(non_camel_case_types)]
struct CheckTxSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestCheckTx>
for CheckTxSvc<T> {
type Response = super::ResponseCheckTx;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestCheckTx>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::check_tx(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CheckTxSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/Query" => {
#[allow(non_camel_case_types)]
struct QuerySvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestQuery> for QuerySvc<T> {
type Response = super::ResponseQuery;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestQuery>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::query(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = QuerySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/Commit" => {
#[allow(non_camel_case_types)]
struct CommitSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestCommit>
for CommitSvc<T> {
type Response = super::ResponseCommit;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestCommit>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::commit(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CommitSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/InitChain" => {
#[allow(non_camel_case_types)]
struct InitChainSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestInitChain>
for InitChainSvc<T> {
type Response = super::ResponseInitChain;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestInitChain>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::init_chain(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = InitChainSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/BeginBlock" => {
#[allow(non_camel_case_types)]
struct BeginBlockSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestBeginBlock>
for BeginBlockSvc<T> {
type Response = super::ResponseBeginBlock;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestBeginBlock>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::begin_block(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = BeginBlockSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/EndBlock" => {
#[allow(non_camel_case_types)]
struct EndBlockSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestEndBlock>
for EndBlockSvc<T> {
type Response = super::ResponseEndBlock;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestEndBlock>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::end_block(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = EndBlockSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/ListSnapshots" => {
#[allow(non_camel_case_types)]
struct ListSnapshotsSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestListSnapshots>
for ListSnapshotsSvc<T> {
type Response = super::ResponseListSnapshots;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestListSnapshots>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::list_snapshots(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ListSnapshotsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/OfferSnapshot" => {
#[allow(non_camel_case_types)]
struct OfferSnapshotSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestOfferSnapshot>
for OfferSnapshotSvc<T> {
type Response = super::ResponseOfferSnapshot;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestOfferSnapshot>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::offer_snapshot(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = OfferSnapshotSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/LoadSnapshotChunk" => {
#[allow(non_camel_case_types)]
struct LoadSnapshotChunkSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestLoadSnapshotChunk>
for LoadSnapshotChunkSvc<T> {
type Response = super::ResponseLoadSnapshotChunk;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestLoadSnapshotChunk>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::load_snapshot_chunk(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = LoadSnapshotChunkSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/tendermint.abci.ABCIApplication/ApplySnapshotChunk" => {
#[allow(non_camel_case_types)]
struct ApplySnapshotChunkSvc<T: AbciApplication>(pub Arc<T>);
impl<
T: AbciApplication,
> tonic::server::UnaryService<super::RequestApplySnapshotChunk>
for ApplySnapshotChunkSvc<T> {
type Response = super::ResponseApplySnapshotChunk;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RequestApplySnapshotChunk>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciApplication>::apply_snapshot_chunk(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ApplySnapshotChunkSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: AbciApplication> Clone for AbciApplicationServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: AbciApplication> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: AbciApplication> tonic::server::NamedService for AbciApplicationServer<T> {
const NAME: &'static str = "tendermint.abci.ABCIApplication";
}
}