ouroboros-consensus-shelley-test-0.1.0.0: Test infrastructure for Shelley
Safe HaskellNone
LanguageHaskell2010

Test.ThreadNet.Infra.Shelley

Synopsis

Documentation

data CoreNode c Source #

Constructors

CoreNode 

Fields

  • cnGenesisKey ∷ !(SignKeyDSIGN c)
     
  • cnDelegateKey ∷ !(SignKeyDSIGN c)

    Cold delegate key. The hash of the corresponding verification (public) key will be used as the payment credential.

  • cnStakingKey ∷ !(SignKeyDSIGN c)

    The hash of the corresponding verification (public) key will be used as the staking credential.

  • cnVRF ∷ !(SignKeyVRF c)
     
  • cnKES ∷ !(SignKeyKES c)
     
  • cnOCert ∷ !(OCert c)
     

data CoreNodeKeyInfo c Source #

Constructors

CoreNodeKeyInfo 

Fields

  • cnkiKeyPair ∷ (KeyPair 'Payment c, KeyPair 'Staking c)
     
  • cnkiCoreNode ∷ (KeyPair 'Genesis c, AllIssuerKeys c 'GenesisDelegate)
     

newtype DecentralizationParam Source #

A suitable value for the d protocol parameter

In the range 0 to 1, inclusive. Beware the misnomer: 0 means fully decentralized, and 1 means fully centralized.

Instances

Instances details
Eq DecentralizationParam Source # 
Instance details

Defined in Test.ThreadNet.Infra.Shelley

Ord DecentralizationParam Source # 
Instance details

Defined in Test.ThreadNet.Infra.Shelley

Show DecentralizationParam Source # 
Instance details

Defined in Test.ThreadNet.Infra.Shelley

Generic DecentralizationParam Source # 
Instance details

Defined in Test.ThreadNet.Infra.Shelley

Associated Types

type Rep DecentralizationParamTypeType Source #

Arbitrary DecentralizationParam Source #

A fraction with denominator 10 and numerator 0 to 10 inclusive

Instance details

Defined in Test.ThreadNet.Infra.Shelley

type Rep DecentralizationParam Source # 
Instance details

Defined in Test.ThreadNet.Infra.Shelley

type Rep DecentralizationParam = D1 ('MetaData "DecentralizationParam" "Test.ThreadNet.Infra.Shelley" "ouroboros-consensus-shelley-test-0.1.0.0-inplace" 'True) (C1 ('MetaCons "DecentralizationParam" 'PrefixI 'True) (S1 ('MetaSel ('Just "decentralizationParamToRational") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)))

data KesConfig Source #

Currently maxEvolutions * slotsPerEvolution is the max number of slots the test can run without needing new ocerts.

TODO This limitation may be lifted by PR #2107, see https://github.com/input-output-hk/ouroboros-network/issues/2107.

Constructors

KesConfig 

genCoreNode ∷ ∀ c. PraosCrypto c ⇒ KESPeriod → Gen (CoreNode c) Source #

mkCredential ∷ Crypto c ⇒ SignKeyDSIGN c → Credential r c Source #

mkEpochSizeSecurityParamRationalEpochSize Source #

The epoch size, given k and f.

INVARIANT: 10 * k / f must be a whole number.

mkGenesisConfig Source #

Arguments

∷ ∀ era. PraosCrypto (EraCrypto era) 
ProtVer

Initial protocol version

SecurityParam 
Rational

Initial active slot coefficient

DecentralizationParam 
Word64

Max Lovelace supply, must be >= #coreNodes * initialLovelacePerCoreNode

SlotLength 
KesConfig 
→ [CoreNode (EraCrypto era)] 
ShelleyGenesis era 

Note: a KES algorithm supports a particular max number of KES evolutions, but we can configure a potentially lower maximum for the ledger, that's why we take it as an argument.

mkKesConfig ∷ ∀ proxy c. Crypto c ⇒ proxy c → NumSlotsKesConfig Source #

A KesConfig that will not require more evolutions than this test's crypto allows.

mkKeyHash ∷ Crypto c ⇒ SignKeyDSIGN c → KeyHash r c Source #

mkKeyHashVrf ∷ (HashAlgorithm h, VRFAlgorithm vrf) ⇒ SignKeyVRF vrf → Hash h (VerKeyVRF vrf) Source #

mkKeyPair ∷ Crypto c ⇒ SignKeyDSIGN c → KeyPair r c Source #

mkMASetDecentralizationParamTxs Source #

Arguments

∷ ∀ proto era. (ShelleyBasedEra era, Tx era ~ Tx era, TxBody era ~ TxBody era, PParams era ~ PParams era, PParamsDelta era ~ PParams' StrictMaybe era, Witnesses era ~ WitnessSet era) 
⇒ [CoreNode (Crypto era)] 
ProtVer

The proposed protocol version

SlotNo

The TTL

DecentralizationParam

The new value

→ [GenTx (ShelleyBlock proto era)] 

TODO This is a copy-paste-edit of mkSetDecentralizationParamTxs

Our current plan is to replace all of this infrastructure with the ThreadNet rewrite; so we're minimizing the work and maintenance here for now.

mkSetDecentralizationParamTxs Source #

Arguments

∷ ∀ c. ShelleyBasedEra (ShelleyEra c) 
⇒ [CoreNode c] 
ProtVer

The proposed protocol version

SlotNo

The TTL

DecentralizationParam

The new value

→ [GenTx (ShelleyBlock (TPraos c) (ShelleyEra c))] 

mkVerKey ∷ Crypto c ⇒ SignKeyDSIGN c → VKey r c Source #

networkId ∷ Network Source #