ouroboros-consensus-cardano-0.1.0.1: The instantation of the Ouroboros consensus layer used by Cardano
Safe Haskell None
Language Haskell2010

Ouroboros.Consensus.Cardano.Block

Synopsis

Eras

type CardanoEras c = ByronBlock ': CardanoShelleyEras 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) = _
f (BlockAlonzo  m) = _

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

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

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

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type Rep ( GenTx ( HardForkBlock xs))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep ( GenTx ( HardForkBlock xs)) = D1 (' MetaData "GenTx" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "HardForkGenTx" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getHardForkGenTx") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( OneEraGenTx xs))))
type Rep ( TxId ( GenTx ( HardForkBlock xs)))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep ( TxId ( GenTx ( HardForkBlock xs))) = D1 (' MetaData "TxId" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "HardForkGenTxId" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getHardForkGenTxId") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( OneEraGenTxId xs))))
type Rep ( Validated ( GenTx ( HardForkBlock xs)))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep ( Validated ( GenTx ( HardForkBlock xs))) = D1 (' MetaData "Validated" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "HardForkValidatedGenTx" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getHardForkValidatedGenTx") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( OneEraValidatedGenTx xs))))
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.1-DT4Cvwf63DZKctsEvaJqCU" ' 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))))
data BlockQuery ( HardForkBlock xs) a
Instance details

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

data BlockQuery ( HardForkBlock xs) a where
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

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

newtype Validated ( 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 AuxLedgerEvent ( LedgerState ( HardForkBlock xs))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

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

data family Header blk Source #

Instances

Instances details
Inject Header
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

ShowProxy ( Header ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

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

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Eq ( Header ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyCompatible proto era => Eq ( Header ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Show ( Header ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyCompatible proto era => Show ( Header ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Generic ( Header ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

Generic ( Header ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Associated Types

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

ShelleyCompatible proto era => ToCBOR ( Header ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

ShelleyCompatible proto era => FromCBOR ( Annotator ( Header ( ShelleyBlock proto era)))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

NoThunks ( Header ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyCompatible proto era => NoThunks ( Header ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Condense ( Header ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShelleyCompatible proto era => Condense ( Header ( ShelleyBlock proto 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

ShelleyCompatible proto era => HasHeader ( Header ( ShelleyBlock proto 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 ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

type Rep ( Header ( ShelleyBlock proto era)) = D1 (' MetaData "Header" "Ouroboros.Consensus.Shelley.Ledger.Block" "ouroboros-consensus-shelley-0.1.0.1-Kwox0dapAHUG8fY5XKE0pO" ' False ) ( C1 (' MetaCons "ShelleyHeader" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "shelleyHeaderRaw") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( ShelleyProtocolHeader proto)) :*: S1 (' MetaSel (' Just "shelleyHeaderHash") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( ShelleyHash ( ProtoCrypto proto)))))
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

type Signed ( Header ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Protocol

type HeaderHash ( Header blk)
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

data Header ( ShelleyBlock proto era)
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Block

Generalised transactions

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"

type CardanoGenTx c = GenTx ( CardanoBlock c) Source #

The Cardano transaction.

type CardanoGenTxId c = GenTxId ( CardanoBlock c) Source #

The ID of a 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
Inject GenTx
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

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

Defined in Ouroboros.Consensus.Shelley.ShelleyHFC

type Rep ( GenTx ( HardForkBlock xs))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep ( GenTx ( HardForkBlock xs)) = D1 (' MetaData "GenTx" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "HardForkGenTx" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getHardForkGenTx") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( OneEraGenTx xs))))
type Rep ( GenTx ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep ( GenTx ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

type Rep ( GenTx ( ShelleyBlock proto era)) = D1 (' MetaData "GenTx" "Ouroboros.Consensus.Shelley.Ledger.Mempool" "ouroboros-consensus-shelley-0.1.0.1-Kwox0dapAHUG8fY5XKE0pO" ' False ) ( C1 (' MetaCons "ShelleyTx" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( TxId ( EraCrypto era))) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Tx era))))
type Rep ( TxId ( GenTx ( HardForkBlock xs)))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep ( TxId ( GenTx ( HardForkBlock xs))) = D1 (' MetaData "TxId" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "HardForkGenTxId" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getHardForkGenTxId") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( OneEraGenTxId xs))))
type Rep ( Validated ( GenTx ( HardForkBlock xs)))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep ( Validated ( GenTx ( HardForkBlock xs))) = D1 (' MetaData "Validated" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "HardForkValidatedGenTx" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getHardForkValidatedGenTx") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( OneEraValidatedGenTx xs))))
type Rep ( Validated ( GenTx ByronBlock ))
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep ( Validated ( GenTx ByronBlock )) = D1 (' MetaData "Validated" "Ouroboros.Consensus.Byron.Ledger.Mempool" "ouroboros-consensus-byron-0.1.0.1-1xx7v4AzrF0A75LZoaNMal" ' True ) ( C1 (' MetaCons "ValidatedByronTx" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "forgetValidatedByronTx") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( GenTx ByronBlock ))))
type Rep ( Validated ( GenTx ( ShelleyBlock proto era)))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

type Rep ( Validated ( GenTx ( ShelleyBlock proto era))) = D1 (' MetaData "Validated" "Ouroboros.Consensus.Shelley.Ledger.Mempool" "ouroboros-consensus-shelley-0.1.0.1-Kwox0dapAHUG8fY5XKE0pO" ' False ) ( C1 (' MetaCons "ShelleyValidatedTx" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( TxId ( EraCrypto era))) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Validated ( Tx era)))))
newtype GenTx ( 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

data TxId ( GenTx ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

newtype TxId ( GenTx ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

newtype Validated ( GenTx ( HardForkBlock xs))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

newtype Validated ( GenTx ByronBlock )
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

data Validated ( GenTx ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

data GenTx ( ShelleyBlock proto era)
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

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

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.1-DT4Cvwf63DZKctsEvaJqCU" ' 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

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.1-DT4Cvwf63DZKctsEvaJqCU" ' 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

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

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.1-DT4Cvwf63DZKctsEvaJqCU" ' 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

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

Query

data family BlockQuery blk :: Type -> Type Source #

Different queries supported by the ledger, indexed by the result type.

Instances

Instances details
Inject ( SomeSecond BlockQuery )
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

SameDepIndex ( BlockQuery blk) => Eq ( SomeSecond BlockQuery blk)
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

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

Defined in Ouroboros.Consensus.Ledger.Query

data BlockQuery ByronBlock a
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data BlockQuery ( HardForkBlock xs) a
Instance details

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

data BlockQuery ( HardForkBlock xs) a where
data BlockQuery ( ShelleyBlock proto era) a
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Query

data BlockQuery ( ShelleyBlock proto era) a where

type CardanoQuery c = BlockQuery ( CardanoBlock c) Source #

The Query of Cardano chain.

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

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 String s, and the Right constructor can be used only on Int s:

>>> 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 Int s.

>>> :{
    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
Hashable2 Either
Instance details

Defined in Data.Hashable.Class

MonadError e ( Either e)
Instance details

Defined in Control.Monad.Error.Class

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

Defined in Language.Haskell.TH.Syntax

Monad ( Either e)

Since: base-4.4.0.0

Instance details

Defined in Data.Either

Functor ( Either a)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

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

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

Applicative ( Either e)

Since: base-3.0

Instance details

Defined in Data.Either

Foldable ( Either a)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Either a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m Source #

foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

toList :: Either a a0 -> [a0] Source #

null :: Either a a0 -> Bool Source #

length :: Either a a0 -> Int Source #

elem :: Eq a0 => a0 -> Either a a0 -> Bool Source #

maximum :: Ord a0 => Either a a0 -> a0 Source #

minimum :: Ord a0 => Either a a0 -> a0 Source #

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

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

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

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

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

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

MonadFailure ( Either a)
Instance details

Defined in Basement.Monad

Associated Types

type Failure ( Either a) Source #

Hashable a => Hashable1 ( Either a)
Instance details

Defined in Data.Hashable.Class

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

Methods

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

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

MonadBaseControl ( Either e) ( Either e)
Instance details

Defined in Control.Monad.Trans.Control

Associated Types

type StM ( Either e) a Source #

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

Since: base-2.1

Instance details

Defined in Data.Either

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

Since: base-2.1

Instance details

Defined in Data.Either

( 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

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

Semigroup ( Either a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Either

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

Defined in Distribution.Utils.Structured

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

Defined in Data.Hashable.Class

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

Defined in Cardano.Binary.ToCBOR

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

Defined in Cardano.Binary.FromCBOR

MonoFunctor ( Either a b)
Instance details

Defined in Data.MonoTraversable

MonoFoldable ( Either a b)
Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => ( Element ( Either a b) -> m) -> Either a b -> m Source #

ofoldr :: ( Element ( Either a b) -> b0 -> b0) -> b0 -> Either a b -> b0 Source #

ofoldl' :: (a0 -> Element ( Either a b) -> a0) -> a0 -> Either a b -> a0 Source #

otoList :: Either a b -> [ Element ( Either a b)] Source #

oall :: ( Element ( Either a b) -> Bool ) -> Either a b -> Bool Source #

oany :: ( Element ( Either a b) -> Bool ) -> Either a b -> Bool Source #

onull :: Either a b -> Bool Source #

olength :: Either a b -> Int Source #

olength64 :: Either a b -> Int64 Source #

ocompareLength :: Integral i => Either a b -> i -> Ordering Source #

otraverse_ :: Applicative f => ( Element ( Either a b) -> f b0) -> Either a b -> f () Source #

ofor_ :: Applicative f => Either a b -> ( Element ( Either a b) -> f b0) -> f () Source #

omapM_ :: Applicative m => ( Element ( Either a b) -> m ()) -> Either a b -> m () Source #

oforM_ :: Applicative m => Either a b -> ( Element ( Either a b) -> m ()) -> m () Source #

ofoldlM :: Monad m => (a0 -> Element ( Either a b) -> m a0) -> a0 -> Either a b -> m a0 Source #

ofoldMap1Ex :: Semigroup m => ( Element ( Either a b) -> m) -> Either a b -> m Source #

ofoldr1Ex :: ( Element ( Either a b) -> Element ( Either a b) -> Element ( Either a b)) -> Either a b -> Element ( Either a b) Source #

ofoldl1Ex' :: ( Element ( Either a b) -> Element ( Either a b) -> Element ( Either a b)) -> Either a b -> Element ( Either a b) Source #

headEx :: Either a b -> Element ( Either a b) Source #

lastEx :: Either a b -> Element ( Either a b) Source #

unsafeHead :: Either a b -> Element ( Either a b) Source #

unsafeLast :: Either a b -> Element ( Either a b) Source #

maximumByEx :: ( Element ( Either a b) -> Element ( Either a b) -> Ordering ) -> Either a b -> Element ( Either a b) Source #

minimumByEx :: ( Element ( Either a b) -> Element ( Either a b) -> Ordering ) -> Either a b -> Element ( Either a b) Source #

oelem :: Element ( Either a b) -> Either a b -> Bool Source #

onotElem :: Element ( Either a b) -> Either a b -> Bool Source #

MonoTraversable ( Either a b)
Instance details

Defined in Data.MonoTraversable

MonoPointed ( Either a b)
Instance details

Defined in Data.MonoTraversable

( 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

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

Defined in PlutusTx.Ord

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 #

(a ~ a', b ~ b') => Each ( Either a a') ( Either b b') a b

Since: microlens-0.4.11

Instance details

Defined in Lens.Micro.Internal

type Failure ( Either a)
Instance details

Defined in Basement.Monad

type Failure ( Either a) = a
type StM ( Either e) a
Instance details

Defined in Control.Monad.Trans.Control

type StM ( Either e) 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 Element ( Either a b)
Instance details

Defined in Data.MonoTraversable

type Element ( Either a b) = b
type Base ( Either a b)

Example boring stub for non-recursive data types

Instance details

Defined in Data.Functor.Foldable

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, ... CodecConfig s.

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
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.1-1xx7v4AzrF0A75LZoaNMal" ' True ) ( C1 (' MetaCons "ByronCodecConfig" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getByronEpochSlots") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 EpochSlots )))
type Rep ( CodecConfig ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

type Rep ( CodecConfig ( ShelleyBlock proto era)) = D1 (' MetaData "CodecConfig" "Ouroboros.Consensus.Shelley.Ledger.Config" "ouroboros-consensus-shelley-0.1.0.1-Kwox0dapAHUG8fY5XKE0pO" ' 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 proto era)

No particular codec configuration is needed for Shelley

Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

BlockConfig

data family BlockConfig blk Source #

Static configuration required to work with this type of blocks

Instances

Instances details
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.1-1xx7v4AzrF0A75LZoaNMal" ' 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 proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

newtype BlockConfig ( HardForkBlock xs)
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

data BlockConfig ( ShelleyBlock proto era)
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

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, ... BlockConfig s.

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, ... StorageConfig s.

data family StorageConfig blk Source #

Config needed for the NodeInitStorage class. Defined here to avoid circular dependencies.

Instances

Instances details
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.1-1xx7v4AzrF0A75LZoaNMal" ' True ) ( C1 (' MetaCons "ByronStorageConfig" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getByronBlockConfig") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( BlockConfig ByronBlock ))))
type Rep ( StorageConfig ( ShelleyBlock proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Config

type Rep ( StorageConfig ( ShelleyBlock proto era)) = D1 (' MetaData "StorageConfig" "Ouroboros.Consensus.Shelley.Ledger.Config" "ouroboros-consensus-shelley-0.1.0.1-Kwox0dapAHUG8fY5XKE0pO" ' 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 proto 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, ... PartialConsensusConfig s.

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

Generic ( ConsensusConfig ( HardForkProtocol xs))
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Generic ( ConsensusConfig ( Praos c))
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

Generic ( ConsensusConfig ( TPraos c))
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

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 ( Praos c))
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

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

Defined in Ouroboros.Consensus.Protocol.TPraos

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.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "PBftConfig" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "pbftParams") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( 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.1-DT4Cvwf63DZKctsEvaJqCU" ' 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 ( Praos c))
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

type Rep ( ConsensusConfig ( Praos c)) = D1 (' MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" ' False ) ( C1 (' MetaCons "PraosConfig" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "praosParams") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 PraosParams ) :*: S1 (' MetaSel (' Just "praosEpochInfo") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( EpochInfo ( Except PastHorizonException )))))
type Rep ( ConsensusConfig ( TPraos c))
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( ConsensusConfig ( TPraos c)) = D1 (' MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.TPraos" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" ' False ) ( C1 (' MetaCons "TPraosConfig" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "tpraosParams") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 TPraosParams ) :*: S1 (' MetaSel (' Just "tpraosEpochInfo") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( EpochInfo ( Except PastHorizonException )))))
newtype 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 ( Praos c)

Static configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

data ConsensusConfig ( TPraos c)

Static configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

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, ... PartialLedgerConfig s.

NOTE: not LedgerConfig , but PartialLedgerConfig .

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

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
Inject LedgerState
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

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

data LedgerState ByronBlock
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type TranslationError era ( LedgerState :.: ShelleyBlock proto)
Instance details

Defined in Ouroboros.Consensus.Shelley.ShelleyHFC

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.1-1xx7v4AzrF0A75LZoaNMal" ' 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 proto era))
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep ( LedgerState ( ShelleyBlock proto era)) = D1 (' MetaData "LedgerState" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.1-Kwox0dapAHUG8fY5XKE0pO" ' False ) ( C1 (' MetaCons "ShelleyLedgerState" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "shelleyLedgerTip") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( WithOrigin ( ShelleyTip proto era))) :*: ( S1 (' MetaSel (' Just "shelleyLedgerState") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) (