Skip to content
Permalink
Browse files

retrieve the TimeEra of a given Ledger state

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 2b7053e2b3970ed3b3937056aa59fc480d2b7fa0
Showing with 7 additions and 0 deletions.
  1. +7 −0 chain-impl-mockchain/src/ledger.rs
@@ -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);

0 comments on commit 2b7053e

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