Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class (ConsensusProtocol p, NoThunks (PartialConsensusConfig p)) ⇒ HasPartialConsensusConfig p where
- type PartialConsensusConfig p ∷ Type
- completeConsensusConfig ∷ proxy p → EpochInfo (Except PastHorizonException) → PartialConsensusConfig p → ConsensusConfig p
- toPartialConsensusConfig ∷ proxy p → ConsensusConfig p → PartialConsensusConfig p
- class (UpdateLedger blk, NoThunks (PartialLedgerConfig blk)) ⇒ HasPartialLedgerConfig blk where
- type PartialLedgerConfig blk ∷ Type
- completeLedgerConfig ∷ proxy blk → EpochInfo (Except PastHorizonException) → PartialLedgerConfig blk → LedgerConfig blk
- newtype WrapPartialConsensusConfig blk = WrapPartialConsensusConfig {}
- newtype WrapPartialLedgerConfig blk = WrapPartialLedgerConfig {}
- data EpochInfo (m ∷ Type → Type) = EpochInfo {}
- type Except e = ExceptT e Identity
- data PastHorizonException
Documentation
class (ConsensusProtocol p, NoThunks (PartialConsensusConfig p)) ⇒ HasPartialConsensusConfig p where Source #
Partial consensus config
Nothing
type PartialConsensusConfig p ∷ Type Source #
type PartialConsensusConfig p = ConsensusConfig p
completeConsensusConfig ∷ proxy p → EpochInfo (Except PastHorizonException) → PartialConsensusConfig p → ConsensusConfig p Source #
Construct ConsensusConfig
from PartialConsensusConfig
See comments for completeLedgerConfig
for some details about the
EpochInfo
.
default completeConsensusConfig ∷ PartialConsensusConfig p ~ ConsensusConfig p ⇒ proxy p → EpochInfo (Except PastHorizonException) → PartialConsensusConfig p → ConsensusConfig p Source #
toPartialConsensusConfig ∷ proxy p → ConsensusConfig p → PartialConsensusConfig p Source #
Construct partial consensus config from full consensus config
NOTE: This is basically just losing EpochInfo
, but that is constant
anyway when we are dealing with a single era.
default toPartialConsensusConfig ∷ PartialConsensusConfig p ~ ConsensusConfig p ⇒ proxy p → ConsensusConfig p → PartialConsensusConfig p Source #
class (UpdateLedger blk, NoThunks (PartialLedgerConfig blk)) ⇒ HasPartialLedgerConfig blk where Source #
Partial ledger config
Nothing
type PartialLedgerConfig blk ∷ Type Source #
type PartialLedgerConfig blk = LedgerConfig blk
completeLedgerConfig ∷ proxy blk → EpochInfo (Except PastHorizonException) → PartialLedgerConfig blk → LedgerConfig blk Source #
Construct LedgerConfig
from PartialLedgerCfg
NOTE: The EpochInfo
provided will have limited range, any attempt to
look past its horizon will result in a pure PastHorizonException
.
The horizon is determined by the tip of the ledger state (not view)
from which the EpochInfo
is derived.
default completeLedgerConfig ∷ PartialLedgerConfig blk ~ LedgerConfig blk ⇒ proxy blk → EpochInfo (Except PastHorizonException) → PartialLedgerConfig blk → LedgerConfig blk Source #
Newtype wrappers
newtype WrapPartialConsensusConfig blk Source #
Instances
newtype WrapPartialLedgerConfig blk Source #
Instances
NoThunks (PartialLedgerConfig blk) ⇒ NoThunks (WrapPartialLedgerConfig blk) Source # | |
Convenience re-exports
data EpochInfo (m ∷ Type → Type) Source #
Information about epochs
Different epochs may have different sizes and different slot lengths. This
information is encapsulated by EpochInfo
. It is parameterized over a monad
m
because the information about how long each epoch is may depend on
information derived from the blockchain itself. It ultimately requires acess
to state, and so either uses the monad for that or uses the monad to reify
failure due to cached state information being too stale for the current
query.
EpochInfo | |
|
data PastHorizonException Source #
We tried to convert something that is past the horizon
That is, we tried to convert something that is past the point in time beyond which we lack information due to uncertainty about the next hard fork.