ouroboros-consensus-0.1.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.HardFork.History.EpochInfo

Description

Derive EpochInfo

Synopsis

Documentation

summaryToEpochInfo :: forall m xs. (MonadSTM m, MonadThrow (STM m)) => STM m (Summary xs) -> m (EpochInfo (STM m)) Source #

Construct EpochInfo from a function that returns the hard fork summary

When a particular request fails with a PastHorizon error, we ask for an updated summary, in the hope that the ledger state has advanced. If the query still fails with that updated summary, the error is thrown as an exception.

snapshotEpochInfo :: forall xs. Summary xs -> EpochInfo Identity Source #

Construct an EpochInfo for a snapshot of the ledger state

When a particular request fails with a PastHorizon error, we throw the error as a pure exception. Such an exception would indicate a bug.

dummyEpochInfo :: EpochInfo Identity Source #

A dummy EpochInfo that always throws an error.

To be used as a placeholder before a summary is available.