cfx_rpc_cfx_types/pos/decision.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 cfx_types::{H256, U64};
6use diem_types::block_info::PivotBlockDecision;
7use serde_derive::Serialize;
8
9#[derive(Debug, Serialize, Clone)]
10#[serde(rename_all = "camelCase")]
11pub struct Decision {
12 pub block_hash: H256,
13 pub height: U64,
14}
15
16impl From<&PivotBlockDecision> for Decision {
17 fn from(pd: &PivotBlockDecision) -> Self {
18 Decision {
19 block_hash: pd.block_hash,
20 height: U64::from(pd.height),
21 }
22 }
23}