juno_std/types/tendermint/
state.rs

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