| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Embed.Nary
Synopsis
- class Inject (f ∷ Type → Type) where
- inject ∷ ∀ x (xs ∷ [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ InjectionIndex xs x → f x → f (HardForkBlock xs)
- newtype InjectionIndex (xs ∷ [Type]) x = InjectionIndex (Telescope (K Bound ∷ Type → Type) (Current ((:~:) x)) xs)
- inject' ∷ ∀ (f ∷ Type → Type) 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
- injectHardForkState ∷ ∀ f x (xs ∷ [Type]). InjectionIndex xs x → f x → HardForkState f xs
- injectNestedCtxt_ ∷ ∀ (f ∷ Type → Type) x (xs ∷ [Type]) a. Index xs x → NestedCtxt_ x f a → NestedCtxt_ (HardForkBlock xs) f a
- injectQuery ∷ ∀ x (xs ∷ [Type]) result (fp ∷ QueryFootprint). Index xs x → BlockQuery x fp result → QueryIfCurrent xs fp result
- injectInitialExtLedgerState ∷ ∀ x (xs ∷ [Type]). (CanHardFork (x ': xs), HasLedgerTables (LedgerState (HardForkBlock (x ': xs)))) ⇒ TopLevelConfig (HardForkBlock (x ': xs)) → ExtLedgerState x ValuesMK → ExtLedgerState (HardForkBlock (x ': xs)) ValuesMK
- forgetInjectionIndex ∷ ∀ (xs ∷ [Type]) x. SListI xs ⇒ InjectionIndex xs x → Index xs x
- oracularInjectionIndex ∷ ∀ (xs ∷ [Type]) x. SListI xs ⇒ Exactly xs Bound → Index xs x → InjectionIndex xs x
Documentation
class Inject (f ∷ Type → Type) where Source #
Methods
inject ∷ ∀ x (xs ∷ [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ InjectionIndex xs x → f x → f (HardForkBlock xs) Source #
Instances
newtype InjectionIndex (xs ∷ [Type]) x Source #
inject' ∷ ∀ (f ∷ Type → Type) 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 ∷ Type → Type) 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 ValuesMK → ExtLedgerState (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 Bound → Index 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.