);
assert_eq!(
Epoch(2).starting_sat(),
(Epoch(0).subsidy() + Epoch(1).subsidy()) * u64::from(SUBSIDY_HALVING_INTERVAL)
);
assert_eq!(Epoch(33).starting_sat(), Sat(Sat::SUPPLY));
assert_eq!(Epoch(34).starting_sat(), Sat(Sat::SUPPLY));
}
#[test]
fn starting_sats() {
let mut sat = 0;
let mut epoch_sats = Vec::new();
for epoch in 0..34 {
epoch_sats.push(sat);
sat += u64::from(SUBSIDY_HALVING_INTERVAL) * Epoch(epoch).subsidy();
}
assert_eq!(Epoch::STARTING_SATS.as_slice(), epoch_sats);
assert_eq!(Epoch::STARTING_SATS.len(), 34);
}
#[test]
fn subsidy() {
assert_eq!(Epoch(0).subsidy(), 5000000000);
assert_eq!(Epoch(1).subsidy(), 2500000000);
assert_eq!(Epoch(32).subsidy(), 1);
assert_eq!(Epoch(33).subsidy(), 0);
}
#[test]
fn starting_height() {
assert_eq!(Epoch(0).starting_height(), 0);
assert_eq!(Epoch(1).starting_height(), SUBSIDY_HALVING_INTERVAL);
assert_eq!(Epoch(2).starting_height(), SUBSIDY_HALVING_INTERVAL * 2);