ouroboros-consensus-cardano-0.20.0.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Consensus.Cardano.ProtocolInfo

Description

Utility functions to elaborate a Cardano ProtocolInfo from certain parameters.

Synopsis

ProtocolInfo elaboration parameter types

Hard-fork specification

data Era Source #

Instances

Instances details
Enum Era Source # 
Instance details

Defined in Test.Consensus.Cardano.ProtocolInfo

Methods

succEraEra #

predEraEra #

toEnumIntEra #

fromEnumEraInt #

enumFromEra → [Era] #

enumFromThenEraEra → [Era] #

enumFromToEraEra → [Era] #

enumFromThenToEraEraEra → [Era] #

Show Era Source # 
Instance details

Defined in Test.Consensus.Cardano.ProtocolInfo

Methods

showsPrecIntEraShowS #

showEraString #

showList ∷ [Era] → ShowS #

Eq Era Source # 
Instance details

Defined in Test.Consensus.Cardano.ProtocolInfo

Methods

(==)EraEraBool #

(/=)EraEraBool #

Ord Era Source # 
Instance details

Defined in Test.Consensus.Cardano.ProtocolInfo

Methods

compareEraEraOrdering #

(<)EraEraBool #

(<=)EraEraBool #

(>)EraEraBool #

(>=)EraEraBool #

maxEraEraEra #

minEraEraEra #

ProtocolInfo elaboration

mkSimpleTestProtocolInfo Source #

Create a Cardano protocol info for testing purposes, using some predifined settings (see below). For a more general version see mkTestProtocolInfo.

The resulting ProtocolInfo will use a randomly generated core node. This generation will use a fixed seed. See mkTestProtocolInfo for a function that takes a core node as parameter.

The resulting ProtocolInfo will:

  • Use a NeutralNonce.
  • Use a fixed number of slots per KES evolution.
  • Have version 0 0 0 as Byron protocol version.
  • Use 1 as PbftSignatureThreshold

If you want to tweak the resulting protocol info further see mkTestProtocolInfo.

The resulting ProtocolInfo contains a ledger state. The CardanoHardForkTriggers parameter will determine to which era this ledger state belongs. See hardForkInto and hardForkOnDefaultProtocolVersions for more details on how to specify a value of this type.

mkTestProtocolInfo Source #

Arguments

∷ ∀ m c. (CardanoHardForkConstraints c, IOLike m, c ~ StandardCrypto) 
⇒ (CoreNodeId, CoreNode c)

Id of the node for which the protocol info will be elaborated.

ShelleyGenesis c

These nodes will be part of the initial delegation mapping, and funds will be allocated to these nodes.

ProtocolVersion

Protocol version of the Byron era proposal.

Nonce 
Config 
GeneratedSecrets 
Maybe PBftSignatureThreshold 
ProtVer

See protocolInfoCardano for the details of what is the relation between this version and any TriggerHardForkAtVersion that might appear in the CardanoHardForkTriggers parameter.

CardanoHardForkTriggers

Specification of the era to which the initial state should hard-fork to.

→ (ProtocolInfo (CardanoBlock c), m [BlockForging m (CardanoBlock c)]) 

A more generalized version of mkSimpleTestProtocolInfo.