Skip to content
Permalink
Browse files

fix API function name, no need to repeat `era` in the constructor...

  • Loading branch information...
NicolasDP committed May 13, 2019
1 parent e0616f1 commit 618063a2d0a74834d172deb32feefc70896e9494
Showing with 3 additions and 3 deletions.
  1. +1 −1 chain-impl-mockchain/src/ledger.rs
  2. +2 −2 chain-time/src/era.rs
@@ -226,7 +226,7 @@ impl Ledger {
let slot0 = tf.slot0();

// TODO -- configurable slots per epoch
let era = TimeEra::new_era(slot0, Epoch(0), 21600);
let era = TimeEra::new(slot0, Epoch(0), 21600);

let settings = setting::Settings::new(era).apply(&regular_ents)?;

@@ -28,7 +28,7 @@ pub struct TimeEra {

impl TimeEra {
/// Set a new era to start on slot_start at epoch_start for a given slots per epoch.
pub fn new_era(slot_start: Slot, epoch_start: Epoch, slots_per_epoch: u32) -> Self {
pub fn new(slot_start: Slot, epoch_start: Epoch, slots_per_epoch: u32) -> Self {
TimeEra {
epoch_start,
slot_start,
@@ -92,7 +92,7 @@ mod test {
assert_eq!(slot2, Slot(4));
assert_eq!(slot3, Slot(20));

let era = TimeEra::new_era(slot1, Epoch(2), 4);
let era = TimeEra::new(slot1, Epoch(2), 4);

let p1 = era.from_slot_to_era(slot1).unwrap();
let p2 = era.from_slot_to_era(slot2).unwrap();

0 comments on commit 618063a

Please sign in to comment.
You can’t perform that action at this time.