cfx_rpc_cfx_types/pos/
status.rs

1// Copyright 2019 Conflux Foundation. All rights reserved.
2// Conflux is free software and distributed under GNU General Public License.
3// See http://www.gnu.org/licenses/
4
5use super::Decision;
6use cfx_types::{H256, U64};
7use serde_derive::Serialize;
8
9#[derive(Debug, Serialize)]
10#[serde(rename_all = "camelCase")]
11pub struct Status {
12    ///
13    pub latest_committed: U64,
14    ///
15    pub epoch: U64,
16    ///
17    pub pivot_decision: Decision,
18    ///
19    pub latest_voted: Option<U64>,
20    ///
21    pub latest_tx_number: U64,
22}
23
24impl Default for Status {
25    fn default() -> Status {
26        Status {
27            epoch: U64::default(),
28            latest_committed: U64::default(),
29            pivot_decision: Decision {
30                height: U64::default(),
31                block_hash: H256::default(),
32            },
33            latest_voted: None,
34            latest_tx_number: U64::default(),
35        }
36    }
37}