provwasm_std/types/tendermint/
state.rs

1use provwasm_proc_macro::CosmwasmExt;
2/// LegacyABCIResponses retains the responses
3/// of the legacy ABCI calls during block processing.
4/// Note ReponseDeliverTx is renamed to ExecTxResult but they are semantically the same
5/// Kept for backwards compatibility for versions prior to v0.38
6#[allow(clippy::derive_partial_eq_without_eq)]
7#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
8#[proto_message(type_url = "/tendermint.state.LegacyABCIResponses")]
9pub struct LegacyAbciResponses {
10    #[prost(message, repeated, tag = "1")]
11    pub deliver_txs: ::prost::alloc::vec::Vec<super::abci::ExecTxResult>,
12    #[prost(message, optional, tag = "2")]
13    pub end_block: ::core::option::Option<ResponseEndBlock>,
14    #[prost(message, optional, tag = "3")]
15    pub begin_block: ::core::option::Option<ResponseBeginBlock>,
16}
17/// ResponseBeginBlock is kept for backwards compatibility for versions prior to v0.38
18#[allow(clippy::derive_partial_eq_without_eq)]
19#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
20#[proto_message(type_url = "/tendermint.state.ResponseBeginBlock")]
21pub struct ResponseBeginBlock {
22    #[prost(message, repeated, tag = "1")]
23    pub events: ::prost::alloc::vec::Vec<super::abci::Event>,
24}
25/// ResponseEndBlock is kept for backwards compatibility for versions prior to v0.38
26#[allow(clippy::derive_partial_eq_without_eq)]
27#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
28#[proto_message(type_url = "/tendermint.state.ResponseEndBlock")]
29pub struct ResponseEndBlock {
30    #[prost(message, repeated, tag = "1")]
31    pub validator_updates: ::prost::alloc::vec::Vec<super::abci::ValidatorUpdate>,
32    #[prost(message, optional, tag = "2")]
33    pub consensus_param_updates: ::core::option::Option<super::types::ConsensusParams>,
34    #[prost(message, repeated, tag = "3")]
35    pub events: ::prost::alloc::vec::Vec<super::abci::Event>,
36}
37/// ValidatorsInfo represents the latest validator set, or the last height it changed
38#[allow(clippy::derive_partial_eq_without_eq)]
39#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
40#[proto_message(type_url = "/tendermint.state.ValidatorsInfo")]
41pub struct ValidatorsInfo {
42    #[prost(message, optional, tag = "1")]
43    pub validator_set: ::core::option::Option<super::types::ValidatorSet>,
44    #[prost(int64, tag = "2")]
45    pub last_height_changed: i64,
46}
47/// ConsensusParamsInfo represents the latest consensus params, or the last height it changed
48#[allow(clippy::derive_partial_eq_without_eq)]
49#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
50#[proto_message(type_url = "/tendermint.state.ConsensusParamsInfo")]
51pub struct ConsensusParamsInfo {
52    #[prost(message, optional, tag = "1")]
53    pub consensus_params: ::core::option::Option<super::types::ConsensusParams>,
54    #[prost(int64, tag = "2")]
55    pub last_height_changed: i64,
56}
57#[allow(clippy::derive_partial_eq_without_eq)]
58#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
59#[proto_message(type_url = "/tendermint.state.ABCIResponsesInfo")]
60pub struct AbciResponsesInfo {
61    #[prost(message, optional, tag = "1")]
62    pub legacy_abci_responses: ::core::option::Option<LegacyAbciResponses>,
63    #[prost(int64, tag = "2")]
64    pub height: i64,
65    #[prost(message, optional, tag = "3")]
66    pub response_finalize_block: ::core::option::Option<super::abci::ResponseFinalizeBlock>,
67}
68#[allow(clippy::derive_partial_eq_without_eq)]
69#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
70#[proto_message(type_url = "/tendermint.state.Version")]
71pub struct Version {
72    #[prost(message, optional, tag = "1")]
73    pub consensus: ::core::option::Option<super::version::Consensus>,
74    #[prost(string, tag = "2")]
75    pub software: ::prost::alloc::string::String,
76}
77#[allow(clippy::derive_partial_eq_without_eq)]
78#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
79#[proto_message(type_url = "/tendermint.state.State")]
80pub struct State {
81    #[prost(message, optional, tag = "1")]
82    pub version: ::core::option::Option<Version>,
83    /// immutable
84    #[prost(string, tag = "2")]
85    pub chain_id: ::prost::alloc::string::String,
86    #[prost(int64, tag = "14")]
87    pub initial_height: i64,
88    /// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
89    #[prost(int64, tag = "3")]
90    pub last_block_height: i64,
91    #[prost(message, optional, tag = "4")]
92    pub last_block_id: ::core::option::Option<super::types::BlockId>,
93    #[prost(message, optional, tag = "5")]
94    pub last_block_time: ::core::option::Option<crate::shim::Timestamp>,
95    /// LastValidators is used to validate block.LastCommit.
96    /// Validators are persisted to the database separately every time they change,
97    /// so we can query for historical validator sets.
98    /// Note that if s.LastBlockHeight causes a valset change,
99    /// we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1
100    /// Extra +1 due to nextValSet delay.
101    #[prost(message, optional, tag = "6")]
102    pub next_validators: ::core::option::Option<super::types::ValidatorSet>,
103    #[prost(message, optional, tag = "7")]
104    pub validators: ::core::option::Option<super::types::ValidatorSet>,
105    #[prost(message, optional, tag = "8")]
106    pub last_validators: ::core::option::Option<super::types::ValidatorSet>,
107    #[prost(int64, tag = "9")]
108    pub last_height_validators_changed: i64,
109    /// Consensus parameters used for validating blocks.
110    /// Changes returned by EndBlock and updated after Commit.
111    #[prost(message, optional, tag = "10")]
112    pub consensus_params: ::core::option::Option<super::types::ConsensusParams>,
113    #[prost(int64, tag = "11")]
114    pub last_height_consensus_params_changed: i64,
115    /// Merkle root of the results from executing prev block
116    #[prost(bytes = "vec", tag = "12")]
117    pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
118    /// the latest AppHash we've received from calling abci.Commit()
119    #[prost(bytes = "vec", tag = "13")]
120    pub app_hash: ::prost::alloc::vec::Vec<u8>,
121}