Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Protocol.ChainSel
Description
Infrastructure for doing chain selection across eras
Synopsis
- data AcrossEraMode (cfg ∷ Type → Type) a where
- data AcrossEraSelection a b where
- CompareBlockNo ∷ ∀ a b. AcrossEraSelection a b
- CompareSameSelectView ∷ ∀ a b. SelectView (BlockProtocol a) ~ SelectView (BlockProtocol b) ⇒ AcrossEraSelection a b
- data WithBlockNo (f ∷ k → Type) (a ∷ k) = WithBlockNo {
- getBlockNo ∷ BlockNo
- dropBlockNo ∷ f a
- acrossEraSelection ∷ ∀ (xs ∷ [Type]) (cfg ∷ Type → Type) a. All SingleEraBlock xs ⇒ AcrossEraMode cfg a → NP cfg xs → Tails AcrossEraSelection xs → WithBlockNo (NS WrapSelectView) xs → WithBlockNo (NS WrapSelectView) xs → a
- mapWithBlockNo ∷ ∀ {k1} {k2} f (x ∷ k1) g (y ∷ k2). (f x → g y) → WithBlockNo f x → WithBlockNo g y
Documentation
data AcrossEraMode (cfg ∷ Type → Type) 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.
Constructors
AcrossEraCompare ∷ AcrossEraMode (Proxy ∷ Type → Type) Ordering | |
AcrossEraPreferCandidate ∷ AcrossEraMode WrapChainOrderConfig Bool |
data AcrossEraSelection a b where Source #
Constructors
CompareBlockNo ∷ ∀ a b. AcrossEraSelection a b | 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 ∷ ∀ a b. SelectView (BlockProtocol a) ~ SelectView (BlockProtocol b) ⇒ AcrossEraSelection a b | Two eras using the same We use the |
data WithBlockNo (f ∷ k → Type) (a ∷ k) Source #
Constructors
WithBlockNo | |
Fields
|
Instances
acrossEraSelection ∷ ∀ (xs ∷ [Type]) (cfg ∷ Type → Type) a. All SingleEraBlock xs ⇒ AcrossEraMode cfg a → NP cfg xs → Tails AcrossEraSelection xs → WithBlockNo (NS WrapSelectView) xs → WithBlockNo (NS WrapSelectView) xs → a Source #
mapWithBlockNo ∷ ∀ {k1} {k2} f (x ∷ k1) g (y ∷ k2). (f x → g y) → WithBlockNo f x → WithBlockNo g y Source #