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