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

Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Synopsis

Documentation

class Inject (f ∷ TypeType) where Source #

Methods

inject ∷ ∀ x (xs ∷ [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut 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, HasCanonicalTxIn xs, HasHardForkTxOut 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, HasCanonicalTxIn xs, HasHardForkTxOut 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, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ InjectionIndex xs x → HeaderState x → HeaderState (HardForkBlock xs) Source #

Inject GenTx Source # 
Instance details

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

Methods

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

Inject SerialisedHeader Source # 
Instance details

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

Inject WrapApplyTxErr Source # 
Instance details

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

Inject WrapChainDepState Source # 
Instance details

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

Inject WrapGenTxId Source # 
Instance details

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

Methods

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

Inject WrapHeaderHash Source # 
Instance details

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

Inject I Source # 
Instance details

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

Methods

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

Inject (K a ∷ TypeType) Source # 
Instance details

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

Methods

inject ∷ ∀ x (xs ∷ [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ InjectionIndex xs x → K a x → K a (HardForkBlock xs) Source #

Inject (SomeBlockQuery :.: BlockQuery) Source # 
Instance details

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

Inject (Flip LedgerState mk) Source # 
Instance details

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

Methods

inject ∷ ∀ x (xs ∷ [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ InjectionIndex xs x → Flip LedgerState mk x → Flip LedgerState mk (HardForkBlock xs) Source #

Inject (Flip ExtLedgerState mk) Source # 
Instance details

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

Methods

inject ∷ ∀ x (xs ∷ [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ InjectionIndex xs x → Flip ExtLedgerState mk x → Flip ExtLedgerState mk (HardForkBlock xs) Source #

newtype InjectionIndex (xs ∷ [Type]) 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 BoundTypeType) (Current ((:~:) x)) xs) 

inject' ∷ ∀ (f ∷ TypeType) a b x (xs ∷ [Type]). (Inject f, CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs, Coercible a (f x), Coercible b (f (HardForkBlock xs))) ⇒ Proxy f → InjectionIndex xs x → a → b Source #

Defaults

injectHardForkState ∷ ∀ f x (xs ∷ [Type]). InjectionIndex xs x → f x → HardForkState f xs Source #

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

injectQuery ∷ ∀ x (xs ∷ [Type]) result (fp ∷ QueryFootprint). Index xs x → BlockQuery x fp result → QueryIfCurrent xs fp result Source #

Initial ExtLedgerState

injectInitialExtLedgerState ∷ ∀ x (xs ∷ [Type]). (CanHardFork (x ': xs), HasLedgerTables (LedgerState (HardForkBlock (x ': xs)))) ⇒ TopLevelConfig (HardForkBlock (x ': xs)) → ExtLedgerState x ValuesMKExtLedgerState (HardForkBlock (x ': xs)) ValuesMK 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

forgetInjectionIndex ∷ ∀ (xs ∷ [Type]) x. SListI xs ⇒ InjectionIndex xs x → Index xs x Source #

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

oracularInjectionIndex ∷ ∀ (xs ∷ [Type]) x. SListI xs ⇒ Exactly 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.