dpp/block/finalized_epoch_info/v0/
getters.rs1use crate::block::finalized_epoch_info::v0::FinalizedEpochInfoV0;
2use crate::fee::Credits;
3use crate::prelude::{BlockHeight, BlockHeightInterval, CoreBlockHeight, TimestampMillis};
4use platform_value::Identifier;
5use std::collections::BTreeMap;
6
7pub trait FinalizedEpochInfoGettersV0 {
9 fn first_block_time(&self) -> TimestampMillis;
11
12 fn first_block_height(&self) -> BlockHeight;
14
15 fn total_blocks_in_epoch(&self) -> BlockHeightInterval;
17
18 fn first_core_block_height(&self) -> CoreBlockHeight;
20
21 fn next_epoch_start_core_block_height(&self) -> CoreBlockHeight;
23
24 fn total_processing_fees(&self) -> Credits;
26
27 fn total_distributed_storage_fees(&self) -> Credits;
29
30 fn total_created_storage_fees(&self) -> Credits;
32
33 fn core_block_rewards(&self) -> Credits;
35
36 fn block_proposers(&self) -> &BTreeMap<Identifier, u64>;
38
39 fn fee_multiplier_permille(&self) -> u64;
41
42 fn protocol_version(&self) -> u32;
44}
45
46impl FinalizedEpochInfoGettersV0 for FinalizedEpochInfoV0 {
47 fn first_block_time(&self) -> TimestampMillis {
48 self.first_block_time
49 }
50
51 fn first_block_height(&self) -> BlockHeight {
52 self.first_block_height
53 }
54
55 fn total_blocks_in_epoch(&self) -> BlockHeightInterval {
56 self.total_blocks_in_epoch
57 }
58
59 fn first_core_block_height(&self) -> CoreBlockHeight {
60 self.first_core_block_height
61 }
62
63 fn next_epoch_start_core_block_height(&self) -> CoreBlockHeight {
64 self.next_epoch_start_core_block_height
65 }
66
67 fn total_processing_fees(&self) -> Credits {
68 self.total_processing_fees
69 }
70
71 fn total_distributed_storage_fees(&self) -> Credits {
72 self.total_distributed_storage_fees
73 }
74
75 fn total_created_storage_fees(&self) -> Credits {
76 self.total_created_storage_fees
77 }
78
79 fn core_block_rewards(&self) -> Credits {
80 self.core_block_rewards
81 }
82
83 fn block_proposers(&self) -> &BTreeMap<Identifier, u64> {
84 &self.block_proposers
85 }
86
87 fn fee_multiplier_permille(&self) -> u64 {
88 self.fee_multiplier_permille
89 }
90
91 fn protocol_version(&self) -> u32 {
92 self.protocol_version
93 }
94}