provwasm_std/types/tendermint/
consensus.rs

1use provwasm_proc_macro::CosmwasmExt;
2/// NewRoundStep is sent for every step taken in the ConsensusState.
3/// For every height/round/step transition
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
6#[proto_message(type_url = "/tendermint.consensus.NewRoundStep")]
7pub struct NewRoundStep {
8    #[prost(int64, tag = "1")]
9    pub height: i64,
10    #[prost(int32, tag = "2")]
11    pub round: i32,
12    #[prost(uint32, tag = "3")]
13    pub step: u32,
14    #[prost(int64, tag = "4")]
15    pub seconds_since_start_time: i64,
16    #[prost(int32, tag = "5")]
17    pub last_commit_round: i32,
18}
19/// NewValidBlock is sent when a validator observes a valid block B in some round r,
20/// i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
21/// In case the block is also committed, then IsCommit flag is set to true.
22#[allow(clippy::derive_partial_eq_without_eq)]
23#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
24#[proto_message(type_url = "/tendermint.consensus.NewValidBlock")]
25pub struct NewValidBlock {
26    #[prost(int64, tag = "1")]
27    pub height: i64,
28    #[prost(int32, tag = "2")]
29    pub round: i32,
30    #[prost(message, optional, tag = "3")]
31    pub block_part_set_header: ::core::option::Option<super::types::PartSetHeader>,
32    #[prost(message, optional, tag = "4")]
33    pub block_parts: ::core::option::Option<super::libs::bits::BitArray>,
34    #[prost(bool, tag = "5")]
35    pub is_commit: bool,
36}
37/// Proposal is sent when a new block is proposed.
38#[allow(clippy::derive_partial_eq_without_eq)]
39#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
40#[proto_message(type_url = "/tendermint.consensus.Proposal")]
41pub struct Proposal {
42    #[prost(message, optional, tag = "1")]
43    pub proposal: ::core::option::Option<super::types::Proposal>,
44}
45/// ProposalPOL is sent when a previous proposal is re-proposed.
46#[allow(clippy::derive_partial_eq_without_eq)]
47#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
48#[proto_message(type_url = "/tendermint.consensus.ProposalPOL")]
49pub struct ProposalPol {
50    #[prost(int64, tag = "1")]
51    pub height: i64,
52    #[prost(int32, tag = "2")]
53    pub proposal_pol_round: i32,
54    #[prost(message, optional, tag = "3")]
55    pub proposal_pol: ::core::option::Option<super::libs::bits::BitArray>,
56}
57/// BlockPart is sent when gossipping a piece of the proposed block.
58#[allow(clippy::derive_partial_eq_without_eq)]
59#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
60#[proto_message(type_url = "/tendermint.consensus.BlockPart")]
61pub struct BlockPart {
62    #[prost(int64, tag = "1")]
63    pub height: i64,
64    #[prost(int32, tag = "2")]
65    pub round: i32,
66    #[prost(message, optional, tag = "3")]
67    pub part: ::core::option::Option<super::types::Part>,
68}
69/// Vote is sent when voting for a proposal (or lack thereof).
70#[allow(clippy::derive_partial_eq_without_eq)]
71#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
72#[proto_message(type_url = "/tendermint.consensus.Vote")]
73pub struct Vote {
74    #[prost(message, optional, tag = "1")]
75    pub vote: ::core::option::Option<super::types::Vote>,
76}
77/// HasVote is sent to indicate that a particular vote has been received.
78#[allow(clippy::derive_partial_eq_without_eq)]
79#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
80#[proto_message(type_url = "/tendermint.consensus.HasVote")]
81pub struct HasVote {
82    #[prost(int64, tag = "1")]
83    pub height: i64,
84    #[prost(int32, tag = "2")]
85    pub round: i32,
86    #[prost(enumeration = "super::types::SignedMsgType", tag = "3")]
87    pub r#type: i32,
88    #[prost(int32, tag = "4")]
89    pub index: i32,
90}
91/// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes.
92#[allow(clippy::derive_partial_eq_without_eq)]
93#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
94#[proto_message(type_url = "/tendermint.consensus.VoteSetMaj23")]
95pub struct VoteSetMaj23 {
96    #[prost(int64, tag = "1")]
97    pub height: i64,
98    #[prost(int32, tag = "2")]
99    pub round: i32,
100    #[prost(enumeration = "super::types::SignedMsgType", tag = "3")]
101    pub r#type: i32,
102    #[prost(message, optional, tag = "4")]
103    pub block_id: ::core::option::Option<super::types::BlockId>,
104}
105/// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID.
106#[allow(clippy::derive_partial_eq_without_eq)]
107#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
108#[proto_message(type_url = "/tendermint.consensus.VoteSetBits")]
109pub struct VoteSetBits {
110    #[prost(int64, tag = "1")]
111    pub height: i64,
112    #[prost(int32, tag = "2")]
113    pub round: i32,
114    #[prost(enumeration = "super::types::SignedMsgType", tag = "3")]
115    pub r#type: i32,
116    #[prost(message, optional, tag = "4")]
117    pub block_id: ::core::option::Option<super::types::BlockId>,
118    #[prost(message, optional, tag = "5")]
119    pub votes: ::core::option::Option<super::libs::bits::BitArray>,
120}
121#[allow(clippy::derive_partial_eq_without_eq)]
122#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
123#[proto_message(type_url = "/tendermint.consensus.Message")]
124pub struct Message {
125    #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
126    pub sum: ::core::option::Option<message::Sum>,
127}
128/// Nested message and enum types in `Message`.
129pub mod message {
130    use provwasm_proc_macro::CosmwasmExt;
131    #[allow(clippy::derive_partial_eq_without_eq)]
132    #[derive(Clone, PartialEq, Eq, ::prost::Oneof, ::schemars::JsonSchema)]
133    pub enum Sum {
134        #[prost(message, tag = "1")]
135        NewRoundStep(super::NewRoundStep),
136        #[prost(message, tag = "2")]
137        NewValidBlock(super::NewValidBlock),
138        #[prost(message, tag = "3")]
139        Proposal(super::Proposal),
140        #[prost(message, tag = "4")]
141        ProposalPol(super::ProposalPol),
142        #[prost(message, tag = "5")]
143        BlockPart(super::BlockPart),
144        #[prost(message, tag = "6")]
145        Vote(super::Vote),
146        #[prost(message, tag = "7")]
147        HasVote(super::HasVote),
148        #[prost(message, tag = "8")]
149        VoteSetMaj23(super::VoteSetMaj23),
150        #[prost(message, tag = "9")]
151        VoteSetBits(super::VoteSetBits),
152    }
153}
154/// MsgInfo are msgs from the reactor which may update the state
155#[allow(clippy::derive_partial_eq_without_eq)]
156#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
157#[proto_message(type_url = "/tendermint.consensus.MsgInfo")]
158pub struct MsgInfo {
159    #[prost(message, optional, tag = "1")]
160    pub msg: ::core::option::Option<Message>,
161    #[prost(string, tag = "2")]
162    pub peer_id: ::prost::alloc::string::String,
163}
164/// TimeoutInfo internally generated messages which may update the state
165#[allow(clippy::derive_partial_eq_without_eq)]
166#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
167#[proto_message(type_url = "/tendermint.consensus.TimeoutInfo")]
168pub struct TimeoutInfo {
169    #[prost(message, optional, tag = "1")]
170    pub duration: ::core::option::Option<crate::shim::Duration>,
171    #[prost(int64, tag = "2")]
172    pub height: i64,
173    #[prost(int32, tag = "3")]
174    pub round: i32,
175    #[prost(uint32, tag = "4")]
176    pub step: u32,
177}
178/// EndHeight marks the end of the given height inside WAL.
179/// @internal used by scripts/wal2json util.
180#[allow(clippy::derive_partial_eq_without_eq)]
181#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
182#[proto_message(type_url = "/tendermint.consensus.EndHeight")]
183pub struct EndHeight {
184    #[prost(int64, tag = "1")]
185    pub height: i64,
186}
187#[allow(clippy::derive_partial_eq_without_eq)]
188#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
189#[proto_message(type_url = "/tendermint.consensus.WALMessage")]
190pub struct WalMessage {
191    #[prost(oneof = "wal_message::Sum", tags = "1, 2, 3, 4")]
192    pub sum: ::core::option::Option<wal_message::Sum>,
193}
194/// Nested message and enum types in `WALMessage`.
195pub mod wal_message {
196    use provwasm_proc_macro::CosmwasmExt;
197    #[allow(clippy::derive_partial_eq_without_eq)]
198    #[derive(Clone, PartialEq, Eq, ::prost::Oneof, ::schemars::JsonSchema)]
199    pub enum Sum {
200        #[prost(message, tag = "1")]
201        EventDataRoundState(super::super::types::EventDataRoundState),
202        #[prost(message, tag = "2")]
203        MsgInfo(super::MsgInfo),
204        #[prost(message, tag = "3")]
205        TimeoutInfo(super::TimeoutInfo),
206        #[prost(message, tag = "4")]
207        EndHeight(super::EndHeight),
208    }
209}
210/// TimedWALMessage wraps WALMessage and adds Time for debugging purposes.
211#[allow(clippy::derive_partial_eq_without_eq)]
212#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
213#[proto_message(type_url = "/tendermint.consensus.TimedWALMessage")]
214pub struct TimedWalMessage {
215    #[prost(message, optional, tag = "1")]
216    pub time: ::core::option::Option<crate::shim::Timestamp>,
217    #[prost(message, optional, tag = "2")]
218    pub msg: ::core::option::Option<WalMessage>,
219}