#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Request {
#[prost(
oneof = "request::Value",
tags = "1, 2, 3, 5, 6, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20"
)]
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::EchoRequest),
#[prost(message, tag = "2")]
Flush(super::FlushRequest),
#[prost(message, tag = "3")]
Info(super::InfoRequest),
#[prost(message, tag = "5")]
InitChain(super::InitChainRequest),
#[prost(message, tag = "6")]
Query(super::QueryRequest),
#[prost(message, tag = "8")]
CheckTx(super::CheckTxRequest),
#[prost(message, tag = "11")]
Commit(super::CommitRequest),
#[prost(message, tag = "12")]
ListSnapshots(super::ListSnapshotsRequest),
#[prost(message, tag = "13")]
OfferSnapshot(super::OfferSnapshotRequest),
#[prost(message, tag = "14")]
LoadSnapshotChunk(super::LoadSnapshotChunkRequest),
#[prost(message, tag = "15")]
ApplySnapshotChunk(super::ApplySnapshotChunkRequest),
#[prost(message, tag = "16")]
PrepareProposal(super::PrepareProposalRequest),
#[prost(message, tag = "17")]
ProcessProposal(super::ProcessProposalRequest),
#[prost(message, tag = "18")]
ExtendVote(super::ExtendVoteRequest),
#[prost(message, tag = "19")]
VerifyVoteExtension(super::VerifyVoteExtensionRequest),
#[prost(message, tag = "20")]
FinalizeBlock(super::FinalizeBlockRequest),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EchoRequest {
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlushRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InfoRequest {
#[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,
#[prost(string, tag = "4")]
pub abci_version: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitChainRequest {
#[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<
super::super::types::v1::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 QueryRequest {
#[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 CheckTxRequest {
#[prost(bytes = "bytes", tag = "1")]
pub tx: ::prost::bytes::Bytes,
#[prost(enumeration = "CheckTxType", tag = "3")]
pub r#type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSnapshotsRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OfferSnapshotRequest {
#[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 LoadSnapshotChunkRequest {
#[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 ApplySnapshotChunkRequest {
#[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 PrepareProposalRequest {
#[prost(int64, tag = "1")]
pub max_tx_bytes: i64,
#[prost(bytes = "bytes", repeated, tag = "2")]
pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(message, optional, tag = "3")]
pub local_last_commit: ::core::option::Option<ExtendedCommitInfo>,
#[prost(message, repeated, tag = "4")]
pub misbehavior: ::prost::alloc::vec::Vec<Misbehavior>,
#[prost(int64, tag = "5")]
pub height: i64,
#[prost(message, optional, tag = "6")]
pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
#[prost(bytes = "bytes", tag = "7")]
pub next_validators_hash: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "8")]
pub proposer_address: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessProposalRequest {
#[prost(bytes = "bytes", repeated, tag = "1")]
pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(message, optional, tag = "2")]
pub proposed_last_commit: ::core::option::Option<CommitInfo>,
#[prost(message, repeated, tag = "3")]
pub misbehavior: ::prost::alloc::vec::Vec<Misbehavior>,
#[prost(bytes = "bytes", tag = "4")]
pub hash: ::prost::bytes::Bytes,
#[prost(int64, tag = "5")]
pub height: i64,
#[prost(message, optional, tag = "6")]
pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
#[prost(bytes = "bytes", tag = "7")]
pub next_validators_hash: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "8")]
pub proposer_address: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtendVoteRequest {
#[prost(bytes = "bytes", tag = "1")]
pub hash: ::prost::bytes::Bytes,
#[prost(int64, tag = "2")]
pub height: i64,
#[prost(message, optional, tag = "3")]
pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
#[prost(bytes = "bytes", repeated, tag = "4")]
pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(message, optional, tag = "5")]
pub proposed_last_commit: ::core::option::Option<CommitInfo>,
#[prost(message, repeated, tag = "6")]
pub misbehavior: ::prost::alloc::vec::Vec<Misbehavior>,
#[prost(bytes = "bytes", tag = "7")]
pub next_validators_hash: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "8")]
pub proposer_address: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyVoteExtensionRequest {
#[prost(bytes = "bytes", tag = "1")]
pub hash: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "2")]
pub validator_address: ::prost::bytes::Bytes,
#[prost(int64, tag = "3")]
pub height: i64,
#[prost(bytes = "bytes", tag = "4")]
pub vote_extension: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeBlockRequest {
#[prost(bytes = "bytes", repeated, tag = "1")]
pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(message, optional, tag = "2")]
pub decided_last_commit: ::core::option::Option<CommitInfo>,
#[prost(message, repeated, tag = "3")]
pub misbehavior: ::prost::alloc::vec::Vec<Misbehavior>,
#[prost(bytes = "bytes", tag = "4")]
pub hash: ::prost::bytes::Bytes,
#[prost(int64, tag = "5")]
pub height: i64,
#[prost(message, optional, tag = "6")]
pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
#[prost(bytes = "bytes", tag = "7")]
pub next_validators_hash: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "8")]
pub proposer_address: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
#[prost(
oneof = "response::Value",
tags = "1, 2, 3, 4, 6, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21"
)]
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::ExceptionResponse),
#[prost(message, tag = "2")]
Echo(super::EchoResponse),
#[prost(message, tag = "3")]
Flush(super::FlushResponse),
#[prost(message, tag = "4")]
Info(super::InfoResponse),
#[prost(message, tag = "6")]
InitChain(super::InitChainResponse),
#[prost(message, tag = "7")]
Query(super::QueryResponse),
#[prost(message, tag = "9")]
CheckTx(super::CheckTxResponse),
#[prost(message, tag = "12")]
Commit(super::CommitResponse),
#[prost(message, tag = "13")]
ListSnapshots(super::ListSnapshotsResponse),
#[prost(message, tag = "14")]
OfferSnapshot(super::OfferSnapshotResponse),
#[prost(message, tag = "15")]
LoadSnapshotChunk(super::LoadSnapshotChunkResponse),
#[prost(message, tag = "16")]
ApplySnapshotChunk(super::ApplySnapshotChunkResponse),
#[prost(message, tag = "17")]
PrepareProposal(super::PrepareProposalResponse),
#[prost(message, tag = "18")]
ProcessProposal(super::ProcessProposalResponse),
#[prost(message, tag = "19")]
ExtendVote(super::ExtendVoteResponse),
#[prost(message, tag = "20")]
VerifyVoteExtension(super::VerifyVoteExtensionResponse),
#[prost(message, tag = "21")]
FinalizeBlock(super::FinalizeBlockResponse),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExceptionResponse {
#[prost(string, tag = "1")]
pub error: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EchoResponse {
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlushResponse {}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InfoResponse {
#[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 InitChainResponse {
#[prost(message, optional, tag = "1")]
pub consensus_params: ::core::option::Option<
super::super::types::v1::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 QueryResponse {
#[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::super::crypto::v1::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 CheckTxResponse {
#[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 CommitResponse {
#[prost(int64, tag = "3")]
pub retain_height: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSnapshotsResponse {
#[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 OfferSnapshotResponse {
#[prost(enumeration = "OfferSnapshotResult", tag = "1")]
pub result: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LoadSnapshotChunkResponse {
#[prost(bytes = "bytes", tag = "1")]
pub chunk: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplySnapshotChunkResponse {
#[prost(enumeration = "ApplySnapshotChunkResult", 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>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PrepareProposalResponse {
#[prost(bytes = "bytes", repeated, tag = "1")]
pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessProposalResponse {
#[prost(enumeration = "ProcessProposalStatus", tag = "1")]
pub status: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtendVoteResponse {
#[prost(bytes = "bytes", tag = "1")]
pub vote_extension: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyVoteExtensionResponse {
#[prost(enumeration = "VerifyVoteExtensionStatus", tag = "1")]
pub status: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeBlockResponse {
#[prost(message, repeated, tag = "1")]
pub events: ::prost::alloc::vec::Vec<Event>,
#[prost(message, repeated, tag = "2")]
pub tx_results: ::prost::alloc::vec::Vec<ExecTxResult>,
#[prost(message, repeated, tag = "3")]
pub validator_updates: ::prost::alloc::vec::Vec<ValidatorUpdate>,
#[prost(message, optional, tag = "4")]
pub consensus_param_updates: ::core::option::Option<
super::super::types::v1::ConsensusParams,
>,
#[prost(bytes = "bytes", tag = "5")]
pub app_hash: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitInfo {
#[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 ExtendedCommitInfo {
#[prost(int32, tag = "1")]
pub round: i32,
#[prost(message, repeated, tag = "2")]
pub votes: ::prost::alloc::vec::Vec<ExtendedVoteInfo>,
}
#[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(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub index: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecTxResult {
#[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 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<ExecTxResult>,
}
#[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::super::crypto::v1::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(enumeration = "super::super::types::v1::BlockIdFlag", tag = "3")]
pub block_id_flag: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtendedVoteInfo {
#[prost(message, optional, tag = "1")]
pub validator: ::core::option::Option<Validator>,
#[prost(bytes = "bytes", tag = "3")]
pub vote_extension: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "4")]
pub extension_signature: ::prost::bytes::Bytes,
#[prost(enumeration = "super::super::types::v1::BlockIdFlag", tag = "5")]
pub block_id_flag: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Misbehavior {
#[prost(enumeration = "MisbehaviorType", 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 {
Unknown = 0,
Recheck = 1,
Check = 2,
}
impl CheckTxType {
pub fn as_str_name(&self) -> &'static str {
match self {
CheckTxType::Unknown => "CHECK_TX_TYPE_UNKNOWN",
CheckTxType::Recheck => "CHECK_TX_TYPE_RECHECK",
CheckTxType::Check => "CHECK_TX_TYPE_CHECK",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CHECK_TX_TYPE_UNKNOWN" => Some(Self::Unknown),
"CHECK_TX_TYPE_RECHECK" => Some(Self::Recheck),
"CHECK_TX_TYPE_CHECK" => Some(Self::Check),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OfferSnapshotResult {
Unknown = 0,
Accept = 1,
Abort = 2,
Reject = 3,
RejectFormat = 4,
RejectSender = 5,
}
impl OfferSnapshotResult {
pub fn as_str_name(&self) -> &'static str {
match self {
OfferSnapshotResult::Unknown => "OFFER_SNAPSHOT_RESULT_UNKNOWN",
OfferSnapshotResult::Accept => "OFFER_SNAPSHOT_RESULT_ACCEPT",
OfferSnapshotResult::Abort => "OFFER_SNAPSHOT_RESULT_ABORT",
OfferSnapshotResult::Reject => "OFFER_SNAPSHOT_RESULT_REJECT",
OfferSnapshotResult::RejectFormat => "OFFER_SNAPSHOT_RESULT_REJECT_FORMAT",
OfferSnapshotResult::RejectSender => "OFFER_SNAPSHOT_RESULT_REJECT_SENDER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OFFER_SNAPSHOT_RESULT_UNKNOWN" => Some(Self::Unknown),
"OFFER_SNAPSHOT_RESULT_ACCEPT" => Some(Self::Accept),
"OFFER_SNAPSHOT_RESULT_ABORT" => Some(Self::Abort),
"OFFER_SNAPSHOT_RESULT_REJECT" => Some(Self::Reject),
"OFFER_SNAPSHOT_RESULT_REJECT_FORMAT" => Some(Self::RejectFormat),
"OFFER_SNAPSHOT_RESULT_REJECT_SENDER" => Some(Self::RejectSender),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ApplySnapshotChunkResult {
Unknown = 0,
Accept = 1,
Abort = 2,
Retry = 3,
RetrySnapshot = 4,
RejectSnapshot = 5,
}
impl ApplySnapshotChunkResult {
pub fn as_str_name(&self) -> &'static str {
match self {
ApplySnapshotChunkResult::Unknown => "APPLY_SNAPSHOT_CHUNK_RESULT_UNKNOWN",
ApplySnapshotChunkResult::Accept => "APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT",
ApplySnapshotChunkResult::Abort => "APPLY_SNAPSHOT_CHUNK_RESULT_ABORT",
ApplySnapshotChunkResult::Retry => "APPLY_SNAPSHOT_CHUNK_RESULT_RETRY",
ApplySnapshotChunkResult::RetrySnapshot => {
"APPLY_SNAPSHOT_CHUNK_RESULT_RETRY_SNAPSHOT"
}
ApplySnapshotChunkResult::RejectSnapshot => {
"APPLY_SNAPSHOT_CHUNK_RESULT_REJECT_SNAPSHOT"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"APPLY_SNAPSHOT_CHUNK_RESULT_UNKNOWN" => Some(Self::Unknown),
"APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT" => Some(Self::Accept),
"APPLY_SNAPSHOT_CHUNK_RESULT_ABORT" => Some(Self::Abort),
"APPLY_SNAPSHOT_CHUNK_RESULT_RETRY" => Some(Self::Retry),
"APPLY_SNAPSHOT_CHUNK_RESULT_RETRY_SNAPSHOT" => Some(Self::RetrySnapshot),
"APPLY_SNAPSHOT_CHUNK_RESULT_REJECT_SNAPSHOT" => Some(Self::RejectSnapshot),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProcessProposalStatus {
Unknown = 0,
Accept = 1,
Reject = 2,
}
impl ProcessProposalStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
ProcessProposalStatus::Unknown => "PROCESS_PROPOSAL_STATUS_UNKNOWN",
ProcessProposalStatus::Accept => "PROCESS_PROPOSAL_STATUS_ACCEPT",
ProcessProposalStatus::Reject => "PROCESS_PROPOSAL_STATUS_REJECT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PROCESS_PROPOSAL_STATUS_UNKNOWN" => Some(Self::Unknown),
"PROCESS_PROPOSAL_STATUS_ACCEPT" => Some(Self::Accept),
"PROCESS_PROPOSAL_STATUS_REJECT" => Some(Self::Reject),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VerifyVoteExtensionStatus {
Unknown = 0,
Accept = 1,
Reject = 2,
}
impl VerifyVoteExtensionStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
VerifyVoteExtensionStatus::Unknown => "VERIFY_VOTE_EXTENSION_STATUS_UNKNOWN",
VerifyVoteExtensionStatus::Accept => "VERIFY_VOTE_EXTENSION_STATUS_ACCEPT",
VerifyVoteExtensionStatus::Reject => "VERIFY_VOTE_EXTENSION_STATUS_REJECT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VERIFY_VOTE_EXTENSION_STATUS_UNKNOWN" => Some(Self::Unknown),
"VERIFY_VOTE_EXTENSION_STATUS_ACCEPT" => Some(Self::Accept),
"VERIFY_VOTE_EXTENSION_STATUS_REJECT" => Some(Self::Reject),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MisbehaviorType {
Unknown = 0,
DuplicateVote = 1,
LightClientAttack = 2,
}
impl MisbehaviorType {
pub fn as_str_name(&self) -> &'static str {
match self {
MisbehaviorType::Unknown => "MISBEHAVIOR_TYPE_UNKNOWN",
MisbehaviorType::DuplicateVote => "MISBEHAVIOR_TYPE_DUPLICATE_VOTE",
MisbehaviorType::LightClientAttack => "MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MISBEHAVIOR_TYPE_UNKNOWN" => Some(Self::Unknown),
"MISBEHAVIOR_TYPE_DUPLICATE_VOTE" => Some(Self::DuplicateVote),
"MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK" => Some(Self::LightClientAttack),
_ => None,
}
}
}
#[cfg(feature = "grpc-server")]
pub mod abci_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait AbciService: Send + Sync + 'static {
async fn echo(
&self,
request: tonic::Request<super::EchoRequest>,
) -> std::result::Result<tonic::Response<super::EchoResponse>, tonic::Status>;
async fn flush(
&self,
request: tonic::Request<super::FlushRequest>,
) -> std::result::Result<tonic::Response<super::FlushResponse>, tonic::Status>;
async fn info(
&self,
request: tonic::Request<super::InfoRequest>,
) -> std::result::Result<tonic::Response<super::InfoResponse>, tonic::Status>;
async fn check_tx(
&self,
request: tonic::Request<super::CheckTxRequest>,
) -> std::result::Result<tonic::Response<super::CheckTxResponse>, tonic::Status>;
async fn query(
&self,
request: tonic::Request<super::QueryRequest>,
) -> std::result::Result<tonic::Response<super::QueryResponse>, tonic::Status>;
async fn commit(
&self,
request: tonic::Request<super::CommitRequest>,
) -> std::result::Result<tonic::Response<super::CommitResponse>, tonic::Status>;
async fn init_chain(
&self,
request: tonic::Request<super::InitChainRequest>,
) -> std::result::Result<
tonic::Response<super::InitChainResponse>,
tonic::Status,
>;
async fn list_snapshots(
&self,
request: tonic::Request<super::ListSnapshotsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSnapshotsResponse>,
tonic::Status,
>;
async fn offer_snapshot(
&self,
request: tonic::Request<super::OfferSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::OfferSnapshotResponse>,
tonic::Status,
>;
async fn load_snapshot_chunk(
&self,
request: tonic::Request<super::LoadSnapshotChunkRequest>,
) -> std::result::Result<
tonic::Response<super::LoadSnapshotChunkResponse>,
tonic::Status,
>;
async fn apply_snapshot_chunk(
&self,
request: tonic::Request<super::ApplySnapshotChunkRequest>,
) -> std::result::Result<
tonic::Response<super::ApplySnapshotChunkResponse>,
tonic::Status,
>;
async fn prepare_proposal(
&self,
request: tonic::Request<super::PrepareProposalRequest>,
) -> std::result::Result<
tonic::Response<super::PrepareProposalResponse>,
tonic::Status,
>;
async fn process_proposal(
&self,
request: tonic::Request<super::ProcessProposalRequest>,
) -> std::result::Result<
tonic::Response<super::ProcessProposalResponse>,
tonic::Status,
>;
async fn extend_vote(
&self,
request: tonic::Request<super::ExtendVoteRequest>,
) -> std::result::Result<
tonic::Response<super::ExtendVoteResponse>,
tonic::Status,
>;
async fn verify_vote_extension(
&self,
request: tonic::Request<super::VerifyVoteExtensionRequest>,
) -> std::result::Result<
tonic::Response<super::VerifyVoteExtensionResponse>,
tonic::Status,
>;
async fn finalize_block(
&self,
request: tonic::Request<super::FinalizeBlockRequest>,
) -> std::result::Result<
tonic::Response<super::FinalizeBlockResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct AbciServiceServer<T: AbciService> {
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: AbciService> AbciServiceServer<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 AbciServiceServer<T>
where
T: AbciService,
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() {
"/cometbft.abci.v1.ABCIService/Echo" => {
#[allow(non_camel_case_types)]
struct EchoSvc<T: AbciService>(pub Arc<T>);
impl<T: AbciService> tonic::server::UnaryService<super::EchoRequest>
for EchoSvc<T> {
type Response = super::EchoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::EchoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/Flush" => {
#[allow(non_camel_case_types)]
struct FlushSvc<T: AbciService>(pub Arc<T>);
impl<T: AbciService> tonic::server::UnaryService<super::FlushRequest>
for FlushSvc<T> {
type Response = super::FlushResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FlushRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/Info" => {
#[allow(non_camel_case_types)]
struct InfoSvc<T: AbciService>(pub Arc<T>);
impl<T: AbciService> tonic::server::UnaryService<super::InfoRequest>
for InfoSvc<T> {
type Response = super::InfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/CheckTx" => {
#[allow(non_camel_case_types)]
struct CheckTxSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::CheckTxRequest>
for CheckTxSvc<T> {
type Response = super::CheckTxResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CheckTxRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/Query" => {
#[allow(non_camel_case_types)]
struct QuerySvc<T: AbciService>(pub Arc<T>);
impl<T: AbciService> tonic::server::UnaryService<super::QueryRequest>
for QuerySvc<T> {
type Response = super::QueryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/Commit" => {
#[allow(non_camel_case_types)]
struct CommitSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::CommitRequest>
for CommitSvc<T> {
type Response = super::CommitResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CommitRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/InitChain" => {
#[allow(non_camel_case_types)]
struct InitChainSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::InitChainRequest>
for InitChainSvc<T> {
type Response = super::InitChainResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InitChainRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/ListSnapshots" => {
#[allow(non_camel_case_types)]
struct ListSnapshotsSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::ListSnapshotsRequest>
for ListSnapshotsSvc<T> {
type Response = super::ListSnapshotsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListSnapshotsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/OfferSnapshot" => {
#[allow(non_camel_case_types)]
struct OfferSnapshotSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::OfferSnapshotRequest>
for OfferSnapshotSvc<T> {
type Response = super::OfferSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::OfferSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/LoadSnapshotChunk" => {
#[allow(non_camel_case_types)]
struct LoadSnapshotChunkSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::LoadSnapshotChunkRequest>
for LoadSnapshotChunkSvc<T> {
type Response = super::LoadSnapshotChunkResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::LoadSnapshotChunkRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/ApplySnapshotChunk" => {
#[allow(non_camel_case_types)]
struct ApplySnapshotChunkSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::ApplySnapshotChunkRequest>
for ApplySnapshotChunkSvc<T> {
type Response = super::ApplySnapshotChunkResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ApplySnapshotChunkRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::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)
}
"/cometbft.abci.v1.ABCIService/PrepareProposal" => {
#[allow(non_camel_case_types)]
struct PrepareProposalSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::PrepareProposalRequest>
for PrepareProposalSvc<T> {
type Response = super::PrepareProposalResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PrepareProposalRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::prepare_proposal(&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 = PrepareProposalSvc(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)
}
"/cometbft.abci.v1.ABCIService/ProcessProposal" => {
#[allow(non_camel_case_types)]
struct ProcessProposalSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::ProcessProposalRequest>
for ProcessProposalSvc<T> {
type Response = super::ProcessProposalResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ProcessProposalRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::process_proposal(&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 = ProcessProposalSvc(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)
}
"/cometbft.abci.v1.ABCIService/ExtendVote" => {
#[allow(non_camel_case_types)]
struct ExtendVoteSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::ExtendVoteRequest>
for ExtendVoteSvc<T> {
type Response = super::ExtendVoteResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExtendVoteRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::extend_vote(&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 = ExtendVoteSvc(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)
}
"/cometbft.abci.v1.ABCIService/VerifyVoteExtension" => {
#[allow(non_camel_case_types)]
struct VerifyVoteExtensionSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::VerifyVoteExtensionRequest>
for VerifyVoteExtensionSvc<T> {
type Response = super::VerifyVoteExtensionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::VerifyVoteExtensionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::verify_vote_extension(&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 = VerifyVoteExtensionSvc(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)
}
"/cometbft.abci.v1.ABCIService/FinalizeBlock" => {
#[allow(non_camel_case_types)]
struct FinalizeBlockSvc<T: AbciService>(pub Arc<T>);
impl<
T: AbciService,
> tonic::server::UnaryService<super::FinalizeBlockRequest>
for FinalizeBlockSvc<T> {
type Response = super::FinalizeBlockResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FinalizeBlockRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AbciService>::finalize_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 = FinalizeBlockSvc(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: AbciService> Clone for AbciServiceServer<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: AbciService> 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: AbciService> tonic::server::NamedService for AbciServiceServer<T> {
const NAME: &'static str = "cometbft.abci.v1.ABCIService";
}
}