neutron_std/types/tendermint/
blocksync.rs

1use neutron_std_derive::CosmwasmExt;
2/// BlockRequest requests a block for a specific height
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(
5    Clone,
6    PartialEq,
7    Eq,
8    ::prost::Message,
9    ::serde::Serialize,
10    ::serde::Deserialize,
11    ::schemars::JsonSchema,
12    CosmwasmExt,
13)]
14#[proto_message(type_url = "/tendermint.blocksync.BlockRequest")]
15pub struct BlockRequest {
16    #[prost(int64, tag = "1")]
17    #[serde(
18        serialize_with = "crate::serde::as_str::serialize",
19        deserialize_with = "crate::serde::as_str::deserialize"
20    )]
21    pub height: i64,
22}
23/// NoBlockResponse informs the node that the peer does not have block at the requested height
24#[allow(clippy::derive_partial_eq_without_eq)]
25#[derive(
26    Clone,
27    PartialEq,
28    Eq,
29    ::prost::Message,
30    ::serde::Serialize,
31    ::serde::Deserialize,
32    ::schemars::JsonSchema,
33    CosmwasmExt,
34)]
35#[proto_message(type_url = "/tendermint.blocksync.NoBlockResponse")]
36pub struct NoBlockResponse {
37    #[prost(int64, tag = "1")]
38    #[serde(
39        serialize_with = "crate::serde::as_str::serialize",
40        deserialize_with = "crate::serde::as_str::deserialize"
41    )]
42    pub height: i64,
43}
44/// BlockResponse returns block to the requested
45#[allow(clippy::derive_partial_eq_without_eq)]
46#[derive(
47    Clone,
48    PartialEq,
49    Eq,
50    ::prost::Message,
51    ::serde::Serialize,
52    ::serde::Deserialize,
53    ::schemars::JsonSchema,
54    CosmwasmExt,
55)]
56#[proto_message(type_url = "/tendermint.blocksync.BlockResponse")]
57pub struct BlockResponse {
58    #[prost(message, optional, tag = "1")]
59    pub block: ::core::option::Option<super::types::Block>,
60    #[prost(message, optional, tag = "2")]
61    pub ext_commit: ::core::option::Option<super::types::ExtendedCommit>,
62}
63/// StatusRequest requests the status of a peer.
64#[allow(clippy::derive_partial_eq_without_eq)]
65#[derive(
66    Clone,
67    PartialEq,
68    Eq,
69    ::prost::Message,
70    ::serde::Serialize,
71    ::serde::Deserialize,
72    ::schemars::JsonSchema,
73    CosmwasmExt,
74)]
75#[proto_message(type_url = "/tendermint.blocksync.StatusRequest")]
76pub struct StatusRequest {}
77/// StatusResponse is a peer response to inform their status.
78#[allow(clippy::derive_partial_eq_without_eq)]
79#[derive(
80    Clone,
81    PartialEq,
82    Eq,
83    ::prost::Message,
84    ::serde::Serialize,
85    ::serde::Deserialize,
86    ::schemars::JsonSchema,
87    CosmwasmExt,
88)]
89#[proto_message(type_url = "/tendermint.blocksync.StatusResponse")]
90pub struct StatusResponse {
91    #[prost(int64, tag = "1")]
92    #[serde(
93        serialize_with = "crate::serde::as_str::serialize",
94        deserialize_with = "crate::serde::as_str::deserialize"
95    )]
96    pub height: i64,
97    #[prost(int64, tag = "2")]
98    #[serde(
99        serialize_with = "crate::serde::as_str::serialize",
100        deserialize_with = "crate::serde::as_str::deserialize"
101    )]
102    pub base: i64,
103}
104#[allow(clippy::derive_partial_eq_without_eq)]
105#[derive(
106    Clone,
107    PartialEq,
108    Eq,
109    ::prost::Message,
110    ::serde::Serialize,
111    ::serde::Deserialize,
112    ::schemars::JsonSchema,
113    CosmwasmExt,
114)]
115#[proto_message(type_url = "/tendermint.blocksync.Message")]
116pub struct Message {
117    #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5")]
118    pub sum: ::core::option::Option<message::Sum>,
119}
120/// Nested message and enum types in `Message`.
121pub mod message {
122    #[allow(clippy::derive_partial_eq_without_eq)]
123    #[derive(
124        Clone,
125        PartialEq,
126        Eq,
127        ::prost::Oneof,
128        ::serde::Serialize,
129        ::serde::Deserialize,
130        ::schemars::JsonSchema,
131    )]
132    pub enum Sum {
133        #[prost(message, tag = "1")]
134        BlockRequest(super::BlockRequest),
135        #[prost(message, tag = "2")]
136        NoBlockResponse(super::NoBlockResponse),
137        #[prost(message, tag = "3")]
138        BlockResponse(Box<super::BlockResponse>),
139        #[prost(message, tag = "4")]
140        StatusRequest(super::StatusRequest),
141        #[prost(message, tag = "5")]
142        StatusResponse(super::StatusResponse),
143    }
144}