#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyResult {
#[prost(message, optional, tag = "1")]
pub verified_block: ::core::option::Option<super::common::Block>,
#[prost(enumeration = "verify_result::Code", tag = "2")]
pub code: i32,
#[prost(string, tag = "3")]
pub msg: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "4")]
pub txs_rw_set:
::std::collections::HashMap<::prost::alloc::string::String, super::common::TxRwSet>,
#[prost(message, optional, tag = "5")]
pub rw_set_verify_fail_txs: ::core::option::Option<RwSetVerifyFailTxs>,
}
pub mod verify_result {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Code {
Success = 0,
Fail = 1,
}
impl Code {
pub fn as_str_name(&self) -> &'static str {
match self {
Code::Success => "SUCCESS",
Code::Fail => "FAIL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SUCCESS" => Some(Self::Success),
"FAIL" => Some(Self::Fail),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RwSetVerifyFailTxs {
#[prost(uint64, tag = "1")]
pub block_height: u64,
#[prost(string, repeated, tag = "2")]
pub tx_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProposalBlock {
#[prost(message, optional, tag = "1")]
pub block: ::core::option::Option<super::common::Block>,
#[prost(map = "string, message", tag = "2")]
pub txs_rw_set:
::std::collections::HashMap<::prost::alloc::string::String, super::common::TxRwSet>,
#[prost(message, optional, tag = "3")]
pub cut_block: ::core::option::Option<super::common::Block>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockHeaderConsensusArgs {
#[prost(int64, tag = "1")]
pub consensus_type: i64,
#[prost(uint64, tag = "2")]
pub round: u64,
#[prost(uint64, tag = "3")]
pub view: u64,
#[prost(message, optional, tag = "4")]
pub consensus_data: ::core::option::Option<super::common::TxRwSet>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GovernanceMember {
#[prost(string, tag = "1")]
pub node_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub index: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GovernanceContract {
#[prost(uint64, tag = "1")]
pub epoch_id: u64,
#[prost(enumeration = "ConsensusType", tag = "2")]
pub r#type: i32,
#[prost(int64, tag = "3")]
pub cur_max_index: i64,
#[prost(bool, tag = "4")]
pub skip_timeout_commit: bool,
#[prost(uint64, tag = "6")]
pub config_sequence: u64,
#[prost(uint64, tag = "7")]
pub n: u64,
#[prost(uint64, tag = "8")]
pub min_quorum_for_qc: u64,
#[prost(uint64, tag = "9")]
pub cached_len: u64,
#[prost(uint64, tag = "10")]
pub next_switch_height: u64,
#[prost(uint64, tag = "11")]
pub transit_block: u64,
#[prost(uint64, tag = "12")]
pub block_num_per_epoch: u64,
#[prost(uint64, tag = "13")]
pub validator_num: u64,
#[prost(uint64, tag = "14")]
pub node_propose_round: u64,
#[prost(message, repeated, tag = "15")]
pub members: ::prost::alloc::vec::Vec<GovernanceMember>,
#[prost(message, repeated, tag = "16")]
pub validators: ::prost::alloc::vec::Vec<GovernanceMember>,
#[prost(message, repeated, tag = "17")]
pub next_validators: ::prost::alloc::vec::Vec<GovernanceMember>,
#[prost(uint64, tag = "18")]
pub last_min_quorum_for_qc: u64,
#[prost(uint64, tag = "19")]
pub maxbft_round_timeout_mill: u64,
#[prost(uint64, tag = "20")]
pub maxbft_round_timeout_interval_mill: u64,
#[prost(message, repeated, tag = "21")]
pub last_validators: ::prost::alloc::vec::Vec<GovernanceMember>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ConsensusType {
Solo = 0,
Tbft = 1,
Mbft = 2,
Maxbft = 3,
Raft = 4,
Dpos = 5,
Pow = 10,
}
impl ConsensusType {
pub fn as_str_name(&self) -> &'static str {
match self {
ConsensusType::Solo => "SOLO",
ConsensusType::Tbft => "TBFT",
ConsensusType::Mbft => "MBFT",
ConsensusType::Maxbft => "MAXBFT",
ConsensusType::Raft => "RAFT",
ConsensusType::Dpos => "DPOS",
ConsensusType::Pow => "POW",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SOLO" => Some(Self::Solo),
"TBFT" => Some(Self::Tbft),
"MBFT" => Some(Self::Mbft),
"MAXBFT" => Some(Self::Maxbft),
"RAFT" => Some(Self::Raft),
"DPOS" => Some(Self::Dpos),
"POW" => Some(Self::Pow),
_ => None,
}
}
}