1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2019 Conflux Foundation. All rights reserved.
// Conflux is free software and distributed under GNU General Public License.
// See http://www.gnu.org/licenses/

use cfx_types::{H256, U64};
use diem_types::block_info::PivotBlockDecision;
use serde_derive::Serialize;

#[derive(Debug, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Decision {
    pub block_hash: H256,
    pub height: U64,
}

impl From<&PivotBlockDecision> for Decision {
    fn from(pd: &PivotBlockDecision) -> Self {
        Decision {
            block_hash: pd.block_hash,
            height: U64::from(pd.height),
        }
    }
}