dpp/block/extended_epoch_info/v0/
mod.rs

1use crate::block::epoch::EpochIndex;
2#[cfg(feature = "json-conversion")]
3use crate::serialization::json_safe_fields;
4use crate::util::deserializer::ProtocolVersion;
5use bincode::{Decode, Encode};
6use serde::{Deserialize, Serialize};
7
8/// Extended Epoch information
9#[cfg_attr(feature = "json-conversion", json_safe_fields)]
10#[derive(Clone, Debug, PartialEq, Encode, Decode, Serialize, Deserialize)]
11#[serde(rename_all = "camelCase")]
12pub struct ExtendedEpochInfoV0 {
13    /// The index of the epoch
14    pub index: EpochIndex,
15    /// First block time
16    pub first_block_time: u64,
17    /// First block height
18    pub first_block_height: u64,
19    /// First core block height
20    pub first_core_block_height: u32,
21    /// Fee multiplier that you would divide by 1000 to get float value
22    pub fee_multiplier_permille: u64,
23    /// Protocol version
24    pub protocol_version: u32,
25}
26
27/// Trait defining getters for `ExtendedEpochInfoV0`.
28pub trait ExtendedEpochInfoV0Getters {
29    /// Returns the epoch index.
30    fn index(&self) -> EpochIndex;
31
32    /// Returns the first block time.
33    fn first_block_time(&self) -> u64;
34
35    /// Returns the first platform block height.
36    fn first_block_height(&self) -> u64;
37
38    /// Returns the first core block height.
39    fn first_core_block_height(&self) -> u32;
40
41    /// Returns 1000 times the fee multiplier. so 1000 would be 1.
42    fn fee_multiplier_permille(&self) -> u64;
43
44    /// Protocol version
45    fn protocol_version(&self) -> ProtocolVersion;
46}