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

Commit

Permalink
retrieve the TimeEra of a given Ledger state
Browse files Browse the repository at this point in the history
this will allow retrieving the associated settings of the given TimeEra
(num epoch per blocks) as well as retrieving the associated chain-time::Slot
of the given State
  • Loading branch information
NicolasDP committed May 13, 2019
1 parent 028ddda commit 2b7053e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chain-impl-mockchain/src/ledger.rs
Expand Up @@ -487,6 +487,13 @@ impl Ledger {
self.date
}

/// get the TimeEra associated to the given Ledger state
/// This allows retrieving the current ledger `Slot` but also
/// get the current time settings
pub fn era(&self) -> &TimeEra {
&self.settings.era
}

fn validate_utxo_total_value(&self) -> Result<(), Error> {
let old_utxo_values = self.oldutxos.iter().map(|entry| entry.output.value);
let new_utxo_values = self.utxos.iter().map(|entry| entry.output.value);
Expand Down

0 comments on commit 2b7053e

Please sign in to comment.