1//! Extra per-block info tracked in the state.
2use crate::{amount::NonNegative, value_balance::ValueBalance};
34/// Extra per-block info tracked in the state.
5#[derive(Debug, Clone, Default, PartialEq, Eq)]
6pub struct BlockInfo {
7/// The pool balances after the block.
8value_pools: ValueBalance<NonNegative>,
9/// The size of the block in bytes.
10size: u32,
11}
1213impl BlockInfo {
14/// Creates a new [`BlockInfo`] with the given value pools.
15pub fn new(value_pools: ValueBalance<NonNegative>, size: u32) -> Self {
16 BlockInfo { value_pools, size }
17 }
1819/// Returns the value pools of this block.
20pub fn value_pools(&self) -> &ValueBalance<NonNegative> {
21&self.value_pools
22 }
2324/// Returns the size of this block.
25pub fn size(&self) -> u32 {
26self.size
27 }
28}