| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Protocol.ChainSel
Description
Infrastructure for doing chain selection across eras
Documentation
data AcrossEraSelection :: Type -> Type -> Type where Source #
Constructors
| 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. |
| SelectSameProtocol :: BlockProtocol x ~ BlockProtocol y => AcrossEraSelection x y | Two eras running the same protocol In this case, we can just call NOTE: We require that the eras have the same protocol, not merely the
same |
| CustomChainSel :: (ChainSelConfig (BlockProtocol x) -> ChainSelConfig (BlockProtocol y) -> SelectView (BlockProtocol x) -> SelectView (BlockProtocol y) -> Ordering) -> AcrossEraSelection x y | Custom chain selection This is the most general form, and allows to override chain selection for the specific combination of two eras with a custom comparison function. |
acrossEraSelection :: All SingleEraBlock xs => NP WrapChainSelConfig xs -> Tails AcrossEraSelection xs -> WithBlockNo (NS WrapSelectView) xs -> WithBlockNo (NS WrapSelectView) xs -> Ordering Source #
data WithBlockNo (f :: k -> Type) (a :: k) Source #
Constructors
| WithBlockNo | |
Fields
| |
Instances
| Show (f a) => Show (WithBlockNo f a) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol.ChainSel Methods showsPrec :: Int -> WithBlockNo f a -> ShowS # show :: WithBlockNo f a -> String # showList :: [WithBlockNo f a] -> ShowS # | |
mapWithBlockNo :: (f x -> g y) -> WithBlockNo f x -> WithBlockNo g y Source #