Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- 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
- irewardSpec ∷ Term fn AccountState → Specification fn (InstantaneousRewards (EraCrypto era))
- hasPtrs ∷ proxy era → Term fn Bool
- correctTxOut ∷ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (TxOut era) → Pred fn
- govStateSpec ∷ PParams era → Specification fn (GovState era)
- newEpochStateSpec ∷ PParams era → Specification fn (NewEpochState era)
- testGovEnv ∷ PParams Conway → GovEnv Conway
- betterTxOutShelley ∷ (EraTxOut era, Value era ~ Coin, IsConwayUniv fn) ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (ShelleyTxOut era) → Pred fn
- betterTxOutMary ∷ (EraTxOut era, Value era ~ MaryValue (EraCrypto era), IsConwayUniv fn) ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (ShelleyTxOut era) → Pred fn
- betterTxOutAlonzo ∷ (AlonzoEraTxOut era, Value era ~ MaryValue (EraCrypto era), IsConwayUniv fn) ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (AlonzoTxOut era) → Pred fn
- betterTxOutBabbage ∷ (EraTxOut era, Value era ~ MaryValue (EraCrypto era), IsNormalType (Script era), HasSpec fn (Script era), IsConwayUniv fn) ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (BabbageTxOut era) → Pred fn
- delegatedStakeReference ∷ (IsConwayUniv fn, Crypto c) ⇒ Term fn (Map (Credential 'Staking c) (KeyHash 'StakePool c)) → Specification fn (StakeReference c)
- 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
- canFollow ∷ IsConwayUniv fn ⇒ Term fn ProtVer → Term fn ProtVer → Pred fn
- protVersCanfollow ∷ Specification ConwayFn (ProtVer, ProtVer)
- instantaneousRewardsSpec ∷ ∀ c fn. (IsConwayUniv fn, Crypto c) ⇒ Term fn AccountState → Specification fn (InstantaneousRewards c)
- drepStateSpec ∷ (IsConwayUniv fn, Crypto c) ⇒ Term fn EpochNo → Specification fn (DRepState c)
- vstateSpec ∷ (IsConwayUniv fn, Era era) ⇒ Term fn EpochNo → Specification fn (VState era)
- dstateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ Term fn AccountState → Term fn (Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era))) → Specification fn (DState era)
- epochNoSpec ∷ IsConwayUniv fn ⇒ Specification fn EpochNo
- pstateSpec ∷ (IsConwayUniv fn, Era era) ⇒ Term fn EpochNo → Specification fn (PState era)
- accountStateSpec ∷ IsConwayUniv fn ⇒ Specification fn AccountState
- certStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ Term fn AccountState → Term fn EpochNo → Specification fn (CertState era)
- utxoSpec ∷ ∀ era fn. LedgerEra era fn ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Specification fn (UTxO era)
- utxoStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Term fn (CertState era) → Specification fn (UTxOState era)
- getDelegs ∷ ∀ era. CertState era → Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))
- shelleyGovStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Specification fn (ShelleyGovState era)
- govEnvSpec ∷ IsConwayUniv fn ⇒ PParams Conway → Specification fn (GovEnv Conway)
- conwayGovStateSpec ∷ ∀ fn. LedgerEra Conway fn ⇒ PParams Conway → GovEnv Conway → Specification fn (ConwayGovState Conway)
- ledgerStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Term fn AccountState → Term fn EpochNo → Specification fn (LedgerState era)
- snapShotSpec ∷ (Crypto c, IsConwayUniv fn) ⇒ Specification fn (SnapShot c)
- snapShotsSpec ∷ (Crypto c, IsConwayUniv fn) ⇒ Term fn (SnapShot c) → Specification fn (SnapShots c)
- getMarkSnapShot ∷ ∀ era. LedgerState era → SnapShot (EraCrypto era)
- epochStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Term fn EpochNo → Specification fn (EpochState era)
- getPoolDistr ∷ ∀ era. EpochState era → PoolDistr (EraCrypto era)
- newEpochStateSpecUTxO ∷ ∀ era fn. (LedgerEra era fn, StashedAVVMAddresses era ~ UTxO era) ⇒ PParams era → Specification fn (NewEpochState era)
- newEpochStateSpecUnit ∷ ∀ era fn. (LedgerEra era fn, StashedAVVMAddresses era ~ ()) ⇒ PParams era → Specification fn (NewEpochState era)
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.
irewardSpec ∷ Term fn AccountState → Specification fn (InstantaneousRewards (EraCrypto era)) Source #
hasPtrs ∷ proxy era → Term fn Bool Source #
correctTxOut ∷ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (TxOut era) → Pred fn Source #
govStateSpec ∷ PParams era → Specification fn (GovState era) Source #
newEpochStateSpec ∷ PParams era → Specification fn (NewEpochState era) Source #
Instances
betterTxOutShelley ∷ (EraTxOut era, Value era ~ Coin, IsConwayUniv fn) ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (ShelleyTxOut era) → Pred fn Source #
betterTxOutMary ∷ (EraTxOut era, Value era ~ MaryValue (EraCrypto era), IsConwayUniv fn) ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (ShelleyTxOut era) → Pred fn Source #
betterTxOutAlonzo ∷ (AlonzoEraTxOut era, Value era ~ MaryValue (EraCrypto era), IsConwayUniv fn) ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (AlonzoTxOut era) → Pred fn Source #
betterTxOutBabbage ∷ (EraTxOut era, Value era ~ MaryValue (EraCrypto era), IsNormalType (Script era), HasSpec fn (Script era), IsConwayUniv fn) ⇒ Term fn (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))) → Term fn (BabbageTxOut era) → Pred fn Source #
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.
canFollow ∷ IsConwayUniv fn ⇒ Term fn ProtVer → Term fn ProtVer → Pred fn Source #
The constraint for ProtVer always relates one ProtVer to another one that can follow it.
instantaneousRewardsSpec ∷ ∀ c fn. (IsConwayUniv fn, Crypto c) ⇒ Term fn AccountState → Specification fn (InstantaneousRewards c) Source #
drepStateSpec ∷ (IsConwayUniv fn, Crypto c) ⇒ Term fn EpochNo → Specification fn (DRepState c) Source #
vstateSpec ∷ (IsConwayUniv fn, Era era) ⇒ Term fn EpochNo → Specification fn (VState era) Source #
dstateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ Term fn AccountState → Term fn (Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era))) → Specification fn (DState era) Source #
epochNoSpec ∷ IsConwayUniv fn ⇒ Specification fn EpochNo Source #
pstateSpec ∷ (IsConwayUniv fn, Era era) ⇒ Term fn EpochNo → Specification fn (PState era) Source #
accountStateSpec ∷ IsConwayUniv fn ⇒ Specification fn AccountState Source #
certStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ Term fn AccountState → Term fn EpochNo → Specification 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 #
getDelegs ∷ ∀ era. CertState era → Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era)) Source #
shelleyGovStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Specification fn (ShelleyGovState era) Source #
govEnvSpec ∷ IsConwayUniv fn ⇒ PParams Conway → Specification fn (GovEnv Conway) Source #
conwayGovStateSpec ∷ ∀ fn. LedgerEra Conway fn ⇒ PParams Conway → GovEnv Conway → Specification fn (ConwayGovState Conway) Source #
ledgerStateSpec ∷ ∀ era fn. LedgerEra era fn ⇒ PParams era → Term fn AccountState → Term fn EpochNo → Specification fn (LedgerState era) Source #
snapShotSpec ∷ (Crypto c, IsConwayUniv fn) ⇒ Specification fn (SnapShot c) Source #
snapShotsSpec ∷ (Crypto c, IsConwayUniv fn) ⇒ Term fn (SnapShot c) → Specification fn (SnapShots c) 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 EpochNo → Specification 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
IsConwayUniv fn ⇒ NumLike fn EpochNo Source # | |
subtractSpec ∷ EpochNo → TypeSpec fn EpochNo → Specification fn EpochNo Source # negateSpec ∷ TypeSpec fn EpochNo → Specification fn EpochNo Source # |