#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Msg {
#[prost(message, optional, tag = "1")]
pub msg: ::core::option::Option<NetMsg>,
#[prost(string, tag = "2")]
pub chain_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub flag: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NetMsg {
#[prost(bytes = "vec", tag = "1")]
pub payload: ::prost::alloc::vec::Vec<u8>,
#[prost(enumeration = "net_msg::MsgType", tag = "2")]
pub r#type: i32,
#[prost(string, tag = "3")]
pub to: ::prost::alloc::string::String,
}
pub mod net_msg {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MsgType {
InvalidMsg = 0,
Tx = 1,
Txs = 2,
Block = 3,
Blocks = 4,
ConsensusMsg = 5,
SyncBlockMsg = 6,
ConsistentMsg = 7,
}
impl MsgType {
pub fn as_str_name(&self) -> &'static str {
match self {
MsgType::InvalidMsg => "INVALID_MSG",
MsgType::Tx => "TX",
MsgType::Txs => "TXS",
MsgType::Block => "BLOCK",
MsgType::Blocks => "BLOCKS",
MsgType::ConsensusMsg => "CONSENSUS_MSG",
MsgType::SyncBlockMsg => "SYNC_BLOCK_MSG",
MsgType::ConsistentMsg => "CONSISTENT_MSG",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INVALID_MSG" => Some(Self::InvalidMsg),
"TX" => Some(Self::Tx),
"TXS" => Some(Self::Txs),
"BLOCK" => Some(Self::Block),
"BLOCKS" => Some(Self::Blocks),
"CONSENSUS_MSG" => Some(Self::ConsensusMsg),
"SYNC_BLOCK_MSG" => Some(Self::SyncBlockMsg),
"CONSISTENT_MSG" => Some(Self::ConsistentMsg),
_ => None,
}
}
}
}