Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
Don't make Slot.0 public
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed May 24, 2019
1 parent 5157b4a commit ed4835f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions chain-impl-mockchain/src/leadership/genesis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ mod test {
use crate::stake::PoolStakeDistribution;
use crate::stake::StakePoolInfo;
use chain_addr::Discrimination;
use chain_time::{
era::{Epoch, TimeEra},
timeframe::Slot,
};
use std::collections::HashMap;

fn make_pool(ledger: &mut Ledger) -> (StakePoolId, SecretKey<Curve25519_2HashDH>) {
Expand Down Expand Up @@ -213,9 +209,7 @@ mod test {
);
}

let era = TimeEra::new(Slot(0), Epoch(0), slots_per_epoch);

let mut date = BlockDate::first();
let mut date = ledger.date;

let mut empty_slots = 0;

Expand Down Expand Up @@ -247,7 +241,7 @@ mod test {
if any_small {
times_selected_small += 1;
}
date = date.next(&era);
date = date.next(&ledger.settings.era);
}

for (pool_id, (_pool_vrf_private_key, times_selected, stake)) in pools.iter_mut() {
Expand Down
2 changes: 1 addition & 1 deletion chain-time/src/timeframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::time::{Duration, SystemTime};
/// The slots are not comparable to others slots made on a
/// different time frame
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct Slot(pub u64);
pub struct Slot(pub(crate) u64);

impl From<Slot> for u64 {
fn from(s: Slot) -> u64 {
Expand Down

0 comments on commit ed4835f

Please sign in to comment.