ouroboros-consensus-cardano-0.1.0.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Cardano.Block

Synopsis

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

Instances details
SupportedNetworkProtocolVersion ByronBlockHFC Source #

Forward to the ByronBlock instance. Only supports HardForkNodeToNodeDisabled, which is compatible with nodes running with ByronBlock.

Instance details

Defined in Ouroboros.Consensus.Cardano.ByronHFC

CanHardFork xs => Eq (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CanHardFork xs => Show (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CanHardFork xs => Show (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CanHardFork xs => NoThunks (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CanHardFork xs => NoThunks (BlockConfig (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CanHardFork xs => NoThunks (CodecConfig (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CanHardFork xs => NoThunks (StorageConfig (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CardanoHardForkConstraints c => CondenseConstraints (CardanoBlock c) Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.Condense

CardanoHardForkConstraints c => SupportedNetworkProtocolVersion (CardanoBlock c) Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.Node

ShelleyBasedEra era => SupportedNetworkProtocolVersion (ShelleyBlockHFC era) Source #

Forward to the ShelleyBlock instance. Only supports HardForkNodeToNodeDisabled, which is compatible with nodes running with ShelleyBlock.

Instance details

Defined in Ouroboros.Consensus.Cardano.ShelleyHFC

Typeable xs => ShowProxy (HardForkBlock xs :: Type) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type Rep (Ticked (LedgerState (HardForkBlock xs))) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type Rep (Ticked (LedgerState (HardForkBlock xs))) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.HardFork.Combinator.Ledger" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "TickedHardForkLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedHardForkLedgerStateTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TransitionInfo) :*: S1 ('MetaSel ('Just "tickedHardForkLedgerStatePerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HardForkState (Ticked :.: LedgerState) xs))))
type HardForkIndices (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type LedgerUpdate (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type LedgerWarning (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

data Query (HardForkBlock xs) a 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

data Query (HardForkBlock xs) a where
type TipInfo (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

type OtherHeaderEnvelopeError (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type CannotForge (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Forging

type ForgeStateInfo (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Forging

type ForgeStateUpdateError (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Forging

newtype GenTx (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type ApplyTxErr (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

newtype TxId (GenTx (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type LedgerCfg (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type LedgerErr (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

newtype LedgerState (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type BlockProtocol (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

newtype BlockConfig (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

newtype CodecConfig (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

newtype StorageConfig (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

newtype Header (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

data NestedCtxt_ (HardForkBlock xs) a b 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

data NestedCtxt_ (HardForkBlock xs) a b where
data Ticked (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type BlockNodeToClientVersion (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.Common

type BlockNodeToNodeVersion (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.Common

type HeaderHash (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Headers

type CardanoHeader c = Header (CardanoBlock c) Source #

The Cardano header.

data family Header blk Source #

Instances

Instances details
Isomorphic Header 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

Methods

project :: NoHardForks blk => Header (HardForkBlock '[blk]) -> Header blk Source #

inject :: NoHardForks blk => Header blk -> Header (HardForkBlock '[blk]) Source #

HasHeader (Header blk) => Measured BlockMeasure (Header blk) 
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

ShowProxy (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

Typeable era => ShowProxy (Header (ShelleyBlock era) :: Type) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Eq (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyBasedEra era => Eq (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Methods

(==) :: Header (ShelleyBlock era) -> Header (ShelleyBlock era) -> Bool #

(/=) :: Header (ShelleyBlock era) -> Header (ShelleyBlock era) -> Bool #

Show (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyBasedEra era => Show (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Generic (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

Associated Types

type Rep (Header ByronBlock) :: Type -> Type #

Generic (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Associated Types

type Rep (Header (ShelleyBlock era)) :: Type -> Type #

Methods

from :: Header (ShelleyBlock era) -> Rep (Header (ShelleyBlock era)) x #

to :: Rep (Header (ShelleyBlock era)) x -> Header (ShelleyBlock era) #

ShelleyBasedEra era => ToCBOR (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Methods

toCBOR :: Header (ShelleyBlock era) -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (Header (ShelleyBlock era)) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Header (ShelleyBlock era)] -> Size Source #

ShelleyBasedEra era => FromCBOR (Annotator (Header (ShelleyBlock era))) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

NoThunks (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyBasedEra era => NoThunks (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Condense (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyBasedEra era => Condense (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

HasHeader blk => StandardHash (Header blk) 
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

HasHeader (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyBasedEra era => HasHeader (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

data Header ByronBlock

Byron header

See ByronBlock for comments on why we cache certain values.

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

type Rep (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

type Rep (Header ByronBlock) = D1 ('MetaData "Header" "Ouroboros.Consensus.Byron.Ledger.Block" "ouroboros-consensus-byron-0.1.0.0-GJfZjV8qqNI4kWb01fxkk3" 'False) (C1 ('MetaCons "ByronHeader" 'PrefixI 'True) ((S1 ('MetaSel ('Just "byronHeaderRaw") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ABlockOrBoundaryHdr ByteString)) :*: S1 ('MetaSel ('Just "byronHeaderSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SlotNo)) :*: (S1 ('MetaSel ('Just "byronHeaderHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronHash) :*: S1 ('MetaSel ('Just "byronHeaderBlockSizeHint") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SizeInBytes))))
type Rep (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

type Rep (Header (ShelleyBlock era)) = D1 ('MetaData "Header" "Ouroboros.Consensus.Shelley.Ledger.Block" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyHeader" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyHeaderRaw") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BHeader (EraCrypto era))) :*: S1 ('MetaSel ('Just "shelleyHeaderHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (ShelleyHash (EraCrypto era)))))
type BlockProtocol (Header blk) 
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

newtype Header (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

data Header (ShelleyBlock era) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

type Signed (Header (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.TPraos

type HeaderHash (Header blk) 
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

type HeaderHash (Header blk) = HeaderHash blk

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

Instances details
Isomorphic GenTx 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

Methods

project :: NoHardForks blk => GenTx (HardForkBlock '[blk]) -> GenTx blk Source #

inject :: NoHardForks blk => GenTx blk -> GenTx (HardForkBlock '[blk]) Source #

(ShelleyBasedEra era, TranslateEra era Tx) => TranslateEra era (GenTx :.: ShelleyBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

Associated Types

type TranslationError era (GenTx :.: ShelleyBlock) Source #

data GenTx ByronBlock

Generalized transactions in Byron

This is effectively the same as AMempoolPayload but we cache the transaction ID (a hash).

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type TranslationError era (GenTx :.: ShelleyBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

type Rep (GenTx ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep (GenTx (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

type Rep (GenTx (ShelleyBlock era)) = D1 ('MetaData "GenTx" "Ouroboros.Consensus.Shelley.Ledger.Mempool" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyTx" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (ShelleyTxId era)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Tx era))))
newtype GenTx (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

data GenTx (ShelleyBlock era) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

data GenTx (ShelleyBlock era) = ShelleyTx !(ShelleyTxId era) !(Tx era)
newtype TxId (GenTx (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

data TxId (GenTx ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

newtype TxId (GenTx (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

newtype TxId (GenTx (ShelleyBlock era)) = ShelleyTxId (ShelleyTxId era)

type CardanoGenTxId c = GenTxId (CardanoBlock c) Source #

The ID of a Cardano transaction.

data family TxId tx Source #

A generalized transaction, GenTx, identifier.

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 #

Instances

Instances details
CanHardFork xs => Eq (HardForkApplyTxErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

CanHardFork xs => Show (HardForkApplyTxErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

Generic (HardForkApplyTxErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

Associated Types

type Rep (HardForkApplyTxErr xs) :: Type -> Type #

Typeable xs => ShowProxy (HardForkApplyTxErr xs :: Type) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep (HardForkApplyTxErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep (HardForkApplyTxErr xs) = D1 ('MetaData "HardForkApplyTxErr" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "HardForkApplyTxErrFromEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (OneEraApplyTxErr xs))) :+: C1 ('MetaCons "HardForkApplyTxErrWrongEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MismatchEraInfo xs))))

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 #

Instances

Instances details
CanHardFork xs => Eq (HardForkLedgerError xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

CanHardFork xs => Show (HardForkLedgerError xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

Generic (HardForkLedgerError xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

Associated Types

type Rep (HardForkLedgerError xs) :: Type -> Type #

CanHardFork xs => NoThunks (HardForkLedgerError xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type Rep (HardForkLedgerError xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type Rep (HardForkLedgerError xs) = D1 ('MetaData "HardForkLedgerError" "Ouroboros.Consensus.HardFork.Combinator.Ledger" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "HardForkLedgerErrorFromEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OneEraLedgerError xs))) :+: C1 ('MetaCons "HardForkLedgerErrorWrongEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MismatchEraInfo xs))))

OtherEnvelopeError

type CardanoOtherHeaderEnvelopeError c = HardForkEnvelopeErr (CardanoEras c) Source #

An error resulting from validating a CardanoHeader.

data HardForkEnvelopeErr (xs :: [Type]) where Source #

Instances

Instances details
CanHardFork xs => Eq (HardForkEnvelopeErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

CanHardFork xs => Show (HardForkEnvelopeErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

Generic (HardForkEnvelopeErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

Associated Types

type Rep (HardForkEnvelopeErr xs) :: Type -> Type #

CanHardFork xs => NoThunks (HardForkEnvelopeErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type Rep (HardForkEnvelopeErr xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type Rep (HardForkEnvelopeErr xs) = D1 ('MetaData "HardForkEnvelopeErr" "Ouroboros.Consensus.HardFork.Combinator.Ledger" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "HardForkEnvelopeErrFromEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OneEraEnvelopeErr xs))) :+: C1 ('MetaCons "HardForkEnvelopeErrWrongEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MismatchEraInfo xs))))

TipInfo

type CardanoTipInfo c = OneEraTipInfo (CardanoEras c) Source #

The TipInfo of the Cardano chain.

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

Instances details
SameDepIndex (Query blk) => Eq (SomeSecond Query blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

(==) :: SomeSecond Query blk -> SomeSecond Query blk -> Bool #

(/=) :: SomeSecond Query blk -> SomeSecond Query blk -> Bool #

(forall result. Show (Query blk result)) => Show (SomeSecond Query blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

data Query ByronBlock a 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data Query (HardForkBlock xs) a 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

data Query (HardForkBlock xs) a where
data Query (ShelleyBlock era) a 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Query

data Query (ShelleyBlock era) a where

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.

data Either a b where #

The Either type represents values with two possibilities: a value of type Either a b is either Left a or 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

Expand

The type Either String Int is the type of values which can be either a String 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
>>> s
Left "foo"
>>> let n = Right 3 :: Either String Int
>>> n
Right 3
>>> :type s
s :: Either String Int
>>> :type n
n :: 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) s
Left "foo"
>>> fmap (*2) n
Right 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)
>>> :}
>>> parseMultiple
Right 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)
>>> :}
>>> parseMultiple
Left "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

Instances details
Eq2 Either

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Either a c -> Either b d -> Bool #

Ord2 Either

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Either a c -> Either b d -> Ordering #

Read2 Either

Since: base-4.9.0.0

Instance details

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

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Either a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Either a b] -> ShowS #

Hashable2 Either 
Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt2 :: (Int -> a -> Int) -> (Int -> b -> Int) -> Int -> Either a b -> Int Source #

MonadError e (Either e) 
Instance details

Defined in Control.Monad.Error.Class

Methods

throwError :: e -> Either e a #

catchError :: Either e a -> (e -> Either e a) -> Either e a #

(Lift a, Lift b) => Lift (Either a b :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Either a b -> Q Exp #

liftTyped :: Either a b -> Q (TExp (Either a b)) #

Monad (Either e)

Since: base-4.4.0.0

Instance details

Defined in Data.Either

Methods

(>>=) :: Either e a -> (a -> Either e b) -> Either e b #

(>>) :: Either e a -> Either e b -> Either e b #

return :: a -> Either e a #

Functor (Either a)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

fmap :: (a0 -> b) -> Either a a0 -> Either a b #

(<$) :: a0 -> Either a b -> Either a a0 #

Applicative (Either e)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

pure :: a -> Either e a #

(<*>) :: Either e (a -> b) -> Either e a -> Either e b #

liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c #

(*>) :: Either e a -> Either e b -> Either e b #

(<*) :: Either e a -> Either e b -> Either e a #

Foldable (Either a)

Since: base-4.7.0.0

Instance details

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] #

null :: Either a a0 -> Bool #

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 #

sum :: Num a0 => Either a a0 -> a0 #

product :: Num a0 => Either a a0 -> a0 #

Traversable (Either a)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) #

sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) #

mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) #

sequence :: Monad m => Either a (m a0) -> m (Either a a0) #

Eq a => Eq1 (Either a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a0 -> b -> Bool) -> Either a a0 -> Either a b -> Bool #

Ord a => Ord1 (Either a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a0 -> b -> Ordering) -> Either a a0 -> Either a b -> Ordering #

Read a => Read1 (Either a)

Since: base-4.9.0.0

Instance details

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

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Either a a0 -> ShowS #

liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Either a a0] -> ShowS #

MonadFailure (Either a) 
Instance details

Defined in Basement.Monad

Associated Types

type Failure (Either a) Source #

Methods

mFail :: Failure (Either a) -> Either a () Source #

Hashable a => Hashable1 (Either a) 
Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a0 -> Int) -> Int -> Either a a0 -> Int Source #

Generic1 (Either a :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (Either a) :: k -> Type #

Methods

from1 :: forall (a0 :: k). Either a a0 -> Rep1 (Either a) a0 #

to1 :: forall (a0 :: k). Rep1 (Either a) a0 -> Either a a0 #

(Eq a, Eq b) => Eq (Either a b)

Since: base-2.1

Instance details

Defined in Data.Either

Methods

(==) :: Either a b -> Either a b -> Bool #

(/=) :: Either a b -> Either a b -> Bool #

(Ord a, Ord b) => Ord (Either a b)

Since: base-2.1

Instance details

Defined in Data.Either

Methods

compare :: Either a b -> Either a b -> Ordering #

(<) :: Either a b -> Either a b -> Bool #

(<=) :: Either a b -> Either a b -> Bool #

(>) :: Either a b -> Either a b -> Bool #

(>=) :: Either a b -> Either a b -> Bool #

max :: Either a b -> Either a b -> Either a b #

min :: Either a b -> Either a b -> Either a b #

(Read a, Read b) => Read (Either a b)

Since: base-3.0

Instance details

Defined in Data.Either

(Show a, Show b) => Show (Either a b)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

showsPrec :: Int -> Either a b -> ShowS #

show :: Either a b -> String #

showList :: [Either a b] -> ShowS #

Generic (Either a b)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Either a b) :: Type -> Type #

Methods

from :: Either a b -> Rep (Either a b) x #

to :: Rep (Either a b) x -> Either a b #

Semigroup (Either a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Either

Methods

(<>) :: Either a b -> Either a b -> Either a b #

sconcat :: NonEmpty (Either a b) -> Either a b #

stimes :: Integral b0 => b0 -> Either a b -> Either a b #

(Structured a, Structured b) => Structured (Either a b) 
Instance details

Defined in Distribution.Utils.Structured

Methods

structure :: Proxy (Either a b) -> Structure #

structureHash' :: Tagged (Either a b) MD5

(Hashable a, Hashable b) => Hashable (Either a b) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Either a b -> Int Source #

hash :: Either a b -> Int Source #

(ToCBOR a, ToCBOR b) => ToCBOR (Either a b) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR :: Either a b -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (Either a b) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Either a b] -> Size Source #

(FromCBOR a, FromCBOR b) => FromCBOR (Either a b) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBOR :: Decoder s (Either a b) Source #

label :: Proxy (Either a b) -> Text Source #

(NoThunks a, NoThunks b) => NoThunks (Either a b) 
Instance details

Defined in NoThunks.Class

(Serialise a, Serialise b) => Serialise (Either a b)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Recursive (Either a b) 
Instance details

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) 
Instance details

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) 
Instance details

Defined in Basement.Monad

type Failure (Either a) = a
type Rep1 (Either a :: Type -> Type) 
Instance details

Defined in GHC.Generics

type Rep (Either a b) 
Instance details

Defined in GHC.Generics

type Base (Either a b)

Example boring stub for non-recursive data types

Instance details

Defined in Data.Functor.Foldable

type Base (Either a b) = Const (Either a b) :: Type -> Type

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

Instances details
Isomorphic CodecConfig 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

CanHardFork xs => NoThunks (CodecConfig (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

newtype CodecConfig ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (CodecConfig ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (CodecConfig ByronBlock) = D1 ('MetaData "CodecConfig" "Ouroboros.Consensus.Byron.Ledger.Config" "ouroboros-consensus-byron-0.1.0.0-GJfZjV8qqNI4kWb01fxkk3" 'True) (C1 ('MetaCons "ByronCodecConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "getByronEpochSlots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EpochSlots)))
type Rep (CodecConfig (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

type Rep (CodecConfig (ShelleyBlock era)) = D1 ('MetaData "CodecConfig" "Ouroboros.Consensus.Shelley.Ledger.Config" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyCodecConfig" 'PrefixI 'False) (U1 :: Type -> Type))
newtype CodecConfig (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

data CodecConfig (ShelleyBlock era)

No particular codec configuration is needed for Shelley

Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

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

Instances details
Isomorphic BlockConfig 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

CanHardFork xs => NoThunks (BlockConfig (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

data BlockConfig ByronBlock

Extended configuration we need for Byron

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (BlockConfig ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (BlockConfig ByronBlock) = D1 ('MetaData "BlockConfig" "Ouroboros.Consensus.Byron.Ledger.Config" "ouroboros-consensus-byron-0.1.0.0-GJfZjV8qqNI4kWb01fxkk3" 'False) (C1 ('MetaCons "ByronConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "byronGenesisConfig") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Config) :*: (S1 ('MetaSel ('Just "byronProtocolVersion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtocolVersion) :*: S1 ('MetaSel ('Just "byronSoftwareVersion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SoftwareVersion))))
type Rep (BlockConfig (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

type Rep (BlockConfig (ShelleyBlock era)) = D1 ('MetaData "BlockConfig" "Ouroboros.Consensus.Shelley.Ledger.Config" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "shelleyProtocolVersion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtVer) :*: S1 ('MetaSel ('Just "shelleySystemStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SystemStart)) :*: (S1 ('MetaSel ('Just "shelleyNetworkMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 NetworkMagic) :*: S1 ('MetaSel ('Just "shelleyBlockIssuerVKeys") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'BlockIssuer (EraCrypto era)) (VKey 'BlockIssuer (EraCrypto era)))))))
newtype BlockConfig (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

data BlockConfig (ShelleyBlock era) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

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

Instances details
Isomorphic StorageConfig 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

CanHardFork xs => NoThunks (StorageConfig (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

newtype StorageConfig ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (StorageConfig ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (StorageConfig ByronBlock) = D1 ('MetaData "StorageConfig" "Ouroboros.Consensus.Byron.Ledger.Config" "ouroboros-consensus-byron-0.1.0.0-GJfZjV8qqNI4kWb01fxkk3" 'True) (C1 ('MetaCons "ByronStorageConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "getByronBlockConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BlockConfig ByronBlock))))
type Rep (StorageConfig (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

type Rep (StorageConfig (ShelleyBlock era)) = D1 ('MetaData "StorageConfig" "Ouroboros.Consensus.Shelley.Ledger.Config" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyStorageConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyStorageConfigSlotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "shelleyStorageConfigSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SecurityParam)))
newtype StorageConfig (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

data StorageConfig (ShelleyBlock era) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

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

Instances details
Generic (ConsensusConfig (PBft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

Associated Types

type Rep (ConsensusConfig (PBft c)) :: Type -> Type #

Generic (ConsensusConfig (HardForkProtocol xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Associated Types

type Rep (ConsensusConfig (HardForkProtocol xs)) :: Type -> Type #

Generic (ConsensusConfig (TPraos c)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

Associated Types

type Rep (ConsensusConfig (TPraos c)) :: Type -> Type #

NoThunks (ConsensusConfig (PBft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

CanHardFork xs => NoThunks (ConsensusConfig (HardForkProtocol xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

PraosCrypto c => NoThunks (ConsensusConfig (TPraos c)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

type Rep (ConsensusConfig (PBft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type Rep (ConsensusConfig (PBft c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.PBFT" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "PBftConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "pbftParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PBftParams)))
type Rep (ConsensusConfig (HardForkProtocol xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type Rep (ConsensusConfig (HardForkProtocol xs)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.HardFork.Combinator.Basics" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "HardForkConsensusConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "hardForkConsensusConfigK") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SecurityParam) :*: (S1 ('MetaSel ('Just "hardForkConsensusConfigShape") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Shape xs)) :*: S1 ('MetaSel ('Just "hardForkConsensusConfigPerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PerEraConsensusConfig xs)))))
type Rep (ConsensusConfig (TPraos c)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

type Rep (ConsensusConfig (TPraos c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Shelley.Protocol" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "TPraosConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "tpraosParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TPraosParams) :*: S1 ('MetaSel ('Just "tpraosEpochInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (EpochInfo Identity))))
data ConsensusConfig (PBft c)

(Static) node configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

data ConsensusConfig (HardForkProtocol xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

data ConsensusConfig (TPraos c)

Static configuration

Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

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 #

Instances

Instances details
Generic (HardForkLedgerConfig xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Associated Types

type Rep (HardForkLedgerConfig xs) :: Type -> Type #

CanHardFork xs => NoThunks (HardForkLedgerConfig xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type Rep (HardForkLedgerConfig xs) 
Instance details

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

Instances details
Isomorphic LedgerState 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

(ShelleyBasedEra era, TranslateEra era ShelleyTip, TranslateEra era NewEpochState, TranslationError era NewEpochState ~ Void) => TranslateEra era (LedgerState :.: ShelleyBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

CanHardFork xs => Eq (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CanHardFork xs => Show (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

CanHardFork xs => NoThunks (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Isomorphic (Ticked :.: LedgerState) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

data LedgerState ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type TranslationError era (LedgerState :.: ShelleyBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

type Rep (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (LedgerState ByronBlock) = D1 ('MetaData "LedgerState" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-byron-0.1.0.0-GJfZjV8qqNI4kWb01fxkk3" 'False) (C1 ('MetaCons "ByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "byronLedgerTipBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin BlockNo)) :*: (S1 ('MetaSel ('Just "byronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "byronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronTransition))))
type Rep (LedgerState (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (LedgerState (ShelleyBlock era)) = D1 ('MetaData "LedgerState" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (ShelleyTip era))) :*: (S1 ('MetaSel ('Just "shelleyLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era)) :*: S1 ('MetaSel ('Just "shelleyLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ShelleyTransition))))
type Rep (Ticked (LedgerState (HardForkBlock xs))) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type Rep (Ticked (LedgerState (HardForkBlock xs))) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.HardFork.Combinator.Ledger" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "TickedHardForkLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedHardForkLedgerStateTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TransitionInfo) :*: S1 ('MetaSel ('Just "tickedHardForkLedgerStatePerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HardForkState (Ticked :.: LedgerState) xs))))
type Rep (Ticked (LedgerState ByronBlock)) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (Ticked (LedgerState ByronBlock)) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-byron-0.1.0.0-GJfZjV8qqNI4kWb01fxkk3" 'False) (C1 ('MetaCons "TickedByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedByronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "untickedByronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronTransition)))
type Rep (Ticked (LedgerState (ShelleyBlock era))) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (Ticked (LedgerState (ShelleyBlock era))) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "TickedShelleyLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "untickedShelleyLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (ShelleyTip era))) :*: (S1 ('MetaSel ('Just "tickedShelleyLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ShelleyTransition) :*: S1 ('MetaSel ('Just "tickedShelleyLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era)))))
type LedgerCfg (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type LedgerCfg (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerCfg (LedgerState (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type LedgerErr (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type LedgerErr (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerErr (LedgerState (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

newtype LedgerState (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

data LedgerState (ShelleyBlock era) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

data Ticked (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

data Ticked (LedgerState ByronBlock)

The ticked Byron ledger state

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data Ticked (LedgerState (ShelleyBlock era))

Ticking only affects the state itself

Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type HeaderHash (LedgerState blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Basics

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.

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

Instances details
Eq EraMismatch 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras

Show EraMismatch 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras

Generic EraMismatch 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras

Associated Types

type Rep EraMismatch :: Type -> Type #

type Rep EraMismatch 
Instance details

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)))