Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Infrastructure for doing chain selection across eras
Synopsis
- data AcrossEraMode cfg a where
- data AcrossEraSelection ∷ Type → Type → Type where
- data WithBlockNo (f ∷ k → Type) (a ∷ k) = WithBlockNo {
- getBlockNo ∷ BlockNo
- dropBlockNo ∷ f a
- acrossEraSelection ∷ ∀ xs cfg a. All SingleEraBlock xs ⇒ AcrossEraMode cfg a → NP cfg xs → Tails AcrossEraSelection xs → WithBlockNo (NS WrapSelectView) xs → WithBlockNo (NS WrapSelectView) xs → a
- mapWithBlockNo ∷ (f x → g y) → WithBlockNo f x → WithBlockNo g y
Documentation
data AcrossEraMode cfg a where Source #
GADT indicating whether we are lifting compare
or preferCandidate
to
the HFC, together with the type of configuration we need for that and the
result type.
data AcrossEraSelection ∷ Type → Type → Type where Source #
CompareBlockNo ∷ AcrossEraSelection x y | Just compare block numbers This is a useful default when two eras run totally different consensus protocols, and we just want to choose the longer chain. |
CompareSameSelectView ∷ SelectView (BlockProtocol x) ~ SelectView (BlockProtocol y) ⇒ AcrossEraSelection x y | Two eras using the same We use the |
data WithBlockNo (f ∷ k → Type) (a ∷ k) Source #
WithBlockNo | |
|
Instances
acrossEraSelection ∷ ∀ xs cfg a. All SingleEraBlock xs ⇒ AcrossEraMode cfg a → NP cfg xs → Tails AcrossEraSelection xs → WithBlockNo (NS WrapSelectView) xs → WithBlockNo (NS WrapSelectView) xs → a Source #
mapWithBlockNo ∷ (f x → g y) → WithBlockNo f x → WithBlockNo g y Source #