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

Test.Cardano.Ledger.Generic.ModelState

Description

The data types in this file constitute a Model of the NewEpochState sufficient for generating transactions that can run in the MockChain STS instance. This is a model so we drop some details of the real NewEpochState, and add some additional details specific to Tx generation. Dropped details include 1) Efficiency concerns a) Pulsing Reward updates b) Inverse of the Rewards Map c) esNonMyopic field d) _stakeDistro, Incremental Stake distribution 2) Transaction features that make changes to the Protocol Parameters 3) Using Hashes of the TxBody as the Ix, instead we maintain an index of an arbitrary Hash to the sequence (Count) in which the TxBody was generated. Additional details 1) Utxo entries to pay fees. It is incredibly hard to generate Txs with the correct fees. So we keep a small set of UtxoEntrys, where it is allowed to mutate the value field of the TxOut. We have to be sure these entries are carefully managed, as they do not follow the rules of the real world. Additional comments 1) We include data in the Model for Epoch boundary computations, but we do not do anything with them at this time.

Synopsis

Documentation

type MUtxo era = Map TxIn (TxOut era) Source #

MUtxo = Model UTxO. In the Model we represent the UTxO as a Map (not a newtype around a Map)

data ModelNewEpochState era Source #

Instances

Instances details
Generic (ModelNewEpochState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Associated Types

type Rep (ModelNewEpochState era) ∷ TypeType #

(Reflect era, ShelleyEraTest era) ⇒ Show (ModelNewEpochState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

ShelleyEraTest era ⇒ ToExpr (ModelNewEpochState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

type Rep (ModelNewEpochState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

type Rep (ModelNewEpochState era) = D1 ('MetaData "ModelNewEpochState" "Test.Cardano.Ledger.Generic.ModelState" "cardano-ledger-test-9.9.9.9-inplace" 'False) (C1 ('MetaCons "ModelNewEpochState" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "mPoolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) PoolParams)) :*: S1 ('MetaSel ('Just "mPoolDeposits") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) Coin))) :*: (S1 ('MetaSel ('Just "mRewards") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) Coin)) :*: (S1 ('MetaSel ('Just "mDelegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) (KeyHash 'StakePool))) :*: S1 ('MetaSel ('Just "mKeyDeposits") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) Coin))))) :*: ((S1 ('MetaSel ('Just "mUTxO") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map TxIn (TxOut era))) :*: S1 ('MetaSel ('Just "mMutFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map TxIn (TxOut era)))) :*: (S1 ('MetaSel ('Just "mChainAccountState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainAccountState) :*: (S1 ('MetaSel ('Just "mPoolDistr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) IndividualPoolStake)) :*: S1 ('MetaSel ('Just "mPParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era)))))) :*: (((S1 ('MetaSel ('Just "mDeposited") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "mFees") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "mCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "mIndex") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Int TxId)) :*: S1 ('MetaSel ('Just "mFPoolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) PoolParams))))) :*: ((S1 ('MetaSel ('Just "mRetiring") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) EpochNo)) :*: (S1 ('MetaSel ('Just "mSnapshots") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SnapShots) :*: S1 ('MetaSel ('Just "mEL") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo))) :*: (S1 ('MetaSel ('Just "mBprev") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) Natural)) :*: (S1 ('MetaSel ('Just "mBcur") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) Natural)) :*: S1 ('MetaSel ('Just "mRu") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe RewardUpdate))))))))

type UtxoEntry era = (TxIn, TxOut era) Source #

uTxOStateZero ∷ ∀ era. Reflect era ⇒ UTxOState era Source #

ledgerStateZero ∷ ∀ era. Reflect era ⇒ LedgerState era Source #

class Extract t era where Source #

Methods

extractModelNewEpochState era → t Source #

Instances

Instances details
Extract (VState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Methods

extractModelNewEpochState era → VState era Source #

Extract (DState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Methods

extractModelNewEpochState era → DState era Source #

Extract (PState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Methods

extractModelNewEpochState era → PState era Source #

Reflect era ⇒ Extract (EpochState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Reflect era ⇒ Extract (LedgerState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Reflect era ⇒ Extract (NewEpochState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Reflect era ⇒ Extract (UTxOState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

extractCertState ∷ ∀ era. Reflect era ⇒ ModelNewEpochState era → CertState era Source #