persistence_std/types/tendermint/
blocksync.rs

1use persistence_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}
61/// StatusRequest requests the status of a peer.
62#[allow(clippy::derive_partial_eq_without_eq)]
63#[derive(
64    Clone,
65    PartialEq,
66    Eq,
67    ::prost::Message,
68    ::serde::Serialize,
69    ::serde::Deserialize,
70    ::schemars::JsonSchema,
71    CosmwasmExt,
72)]
73#[proto_message(type_url = "/tendermint.blocksync.StatusRequest")]
74pub struct StatusRequest {}
75/// StatusResponse is a peer response to inform their status.
76#[allow(clippy::derive_partial_eq_without_eq)]
77#[derive(
78    Clone,
79    PartialEq,
80    Eq,
81    ::prost::Message,
82    ::serde::Serialize,
83    ::serde::Deserialize,
84    ::schemars::JsonSchema,
85    CosmwasmExt,
86)]
87#[proto_message(type_url = "/tendermint.blocksync.StatusResponse")]
88pub struct StatusResponse {
89    #[prost(int64, tag = "1")]
90    #[serde(
91        serialize_with = "crate::serde::as_str::serialize",
92        deserialize_with = "crate::serde::as_str::deserialize"
93    )]
94    pub height: i64,
95    #[prost(int64, tag = "2")]
96    #[serde(
97        serialize_with = "crate::serde::as_str::serialize",
98        deserialize_with = "crate::serde::as_str::deserialize"
99    )]
100    pub base: i64,
101}
102#[allow(clippy::derive_partial_eq_without_eq)]
103#[derive(
104    Clone,
105    PartialEq,
106    Eq,
107    ::prost::Message,
108    ::serde::Serialize,
109    ::serde::Deserialize,
110    ::schemars::JsonSchema,
111    CosmwasmExt,
112)]
113#[proto_message(type_url = "/tendermint.blocksync.Message")]
114pub struct Message {
115    #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5")]
116    pub sum: ::core::option::Option<message::Sum>,
117}
118/// Nested message and enum types in `Message`.
119pub mod message {
120    use persistence_std_derive::CosmwasmExt;
121    #[allow(clippy::derive_partial_eq_without_eq)]
122    #[derive(
123        Clone,
124        PartialEq,
125        Eq,
126        ::prost::Oneof,
127        ::schemars::JsonSchema,
128        ::serde::Serialize,
129        ::serde::Deserialize,
130    )]
131    pub enum Sum {
132        #[prost(message, tag = "1")]
133        BlockRequest(super::BlockRequest),
134        #[prost(message, tag = "2")]
135        NoBlockResponse(super::NoBlockResponse),
136        #[prost(message, tag = "3")]
137        BlockResponse(super::BlockResponse),
138        #[prost(message, tag = "4")]
139        StatusRequest(super::StatusRequest),
140        #[prost(message, tag = "5")]
141        StatusResponse(super::StatusResponse),
142    }
143}