| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Cardano.Block
Synopsis
- module Ouroboros.Consensus.Shelley.Eras
- type CardanoEras c = '[ByronBlock, ShelleyBlock (ShelleyEra c), ShelleyBlock (AllegraEra c), ShelleyBlock (MaryEra c)]
- type CardanoBlock c = HardForkBlock (CardanoEras c)
- data HardForkBlock (xs :: [Type]) where
- pattern BlockByron :: ByronBlock -> CardanoBlock c
- pattern BlockShelley :: ShelleyBlock (ShelleyEra c) -> CardanoBlock c
- pattern BlockAllegra :: ShelleyBlock (AllegraEra c) -> CardanoBlock c
- pattern BlockMary :: ShelleyBlock (MaryEra c) -> CardanoBlock c
- type CardanoHeader c = Header (CardanoBlock c)
- data family Header blk
- type CardanoGenTx c = GenTx (CardanoBlock c)
- data family GenTx blk
- type CardanoGenTxId c = GenTxId (CardanoBlock c)
- data family TxId tx
- type CardanoApplyTxErr c = HardForkApplyTxErr (CardanoEras c)
- data HardForkApplyTxErr (xs :: [Type]) where
- pattern ApplyTxErrByron :: ApplyTxErr ByronBlock -> CardanoApplyTxErr c
- pattern ApplyTxErrShelley :: ApplyTxErr (ShelleyBlock (ShelleyEra c)) -> CardanoApplyTxErr c
- pattern ApplyTxErrAllegra :: ApplyTxErr (ShelleyBlock (AllegraEra c)) -> CardanoApplyTxErr c
- pattern ApplyTxErrMary :: ApplyTxErr (ShelleyBlock (MaryEra c)) -> CardanoApplyTxErr c
- pattern ApplyTxErrWrongEra :: EraMismatch -> CardanoApplyTxErr c
- type CardanoLedgerError c = HardForkLedgerError (CardanoEras c)
- data HardForkLedgerError (xs :: [Type]) where
- pattern LedgerErrorByron :: LedgerError ByronBlock -> CardanoLedgerError c
- pattern LedgerErrorShelley :: LedgerError (ShelleyBlock (ShelleyEra c)) -> CardanoLedgerError c
- pattern LedgerErrorAllegra :: LedgerError (ShelleyBlock (AllegraEra c)) -> CardanoLedgerError c
- pattern LedgerErrorMary :: LedgerError (ShelleyBlock (MaryEra c)) -> CardanoLedgerError c
- pattern LedgerErrorWrongEra :: EraMismatch -> CardanoLedgerError c
- type CardanoOtherHeaderEnvelopeError c = HardForkEnvelopeErr (CardanoEras c)
- data HardForkEnvelopeErr (xs :: [Type]) where
- pattern OtherHeaderEnvelopeErrorByron :: OtherHeaderEnvelopeError ByronBlock -> CardanoOtherHeaderEnvelopeError c
- pattern OtherHeaderEnvelopeErrorShelley :: OtherHeaderEnvelopeError (ShelleyBlock (ShelleyEra c)) -> CardanoOtherHeaderEnvelopeError c
- pattern OtherHeaderEnvelopeErrorAllegra :: OtherHeaderEnvelopeError (ShelleyBlock (AllegraEra c)) -> CardanoOtherHeaderEnvelopeError c
- pattern OtherHeaderEnvelopeErrorMary :: OtherHeaderEnvelopeError (ShelleyBlock (MaryEra c)) -> CardanoOtherHeaderEnvelopeError c
- pattern OtherHeaderEnvelopeErrorWrongEra :: EraMismatch -> CardanoOtherHeaderEnvelopeError c
- type CardanoTipInfo c = OneEraTipInfo (CardanoEras c)
- data OneEraTipInfo (xs :: [Type]) where
- pattern TipInfoByron :: TipInfo ByronBlock -> CardanoTipInfo c
- pattern TipInfoShelley :: TipInfo (ShelleyBlock (ShelleyEra c)) -> CardanoTipInfo c
- pattern TipInfoAllegra :: TipInfo (ShelleyBlock (AllegraEra c)) -> CardanoTipInfo c
- pattern TipInfoMary :: TipInfo (ShelleyBlock (MaryEra c)) -> CardanoTipInfo c
- type CardanoQuery c = Query (CardanoBlock c)
- data family Query blk :: Type -> Type
- type CardanoQueryResult c = HardForkQueryResult (CardanoEras c)
- data Either a b where
- pattern QueryResultSuccess :: result -> CardanoQueryResult c result
- pattern QueryResultEraMismatch :: EraMismatch -> CardanoQueryResult c result
- type CardanoCodecConfig c = CodecConfig (CardanoBlock c)
- data family CodecConfig blk
- type CardanoBlockConfig c = BlockConfig (CardanoBlock c)
- data family BlockConfig blk
- type CardanoStorageConfig c = StorageConfig (CardanoBlock c)
- data family StorageConfig blk
- type CardanoConsensusConfig c = ConsensusConfig (HardForkProtocol (CardanoEras c))
- data family ConsensusConfig p
- type CardanoLedgerConfig c = HardForkLedgerConfig (CardanoEras c)
- data HardForkLedgerConfig (xs :: [Type]) where
- pattern CardanoLedgerConfig :: PartialLedgerConfig ByronBlock -> PartialLedgerConfig (ShelleyBlock (ShelleyEra c)) -> PartialLedgerConfig (ShelleyBlock (AllegraEra c)) -> PartialLedgerConfig (ShelleyBlock (MaryEra c)) -> CardanoLedgerConfig c
- type CardanoLedgerState c = LedgerState (CardanoBlock c)
- data family LedgerState blk
- type CardanoChainDepState c = HardForkChainDepState (CardanoEras c)
- data HardForkState (f :: Type -> Type) (xs :: [Type]) where
- pattern ChainDepStateByron :: ChainDepState (BlockProtocol ByronBlock) -> CardanoChainDepState c
- pattern ChainDepStateShelley :: ChainDepState (BlockProtocol (ShelleyBlock (ShelleyEra c))) -> CardanoChainDepState c
- pattern ChainDepStateAllegra :: ChainDepState (BlockProtocol (ShelleyBlock (AllegraEra c))) -> CardanoChainDepState c
- pattern ChainDepStateMary :: ChainDepState (BlockProtocol (ShelleyBlock (MaryEra c))) -> CardanoChainDepState c
- data EraMismatch = EraMismatch {
- ledgerEraName :: !Text
- otherEraName :: !Text
Eras
type CardanoEras c = '[ByronBlock, ShelleyBlock (ShelleyEra c), ShelleyBlock (AllegraEra c), ShelleyBlock (MaryEra c)] Source #
The eras in the Cardano blockchain.
We parameterise over the crypto used in the post-Byron eras: c.
TODO: parameterise ByronBlock over crypto too
Block
type CardanoBlock c = HardForkBlock (CardanoEras c) Source #
The Cardano block.
Thanks to the pattern synonyms, you can treat this as a sum type with
constructors BlockByron and BlockShelley.
f :: CardanoBlock c -> _ f (BlockByron b) = _ f (BlockShelley s) = _ f (BlockAllegra a) = _ f (BlockMary m) = _
data HardForkBlock (xs :: [Type]) where Source #
Bundled Patterns
| pattern BlockByron :: ByronBlock -> CardanoBlock c | |
| pattern BlockShelley :: ShelleyBlock (ShelleyEra c) -> CardanoBlock c | |
| pattern BlockAllegra :: ShelleyBlock (AllegraEra c) -> CardanoBlock c | |
| pattern BlockMary :: ShelleyBlock (MaryEra c) -> CardanoBlock c |
Instances
Headers
type CardanoHeader c = Header (CardanoBlock c) Source #
The Cardano header.
data family Header blk Source #
Instances
Generalised transactions
type CardanoGenTx c = GenTx (CardanoBlock c) Source #
The Cardano transaction.
data family GenTx blk Source #
Generalized transaction
The mempool (and, accordingly, blocks) consist of "generalized transactions"; this could be "proper" transactions (transferring funds) but also other kinds of things such as update proposals, delegations, etc.
Instances
type CardanoGenTxId c = GenTxId (CardanoBlock c) Source #
The ID of a Cardano transaction.
A generalized transaction, GenTx, identifier.
Instances
| newtype TxId (GenTx (HardForkBlock xs)) | |
| data TxId (GenTx ByronBlock) | |
Defined in Ouroboros.Consensus.Byron.Ledger.Mempool | |
| newtype TxId (GenTx (ShelleyBlock era)) | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool | |
type CardanoApplyTxErr c = HardForkApplyTxErr (CardanoEras c) Source #
An error resulting from applying a CardanoGenTx to the ledger.
Thanks to the pattern synonyms, you can treat this as a sum type with
constructors ApplyTxByronErr, ApplyTxErrShelley, and
ApplyTxErrWrongEra.
toText :: CardanoApplyTxErr c -> Text toText (ApplyTxErrByron b) = byronApplyTxErrToText b toText (ApplyTxErrShelley s) = shelleyApplyTxErrToText s toText (ApplyTxErrAllegra a) = allegraApplyTxErrToText a toText (ApplyTxErrMary m) = maryApplyTxErrToText m toText (ApplyTxErrWrongEra eraMismatch) = "Transaction from the " <> otherEraName eraMismatch <> " era applied to a ledger from the " <> ledgerEraName eraMismatch <> " era"
data HardForkApplyTxErr (xs :: [Type]) where Source #
Bundled Patterns
| pattern ApplyTxErrByron :: ApplyTxErr ByronBlock -> CardanoApplyTxErr c | |
| pattern ApplyTxErrShelley :: ApplyTxErr (ShelleyBlock (ShelleyEra c)) -> CardanoApplyTxErr c | |
| pattern ApplyTxErrAllegra :: ApplyTxErr (ShelleyBlock (AllegraEra c)) -> CardanoApplyTxErr c | |
| pattern ApplyTxErrMary :: ApplyTxErr (ShelleyBlock (MaryEra c)) -> CardanoApplyTxErr c | |
| pattern ApplyTxErrWrongEra :: EraMismatch -> CardanoApplyTxErr c |
Instances
LedgerError
type CardanoLedgerError c = HardForkLedgerError (CardanoEras c) Source #
An error resulting from applying a CardanoBlock to the ledger.
Thanks to the pattern synonyms, you can treat this as a sum type with
constructors LedgerErrorByron, LedgerErrorShelley, and
LedgerErrorWrongEra.
toText :: CardanoLedgerError c -> Text toText (LedgerErrorByron b) = byronLedgerErrorToText b toText (LedgerErrorShelley s) = shelleyLedgerErrorToText s toText (LedgerErrorAllegra a) = allegraLedgerErrorToText a toText (LedgerErrorMary m) = maryLedgerErrorToText m toText (LedgerErrorWrongEra eraMismatch) = "Block from the " <> otherEraName eraMismatch <> " era applied to a ledger from the " <> ledgerEraName eraMismatch <> " era"
data HardForkLedgerError (xs :: [Type]) where Source #
Bundled Patterns
| pattern LedgerErrorByron :: LedgerError ByronBlock -> CardanoLedgerError c | |
| pattern LedgerErrorShelley :: LedgerError (ShelleyBlock (ShelleyEra c)) -> CardanoLedgerError c | |
| pattern LedgerErrorAllegra :: LedgerError (ShelleyBlock (AllegraEra c)) -> CardanoLedgerError c | |
| pattern LedgerErrorMary :: LedgerError (ShelleyBlock (MaryEra c)) -> CardanoLedgerError c | |
| pattern LedgerErrorWrongEra :: EraMismatch -> CardanoLedgerError c |
Instances
OtherEnvelopeError
type CardanoOtherHeaderEnvelopeError c = HardForkEnvelopeErr (CardanoEras c) Source #
An error resulting from validating a CardanoHeader.
data HardForkEnvelopeErr (xs :: [Type]) where Source #
Bundled Patterns
Instances
TipInfo
type CardanoTipInfo c = OneEraTipInfo (CardanoEras c) Source #
The TipInfo of the Cardano chain.
data OneEraTipInfo (xs :: [Type]) where Source #
Bundled Patterns
| pattern TipInfoByron :: TipInfo ByronBlock -> CardanoTipInfo c | |
| pattern TipInfoShelley :: TipInfo (ShelleyBlock (ShelleyEra c)) -> CardanoTipInfo c | |
| pattern TipInfoAllegra :: TipInfo (ShelleyBlock (AllegraEra c)) -> CardanoTipInfo c | |
| pattern TipInfoMary :: TipInfo (ShelleyBlock (MaryEra c)) -> CardanoTipInfo c |
Instances
| CanHardFork xs => Eq (OneEraTipInfo xs) | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods (==) :: OneEraTipInfo xs -> OneEraTipInfo xs -> Bool # (/=) :: OneEraTipInfo xs -> OneEraTipInfo xs -> Bool # | |
| CanHardFork xs => Show (OneEraTipInfo xs) | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods showsPrec :: Int -> OneEraTipInfo xs -> ShowS # show :: OneEraTipInfo xs -> String # showList :: [OneEraTipInfo xs] -> ShowS # | |
| CanHardFork xs => NoThunks (OneEraTipInfo xs) | |
Query
type CardanoQuery c = Query (CardanoBlock c) Source #
The Query of Cardano chain.
data family Query blk :: Type -> Type Source #
Different queries supported by the ledger, indexed by the result type.
Instances
type CardanoQueryResult c = HardForkQueryResult (CardanoEras c) Source #
The result of a CardanoQuery
Thanks to the pattern synonyms, you can treat this as a sum type with
constructors QueryResultSuccess and QueryResultEraMismatch.
The Either type represents values with two possibilities: a value of
type is either Either a b or Left a.Right b
The Either type is sometimes used to represent a value which is
either correct or an error; by convention, the Left constructor is
used to hold an error value and the Right constructor is used to
hold a correct value (mnemonic: "right" also means "correct").
Examples
The type is the type of values which can be either
a Either String IntString or an Int. The Left constructor can be used only on
Strings, and the Right constructor can be used only on Ints:
>>>let s = Left "foo" :: Either String Int>>>sLeft "foo">>>let n = Right 3 :: Either String Int>>>nRight 3>>>:type ss :: Either String Int>>>:type nn :: Either String Int
The fmap from our Functor instance will ignore Left values, but
will apply the supplied function to values contained in a Right:
>>>let s = Left "foo" :: Either String Int>>>let n = Right 3 :: Either String Int>>>fmap (*2) sLeft "foo">>>fmap (*2) nRight 6
The Monad instance for Either allows us to chain together multiple
actions which may fail, and fail overall if any of the individual
steps failed. First we'll write a function that can either parse an
Int from a Char, or fail.
>>>import Data.Char ( digitToInt, isDigit )>>>:{let parseEither :: Char -> Either String Int parseEither c | isDigit c = Right (digitToInt c) | otherwise = Left "parse error">>>:}
The following should work, since both '1' and '2' can be
parsed as Ints.
>>>:{let parseMultiple :: Either String Int parseMultiple = do x <- parseEither '1' y <- parseEither '2' return (x + y)>>>:}
>>>parseMultipleRight 3
But the following should fail overall, since the first operation where
we attempt to parse 'm' as an Int will fail:
>>>:{let parseMultiple :: Either String Int parseMultiple = do x <- parseEither 'm' y <- parseEither '2' return (x + y)>>>:}
>>>parseMultipleLeft "parse error"
Bundled Patterns
| pattern QueryResultSuccess :: result -> CardanoQueryResult c result | |
| pattern QueryResultEraMismatch :: EraMismatch -> CardanoQueryResult c result | A query from a different era than the ledger's era was sent. |
Instances
| Eq2 Either | Since: base-4.9.0.0 |
| Ord2 Either | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Read2 Either | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Either a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] # | |
| Show2 Either | Since: base-4.9.0.0 |
| Hashable2 Either | |
| MonadError e (Either e) | |
Defined in Control.Monad.Error.Class | |
| (Lift a, Lift b) => Lift (Either a b :: Type) | |
| Monad (Either e) | Since: base-4.4.0.0 |
| Functor (Either a) | Since: base-3.0 |
| Applicative (Either e) | Since: base-3.0 |
| Foldable (Either a) | Since: base-4.7.0.0 |
Defined in Data.Foldable Methods fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # | |
| Traversable (Either a) | Since: base-4.7.0.0 |
Defined in Data.Traversable | |
| Eq a => Eq1 (Either a) | Since: base-4.9.0.0 |
| Ord a => Ord1 (Either a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Read a => Read1 (Either a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Either a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] # | |
| Show a => Show1 (Either a) | Since: base-4.9.0.0 |
| MonadFailure (Either a) | |
| Hashable a => Hashable1 (Either a) | |
Defined in Data.Hashable.Class | |
| Generic1 (Either a :: Type -> Type) | Since: base-4.6.0.0 |
| (Eq a, Eq b) => Eq (Either a b) | Since: base-2.1 |
| (Ord a, Ord b) => Ord (Either a b) | Since: base-2.1 |
| (Read a, Read b) => Read (Either a b) | Since: base-3.0 |
| (Show a, Show b) => Show (Either a b) | Since: base-3.0 |
| Generic (Either a b) | Since: base-4.6.0.0 |
| Semigroup (Either a b) | Since: base-4.9.0.0 |
| (Structured a, Structured b) => Structured (Either a b) | |
Defined in Distribution.Utils.Structured | |
| (Hashable a, Hashable b) => Hashable (Either a b) | |
| (ToCBOR a, ToCBOR b) => ToCBOR (Either a b) | |
| (FromCBOR a, FromCBOR b) => FromCBOR (Either a b) | |
| (NoThunks a, NoThunks b) => NoThunks (Either a b) | |
| (Serialise a, Serialise b) => Serialise (Either a b) | Since: serialise-0.2.0.0 |
| Recursive (Either a b) | |
Defined in Data.Functor.Foldable Methods project :: Either a b -> Base (Either a b) (Either a b) Source # cata :: (Base (Either a b) a0 -> a0) -> Either a b -> a0 Source # para :: (Base (Either a b) (Either a b, a0) -> a0) -> Either a b -> a0 Source # gpara :: (Corecursive (Either a b), Comonad w) => (forall b0. Base (Either a b) (w b0) -> w (Base (Either a b) b0)) -> (Base (Either a b) (EnvT (Either a b) w a0) -> a0) -> Either a b -> a0 Source # prepro :: Corecursive (Either a b) => (forall b0. Base (Either a b) b0 -> Base (Either a b) b0) -> (Base (Either a b) a0 -> a0) -> Either a b -> a0 Source # gprepro :: (Corecursive (Either a b), Comonad w) => (forall b0. Base (Either a b) (w b0) -> w (Base (Either a b) b0)) -> (forall c. Base (Either a b) c -> Base (Either a b) c) -> (Base (Either a b) (w a0) -> a0) -> Either a b -> a0 Source # | |
| Corecursive (Either a b) | |
Defined in Data.Functor.Foldable Methods embed :: Base (Either a b) (Either a b) -> Either a b Source # ana :: (a0 -> Base (Either a b) a0) -> a0 -> Either a b Source # apo :: (a0 -> Base (Either a b) (Either (Either a b) a0)) -> a0 -> Either a b Source # postpro :: Recursive (Either a b) => (forall b0. Base (Either a b) b0 -> Base (Either a b) b0) -> (a0 -> Base (Either a b) a0) -> a0 -> Either a b Source # gpostpro :: (Recursive (Either a b), Monad m) => (forall b0. m (Base (Either a b) b0) -> Base (Either a b) (m b0)) -> (forall c. Base (Either a b) c -> Base (Either a b) c) -> (a0 -> Base (Either a b) (m a0)) -> a0 -> Either a b Source # | |
| type Failure (Either a) | |
Defined in Basement.Monad | |
| type Rep1 (Either a :: Type -> Type) | |
Defined in GHC.Generics type Rep1 (Either a :: Type -> Type) = D1 ('MetaData "Either" "Data.Either" "base" 'False) (C1 ('MetaCons "Left" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Right" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) | |
| type Rep (Either a b) | |
Defined in GHC.Generics type Rep (Either a b) = D1 ('MetaData "Either" "Data.Either" "base" 'False) (C1 ('MetaCons "Left" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Right" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b))) | |
| type Base (Either a b) | Example boring stub for non-recursive data types |
CodecConfig
type CardanoCodecConfig c = CodecConfig (CardanoBlock c) Source #
The CodecConfig for CardanoBlock.
Thanks to the pattern synonyms, you can treat this as the product of
the Byron, Shelley, ... CodecConfigs.
data family CodecConfig blk Source #
Static configuration required for serialisation and deserialisation of types pertaining to this type of block.
Data family instead of type family to get better type inference.
Instances
BlockConfig
type CardanoBlockConfig c = BlockConfig (CardanoBlock c) Source #
The BlockConfig for CardanoBlock.
Thanks to the pattern synonyms, you can treat this as the product of
the Byron, Shelley, ... BlockConfigs.
data family BlockConfig blk Source #
Static configuration required to work with this type of blocks
Instances
StorageConfig
type CardanoStorageConfig c = StorageConfig (CardanoBlock c) Source #
The StorageConfig for CardanoBlock.
Thanks to the pattern synonyms, you can treat this as the product of
the Byron, Shelley, ... StorageConfigs.
data family StorageConfig blk Source #
Config needed for the
NodeInitStorage class. Defined here to
avoid circular dependencies.
Instances
ConsensusConfig
type CardanoConsensusConfig c = ConsensusConfig (HardForkProtocol (CardanoEras c)) Source #
The ConsensusConfig for CardanoBlock.
Thanks to the pattern synonyms, you can treat this as the product of the
Byron, Shelley, ... PartialConsensusConfigs.
NOTE: not ConsensusConfig, but PartialConsensusConfig.
data family ConsensusConfig p Source #
Static configuration required to run the consensus protocol
Every method in the ConsensusProtocol class takes the consensus
configuration as a parameter, so having this as a data family rather than a
type family resolves most ambiguity.
Defined out of the class so that protocols can define this type without having to define the entire protocol at the same time (or indeed in the same module).
Instances
LedgerConfig
type CardanoLedgerConfig c = HardForkLedgerConfig (CardanoEras c) Source #
The LedgerConfig for CardanoBlock.
Thanks to the pattern synonyms, you can treat this as the product of the
Byron, Shelley, ... PartialLedgerConfigs.
NOTE: not LedgerConfig, but PartialLedgerConfig.
data HardForkLedgerConfig (xs :: [Type]) where Source #
Bundled Patterns
| pattern CardanoLedgerConfig :: PartialLedgerConfig ByronBlock -> PartialLedgerConfig (ShelleyBlock (ShelleyEra c)) -> PartialLedgerConfig (ShelleyBlock (AllegraEra c)) -> PartialLedgerConfig (ShelleyBlock (MaryEra c)) -> CardanoLedgerConfig c |
Instances
| Generic (HardForkLedgerConfig xs) | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Basics Associated Types type Rep (HardForkLedgerConfig xs) :: Type -> Type # Methods from :: HardForkLedgerConfig xs -> Rep (HardForkLedgerConfig xs) x # to :: Rep (HardForkLedgerConfig xs) x -> HardForkLedgerConfig xs # | |
| CanHardFork xs => NoThunks (HardForkLedgerConfig xs) | |
| type Rep (HardForkLedgerConfig xs) | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Basics type Rep (HardForkLedgerConfig xs) = D1 ('MetaData "HardForkLedgerConfig" "Ouroboros.Consensus.HardFork.Combinator.Basics" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "HardForkLedgerConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "hardForkLedgerConfigShape") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Shape xs)) :*: S1 ('MetaSel ('Just "hardForkLedgerConfigPerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PerEraLedgerConfig xs)))) | |
LedgerState
type CardanoLedgerState c = LedgerState (CardanoBlock c) Source #
The LedgerState for CardanoBlock.
NOTE: the CardanoLedgerState contains more than just the current era's
LedgerState. We don't give access to those internal details through the
pattern synonyms. This is also the reason the pattern synonyms are not
bidirectional.
data family LedgerState blk Source #
Ledger state associated with a block
Instances
ChainDepState
type CardanoChainDepState c = HardForkChainDepState (CardanoEras c) Source #
The ChainDepState for CardanoBlock.
NOTE: the CardanoChainDepState contains more than just the current era's
ChainDepState. We don't give access to those internal details through the
pattern synonyms. This is also the reason the pattern synonyms are not
bidirectional.
data HardForkState (f :: Type -> Type) (xs :: [Type]) where Source #
Generic hard fork state
This is used both for the consensus state and the ledger state.
Bundled Patterns
| pattern ChainDepStateByron :: ChainDepState (BlockProtocol ByronBlock) -> CardanoChainDepState c | |
| pattern ChainDepStateShelley :: ChainDepState (BlockProtocol (ShelleyBlock (ShelleyEra c))) -> CardanoChainDepState c | |
| pattern ChainDepStateAllegra :: ChainDepState (BlockProtocol (ShelleyBlock (AllegraEra c))) -> CardanoChainDepState c | |
| pattern ChainDepStateMary :: ChainDepState (BlockProtocol (ShelleyBlock (MaryEra c))) -> CardanoChainDepState c |
Instances
| data Ticked (HardForkChainDepState xs) | |
| type SListIN HardForkState | |
| type Prod HardForkState | |
| type AllN HardForkState (c :: Type -> Constraint) | |
| type CollapseTo HardForkState a | |
EraMismatch
data EraMismatch Source #
Extra info for errors caused by applying a block, header, transaction, or query from one era to a ledger from a different era.
Constructors
| EraMismatch | |
Fields
| |
Instances
| Eq EraMismatch | |
| Show EraMismatch | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods showsPrec :: Int -> EraMismatch -> ShowS # show :: EraMismatch -> String # showList :: [EraMismatch] -> ShowS # | |
| Generic EraMismatch | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Associated Types type Rep EraMismatch :: Type -> Type # | |
| type Rep EraMismatch | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras type Rep EraMismatch = D1 ('MetaData "EraMismatch" "Ouroboros.Consensus.HardFork.Combinator.AcrossEras" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "EraMismatch" 'PrefixI 'True) (S1 ('MetaSel ('Just "ledgerEraName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "otherEraName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) | |