ouroboros-consensus-0.22.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Synopsis

Documentation

class Inject f where Source #

Methods

inject ∷ ∀ x xs. CanHardFork xs ⇒ InjectionIndex xs x → f x → f (HardForkBlock xs) Source #

Instances

Instances details
Inject Header Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → Header x → Header (HardForkBlock xs) Source #

Inject AnnTip Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → AnnTip x → AnnTip (HardForkBlock xs) Source #

Inject HeaderState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → HeaderState x → HeaderState (HardForkBlock xs) Source #

Inject LedgerState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → LedgerState x → LedgerState (HardForkBlock xs) Source #

Inject ExtLedgerState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → ExtLedgerState x → ExtLedgerState (HardForkBlock xs) Source #

Inject GenTx Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → GenTx x → GenTx (HardForkBlock xs) Source #

Inject SerialisedHeader Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → SerialisedHeader x → SerialisedHeader (HardForkBlock xs) Source #

Inject WrapApplyTxErr Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → WrapApplyTxErr x → WrapApplyTxErr (HardForkBlock xs) Source #

Inject WrapChainDepState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → WrapChainDepState x → WrapChainDepState (HardForkBlock xs) Source #

Inject WrapGenTxId Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → WrapGenTxId x → WrapGenTxId (HardForkBlock xs) Source #

Inject WrapHeaderHash Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → WrapHeaderHash x → WrapHeaderHash (HardForkBlock xs) Source #

Inject I Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → I x → I (HardForkBlock xs) Source #

Inject (SomeSecond BlockQuery) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ InjectionIndex xs x → SomeSecond BlockQuery x → SomeSecond BlockQuery (HardForkBlock xs) Source #

newtype InjectionIndex xs x Source #

This data type is isomorphic to an Index that additionally provides a Bound for every era up to and including that index, but none of the subsequent eras.

Constructors

InjectionIndex (Telescope (K Bound) (Current ((:~:) x)) xs) 

inject' ∷ ∀ f a b x xs. (Inject f, CanHardFork xs, Coercible a (f x), Coercible b (f (HardForkBlock xs))) ⇒ Proxy f → InjectionIndex xs x → a → b Source #

Defaults

injectHardForkState ∷ ∀ f x xs. InjectionIndex xs x → f x → HardForkState f xs Source #

injectNestedCtxt_ ∷ ∀ f x xs a. Index xs x → NestedCtxt_ x f a → NestedCtxt_ (HardForkBlock xs) f a Source #

injectQuery ∷ ∀ x xs result. Index xs x → BlockQuery x result → QueryIfCurrent xs result Source #

Initial ExtLedgerState

injectInitialExtLedgerState ∷ ∀ x xs. CanHardFork (x ': xs) ⇒ TopLevelConfig (HardForkBlock (x ': xs)) → ExtLedgerState x → ExtLedgerState (HardForkBlock (x ': xs)) Source #

Inject the first era's initial ExtLedgerState and trigger any translations that should take place in the very first slot.

Performs any hard forks scheduled via TriggerHardForkAtEpoch.

Note: we can translate across multiple eras when computing the initial ledger state, but we do not support translation across multiple eras in general; extending applyChainTick to translate across more than one era is not problematic, but extending ledgerViewForecastAt is a lot more subtle; see forecastNotFinal.

Note: this function is an alternative to the Inject class above. It does not rely on that class.

Convenience

forgetInjectionIndexInjectionIndex xs x → Index xs x Source #

Many instances of Inject do not need the Bounds, eg those that do not construct HardForkStates

oracularInjectionIndexExactly xs BoundIndex xs x → InjectionIndex xs x Source #

Build an InjectionIndex from oracular Bounds and an Index

This bounds data is oracular, since the later eras in xs might have not yet started. However, it can be known in test code.

INVARIANT: the result is completely independent of the 'history.Bound's for eras after the given Index.