Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use protobuffers from celestia-core #1

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 111 additions & 4 deletions proto/src/prost/v0_34/tendermint.abci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pub struct Request {
#[prost(
oneof = "request::Value",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15"
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17"
)]
pub value: ::core::option::Option<request::Value>,
}
Expand Down Expand Up @@ -42,6 +42,10 @@ pub mod request {
LoadSnapshotChunk(super::RequestLoadSnapshotChunk),
#[prost(message, tag = "15")]
ApplySnapshotChunk(super::RequestApplySnapshotChunk),
#[prost(message, tag = "16")]
PrepareProposal(super::RequestPrepareProposal),
#[prost(message, tag = "17")]
ProcessProposal(super::RequestProcessProposal),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -174,10 +178,30 @@ pub struct RequestApplySnapshotChunk {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestPrepareProposal {
/// block_data is an array of transactions that will be included in a block,
/// sent to the app for possible modifications.
/// applications can not exceed the size of the data passed to it.
#[prost(message, optional, tag = "1")]
pub block_data: ::core::option::Option<super::types::Data>,
/// If an application decides to populate block_data with extra information, they can not exceed this value.
#[prost(int64, tag = "2")]
pub block_data_size: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestProcessProposal {
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<super::types::Header>,
#[prost(message, optional, tag = "2")]
pub block_data: ::core::option::Option<super::types::Data>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
#[prost(
oneof = "response::Value",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16"
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18"
)]
pub value: ::core::option::Option<response::Value>,
}
Expand Down Expand Up @@ -218,6 +242,10 @@ pub mod response {
LoadSnapshotChunk(super::ResponseLoadSnapshotChunk),
#[prost(message, tag = "16")]
ApplySnapshotChunk(super::ResponseApplySnapshotChunk),
#[prost(message, tag = "17")]
PrepareProposal(super::ResponsePrepareProposal),
#[prost(message, tag = "18")]
ProcessProposal(super::ResponseProcessProposal),
}
}
/// nondeterministic
Expand Down Expand Up @@ -397,7 +425,17 @@ pub struct ResponseOfferSnapshot {
}
/// Nested message and enum types in `ResponseOfferSnapshot`.
pub mod response_offer_snapshot {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Result {
/// Unknown result, abort all snapshot restoration
Expand Down Expand Up @@ -462,7 +500,17 @@ pub struct ResponseApplySnapshotChunk {
}
/// Nested message and enum types in `ResponseApplySnapshotChunk`.
pub mod response_apply_snapshot_chunk {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Result {
/// Unknown result, abort all snapshot restoration
Expand Down Expand Up @@ -507,6 +555,65 @@ pub mod response_apply_snapshot_chunk {
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponsePrepareProposal {
#[prost(message, optional, tag = "1")]
pub block_data: ::core::option::Option<super::types::Data>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseProcessProposal {
#[prost(enumeration = "response_process_proposal::Result", tag = "1")]
pub result: i32,
#[prost(bytes = "bytes", repeated, tag = "2")]
pub evidence: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
}
/// Nested message and enum types in `ResponseProcessProposal`.
pub mod response_process_proposal {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Result {
/// Unknown result, invalidate
Unknown = 0,
/// proposal verified, vote on the proposal
Accept = 1,
/// proposal invalidated
Reject = 2,
}
impl Result {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Result::Unknown => "UNKNOWN",
Result::Accept => "ACCEPT",
Result::Reject => "REJECT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"ACCEPT" => Some(Self::Accept),
"REJECT" => Some(Self::Reject),
_ => None,
}
}
}
}
/// ConsensusParams contains all consensus-relevant parameters
/// that can be adjusted by the abci app
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
18 changes: 17 additions & 1 deletion proto/src/prost/v0_34/tendermint.mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@ pub struct Txs {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SeenTx {
#[prost(bytes = "vec", tag = "1")]
pub tx_key: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WantTx {
#[prost(bytes = "vec", tag = "1")]
pub tx_key: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
#[prost(oneof = "message::Sum", tags = "1")]
#[prost(oneof = "message::Sum", tags = "1, 2, 3")]
pub sum: ::core::option::Option<message::Sum>,
}
/// Nested message and enum types in `Message`.
Expand All @@ -17,5 +29,9 @@ pub mod message {
pub enum Sum {
#[prost(message, tag = "1")]
Txs(super::Txs),
#[prost(message, tag = "2")]
SeenTx(super::SeenTx),
#[prost(message, tag = "3")]
WantTx(super::WantTx),
}
}
86 changes: 43 additions & 43 deletions proto/src/prost/v0_34/tendermint.p2p.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PacketPing {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PacketPong {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PacketMsg {
#[prost(int32, tag = "1")]
pub channel_id: i32,
#[prost(bool, tag = "2")]
pub eof: bool,
#[prost(bytes = "vec", tag = "3")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Packet {
#[prost(oneof = "packet::Sum", tags = "1, 2, 3")]
pub sum: ::core::option::Option<packet::Sum>,
}
/// Nested message and enum types in `Packet`.
pub mod packet {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sum {
#[prost(message, tag = "1")]
PacketPing(super::PacketPing),
#[prost(message, tag = "2")]
PacketPong(super::PacketPong),
#[prost(message, tag = "3")]
PacketMsg(super::PacketMsg),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthSigMessage {
#[prost(message, optional, tag = "1")]
pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
#[prost(bytes = "vec", tag = "2")]
pub sig: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NetAddress {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
Expand Down Expand Up @@ -48,49 +91,6 @@ pub struct DefaultNodeInfoOther {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PacketPing {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PacketPong {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PacketMsg {
#[prost(int32, tag = "1")]
pub channel_id: i32,
#[prost(bool, tag = "2")]
pub eof: bool,
#[prost(bytes = "vec", tag = "3")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Packet {
#[prost(oneof = "packet::Sum", tags = "1, 2, 3")]
pub sum: ::core::option::Option<packet::Sum>,
}
/// Nested message and enum types in `Packet`.
pub mod packet {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sum {
#[prost(message, tag = "1")]
PacketPing(super::PacketPing),
#[prost(message, tag = "2")]
PacketPong(super::PacketPong),
#[prost(message, tag = "3")]
PacketMsg(super::PacketMsg),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthSigMessage {
#[prost(message, optional, tag = "1")]
pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
#[prost(bytes = "vec", tag = "2")]
pub sig: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PexRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
Loading