persistence_std/types/tendermint/
state.rs

1use persistence_std_derive::CosmwasmExt;
2/// ABCIResponses retains the responses
3/// of the various ABCI calls during block processing.
4/// It is persisted to disk for each height before calling Commit.
5#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(
7    Clone,
8    PartialEq,
9    Eq,
10    ::prost::Message,
11    ::serde::Serialize,
12    ::serde::Deserialize,
13    ::schemars::JsonSchema,
14    CosmwasmExt,
15)]
16#[proto_message(type_url = "/tendermint.state.ABCIResponses")]
17pub struct AbciResponses {
18    #[prost(message, repeated, tag = "1")]
19    pub deliver_txs: ::prost::alloc::vec::Vec<super::abci::ResponseDeliverTx>,
20    #[prost(message, optional, tag = "2")]
21    pub end_block: ::core::option::Option<super::abci::ResponseEndBlock>,
22    #[prost(message, optional, tag = "3")]
23    pub begin_block: ::core::option::Option<super::abci::ResponseBeginBlock>,
24}
25/// ValidatorsInfo represents the latest validator set, or the last height it changed
26#[allow(clippy::derive_partial_eq_without_eq)]
27#[derive(
28    Clone,
29    PartialEq,
30    Eq,
31    ::prost::Message,
32    ::serde::Serialize,
33    ::serde::Deserialize,
34    ::schemars::JsonSchema,
35    CosmwasmExt,
36)]
37#[proto_message(type_url = "/tendermint.state.ValidatorsInfo")]
38pub struct ValidatorsInfo {
39    #[prost(message, optional, tag = "1")]
40    pub validator_set: ::core::option::Option<super::types::ValidatorSet>,
41    #[prost(int64, tag = "2")]
42    #[serde(
43        serialize_with = "crate::serde::as_str::serialize",
44        deserialize_with = "crate::serde::as_str::deserialize"
45    )]
46    pub last_height_changed: i64,
47}
48/// ConsensusParamsInfo represents the latest consensus params, or the last height it changed
49#[allow(clippy::derive_partial_eq_without_eq)]
50#[derive(
51    Clone,
52    PartialEq,
53    Eq,
54    ::prost::Message,
55    ::serde::Serialize,
56    ::serde::Deserialize,
57    ::schemars::JsonSchema,
58    CosmwasmExt,
59)]
60#[proto_message(type_url = "/tendermint.state.ConsensusParamsInfo")]
61pub struct ConsensusParamsInfo {
62    #[prost(message, optional, tag = "1")]
63    pub consensus_params: ::core::option::Option<super::types::ConsensusParams>,
64    #[prost(int64, tag = "2")]
65    #[serde(
66        serialize_with = "crate::serde::as_str::serialize",
67        deserialize_with = "crate::serde::as_str::deserialize"
68    )]
69    pub last_height_changed: i64,
70}
71#[allow(clippy::derive_partial_eq_without_eq)]
72#[derive(
73    Clone,
74    PartialEq,
75    Eq,
76    ::prost::Message,
77    ::serde::Serialize,
78    ::serde::Deserialize,
79    ::schemars::JsonSchema,
80    CosmwasmExt,
81)]
82#[proto_message(type_url = "/tendermint.state.ABCIResponsesInfo")]
83pub struct AbciResponsesInfo {
84    #[prost(message, optional, tag = "1")]
85    pub abci_responses: ::core::option::Option<AbciResponses>,
86    #[prost(int64, tag = "2")]
87    #[serde(
88        serialize_with = "crate::serde::as_str::serialize",
89        deserialize_with = "crate::serde::as_str::deserialize"
90    )]
91    pub height: i64,
92}
93#[allow(clippy::derive_partial_eq_without_eq)]
94#[derive(
95    Clone,
96    PartialEq,
97    Eq,
98    ::prost::Message,
99    ::serde::Serialize,
100    ::serde::Deserialize,
101    ::schemars::JsonSchema,
102    CosmwasmExt,
103)]
104#[proto_message(type_url = "/tendermint.state.Version")]
105pub struct Version {
106    #[prost(message, optional, tag = "1")]
107    pub consensus: ::core::option::Option<super::version::Consensus>,
108    #[prost(string, tag = "2")]
109    pub software: ::prost::alloc::string::String,
110}
111#[allow(clippy::derive_partial_eq_without_eq)]
112#[derive(
113    Clone,
114    PartialEq,
115    Eq,
116    ::prost::Message,
117    ::serde::Serialize,
118    ::serde::Deserialize,
119    ::schemars::JsonSchema,
120    CosmwasmExt,
121)]
122#[proto_message(type_url = "/tendermint.state.State")]
123pub struct State {
124    #[prost(message, optional, tag = "1")]
125    pub version: ::core::option::Option<Version>,
126    /// immutable
127    #[prost(string, tag = "2")]
128    #[serde(alias = "chainID")]
129    pub chain_id: ::prost::alloc::string::String,
130    #[prost(int64, tag = "14")]
131    #[serde(
132        serialize_with = "crate::serde::as_str::serialize",
133        deserialize_with = "crate::serde::as_str::deserialize"
134    )]
135    pub initial_height: i64,
136    /// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
137    #[prost(int64, tag = "3")]
138    #[serde(
139        serialize_with = "crate::serde::as_str::serialize",
140        deserialize_with = "crate::serde::as_str::deserialize"
141    )]
142    pub last_block_height: i64,
143    #[prost(message, optional, tag = "4")]
144    #[serde(alias = "last_blockID")]
145    pub last_block_id: ::core::option::Option<super::types::BlockId>,
146    #[prost(message, optional, tag = "5")]
147    pub last_block_time: ::core::option::Option<crate::shim::Timestamp>,
148    /// LastValidators is used to validate block.LastCommit.
149    /// Validators are persisted to the database separately every time they change,
150    /// so we can query for historical validator sets.
151    /// Note that if s.LastBlockHeight causes a valset change,
152    /// we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1
153    /// Extra +1 due to nextValSet delay.
154    #[prost(message, optional, tag = "6")]
155    pub next_validators: ::core::option::Option<super::types::ValidatorSet>,
156    #[prost(message, optional, tag = "7")]
157    pub validators: ::core::option::Option<super::types::ValidatorSet>,
158    #[prost(message, optional, tag = "8")]
159    pub last_validators: ::core::option::Option<super::types::ValidatorSet>,
160    #[prost(int64, tag = "9")]
161    #[serde(
162        serialize_with = "crate::serde::as_str::serialize",
163        deserialize_with = "crate::serde::as_str::deserialize"
164    )]
165    pub last_height_validators_changed: i64,
166    /// Consensus parameters used for validating blocks.
167    /// Changes returned by EndBlock and updated after Commit.
168    #[prost(message, optional, tag = "10")]
169    pub consensus_params: ::core::option::Option<super::types::ConsensusParams>,
170    #[prost(int64, tag = "11")]
171    #[serde(
172        serialize_with = "crate::serde::as_str::serialize",
173        deserialize_with = "crate::serde::as_str::deserialize"
174    )]
175    pub last_height_consensus_params_changed: i64,
176    /// Merkle root of the results from executing prev block
177    #[prost(bytes = "vec", tag = "12")]
178    pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
179    /// the latest AppHash we've received from calling abci.Commit()
180    #[prost(bytes = "vec", tag = "13")]
181    pub app_hash: ::prost::alloc::vec::Vec<u8>,
182}