cardano-ledger-test-9.9.9.9: Testing harness, tests and benchmarks for Shelley style cardano ledgers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.Specs

Description

Specs necessary to generate constrained (well formed) values of types that appear in the Cardano Ledger Types. These Specifications are Era parametric, and one can use them to generate well formed values in any era (Shelley,Allegra,Mary,Alonzo,Babbage,Conway) by type applying them to a particular era type. These specifications are a usefull guide to building ones own specifications with one's own idea of whats well formed.

Synopsis

Documentation

class (HasSpec fn (TxOut era), IsNormalType (TxOut era), HasSpec fn (GovState era), HasSpec fn (StashedAVVMAddresses era), EraTxOut era, IsConwayUniv fn, EraPP era) ⇒ LedgerEra era fn where Source #

The class (LedgerEra era) supports Era parametric Specs. It contains methods that navigate the differences in types parameterized by era that are embeded as type Families in types that appear in the Cardano Ledger Types. It is these components that change from one Era to another. and the LedgerEra class has methods that asbtract over those changes.

The class (EraPP era) (Defined in ‘Test.Cardano.Ledger.Constrained.Conway.SimplePParams’) supports specifications over the Era parametric (PParams era) in every era. The method correctTxOut supports specifcations over type Family TxOut in every era. The method govStateSpec supports specifcations over type Family GovState in every era. And additional ones for phased out Type Families like InstantaneousRewards, StashedAVVMAddresses, and Ptrs Instances for every Era are supplied.

Instances

Instances details
IsConwayUniv fn ⇒ LedgerEra Allegra fn Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.Specs

IsConwayUniv fn ⇒ LedgerEra Alonzo fn Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.Specs

IsConwayUniv fn ⇒ LedgerEra Babbage fn Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.Specs

IsConwayUniv fn ⇒ LedgerEra Conway fn Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.Specs

IsConwayUniv fn ⇒ LedgerEra Mary fn Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.Specs

IsConwayUniv fn ⇒ LedgerEra Shelley fn Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.Specs

delegatedStakeReference ∷ (IsConwayUniv fn, Crypto c) ⇒ Term fn (Map (Credential 'Staking c) (KeyHash 'StakePool c)) → Specification fn (StakeReference c) Source #

Generate random Stake references that have a high probability of being delegated.

domEqualRng ∷ (IsConwayUniv fn, Ord ptr, Ord cred, HasSpec fn cred, HasSpec fn ptr, HasSpec fn ume) ⇒ Term fn (Map ptr cred) → Term fn (Map cred ume) → Pred fn Source #

Want (Rng v3) == (Dom v0), except the Rng is List and the Dom is a Set.

canFollowIsConwayUniv fn ⇒ Term fn ProtVerTerm fn ProtVerPred fn Source #

The constraint for ProtVer always relates one ProtVer to another one that can follow it.

vstateSpec ∷ (IsConwayUniv fn, Era era) ⇒ Term fn EpochNoSpecification fn (VState era) Source #

dstateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ Term fn AccountStateTerm fn (Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era))) → Term fn (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era))) → Specification fn (DState era) Source #

pstateSpec ∷ (IsConwayUniv fn, Era era) ⇒ Term fn EpochNoSpecification fn (PState era) Source #

certStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ Term fn AccountStateTerm fn EpochNoSpecification fn (CertState era) Source #

utxoSpec ∷ ∀ era fn. LedgerEra era fn ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Specification fn (UTxO era) Source #

utxoStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Term fn (CertState era) → Specification fn (UTxOState era) Source #

shelleyGovStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Specification fn (ShelleyGovState era) Source #

ledgerStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Term fn AccountStateTerm fn EpochNoSpecification fn (LedgerState era) Source #

getMarkSnapShot ∷ ∀ era. LedgerState era → SnapShot (EraCrypto era) Source #

The Mark SnapShot (at the epochboundary) is a pure function of the LedgerState

epochStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Term fn EpochNoSpecification fn (EpochState era) Source #

getPoolDistr ∷ ∀ era. EpochState era → PoolDistr (EraCrypto era) Source #

newEpochStateSpecUTxO ∷ ∀ era fn. (LedgerEra era fn, StashedAVVMAddresses era ~ UTxO era) ⇒ PParams era → Specification fn (NewEpochState era) Source #

Used for Eras where StashedAVVMAddresses era ~ UTxO era (Shelley) The newEpochStateSpec method (of (LedgerEra era fn) class) in the Shelley instance

newEpochStateSpecUnit ∷ ∀ era fn. (LedgerEra era fn, StashedAVVMAddresses era ~ ()) ⇒ PParams era → Specification fn (NewEpochState era) Source #

Used for Eras where StashedAVVMAddresses era ~ () (Allegra,Mary,Alonzo,Babbage,Conway) The newEpochStateSpec method (of (LedgerEra era fn) class) in the instances for (Allegra,Mary,Alonzo,Babbage,Conway)

Orphan instances