Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Embed.Nary
Synopsis
- class Inject f where
- inject ∷ ∀ x xs. CanHardFork xs ⇒ InjectionIndex xs x → f x → f (HardForkBlock xs)
- newtype InjectionIndex xs x = 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
- injectHardForkState ∷ ∀ f x xs. InjectionIndex xs x → f x → HardForkState f xs
- injectNestedCtxt_ ∷ ∀ f x xs a. Index xs x → NestedCtxt_ x f a → NestedCtxt_ (HardForkBlock xs) f a
- injectQuery ∷ ∀ x xs result. Index xs x → BlockQuery x result → QueryIfCurrent xs result
- injectInitialExtLedgerState ∷ ∀ x xs. CanHardFork (x ': xs) ⇒ TopLevelConfig (HardForkBlock (x ': xs)) → ExtLedgerState x → ExtLedgerState (HardForkBlock (x ': xs))
- forgetInjectionIndex ∷ InjectionIndex xs x → Index xs x
- oracularInjectionIndex ∷ Exactly xs Bound → Index xs x → InjectionIndex xs x
Documentation
Methods
inject ∷ ∀ x xs. CanHardFork xs ⇒ InjectionIndex xs x → f x → f (HardForkBlock xs) Source #
Instances
newtype InjectionIndex xs x Source #
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
forgetInjectionIndex ∷ InjectionIndex xs x → Index xs x Source #
Many instances of Inject
do not need the Bound
s, eg those that
do not construct HardForkState
s
oracularInjectionIndex ∷ Exactly xs Bound → Index xs x → InjectionIndex xs x Source #
Build an InjectionIndex
from oracular Bound
s 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
.