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 (EraSpecTxOut era, EraStake era, HasSpec (GovState era), HasSpec (CertState era), IsNormalType (CertState era), EraCertState era) ⇒ EraSpecLedger era where Source #

The class (EraSpecLedger era) supports Era parametric Specs over types that appear in the Cardano Ledger It uses methods (see Test.Cardano.Ledger.Constrained.Conway.ParametricSpec) 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 EraSpecLedger class has methods that asbtract over those changes.

Instances

Instances details
EraSpecLedger AllegraEra Source # 
Instance details

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

EraSpecLedger AlonzoEra Source # 
Instance details

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

EraSpecLedger BabbageEra Source # 
Instance details

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

EraSpecLedger ConwayEra Source # 
Instance details

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

EraSpecLedger MaryEra Source # 
Instance details

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

EraSpecLedger ShelleyEra Source # 
Instance details

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

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

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

canFollowTerm ProtVerTerm ProtVerPred Source #

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

vstateSpec ∷ ∀ era. Era era ⇒ WitUniv era → Term EpochNoTerm (Map (Credential 'DRepRole) (Set (Credential 'Staking))) → Specification (VState era) Source #

BE SURE the parameter delegated :: Term (Map (Credential 'DRepRole c) (Set (Credential 'Staking c)) has been witnessed with the same WitUniv as the parameter univ, or this will fail For a standalone test of vstateSpec one may use goodDrep above, and pass eraUniv as the actual parameter for the formal parameter univ Note, that in certStateSpec, the call to vstateSpec is passed a witnessed delegated that comes from the dstateSpec.

aggregateDRepMap (Credential 'Staking) DRepMap (Credential 'DRepRole) (Set (Credential 'Staking)) Source #

Compute the map of DReps, to those that delegate to them, from the delegation map (Map (Credential 'Staking) Drep) which is stored in the DState This ensures that every staking Credential, delegates to exactly one DRep.

pstateSpecEra era ⇒ WitUniv era → Term EpochNoSpecification (PState era) Source #

shelleyCertStateSpec ∷ ∀ era. EraSpecLedger era ⇒ WitUniv era → Term ChainAccountStateTerm EpochNoSpecification (ShelleyCertState era) Source #

The CertState spec Note, that in order to be self consistent, parts of the pState is passed as an argument the spec for DState spec (every stake delegation is to a registered pool) and parts of the DState are passed as an argument to the spec for VState (every voting delegation is to a registered DRep)

utxoStateSpec ∷ ∀ era. (EraSpecLedger era, HasSpec (InstantStake era)) ⇒ PParams era → WitUniv era → Term (CertState era) → Specification (UTxOState era) Source #

getMarkSnapShot ∷ ∀ era. (EraCertState era, EraStake era) ⇒ LedgerState era → SnapShot Source #

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

newEpochStateSpecUTxO ∷ ∀ era. (EraSpecLedger era, HasSpec (InstantStake era), StashedAVVMAddresses era ~ UTxO era) ⇒ PParams era → WitUniv era → Specification (NewEpochState era) Source #

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

newEpochStateSpecUnit ∷ ∀ era. (EraSpecLedger era, HasSpec (InstantStake era), StashedAVVMAddresses era ~ ()) ⇒ PParams era → WitUniv era → Specification (NewEpochState era) Source #

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