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 (EraCrypto era)) (TxOut era) Source #

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

pcMUtxoReflect era ⇒ Proof era → MUtxo era → PDoc Source #

data ModelNewEpochState era Source #

Instances

Instances details
Reflect era ⇒ Show (ModelNewEpochState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Reflect era ⇒ PrettyA (ModelNewEpochState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

type UtxoEntry era = (TxIn (EraCrypto era), 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 (CertState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

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 #

Extract (VState era) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.ModelState

Methods

extractModelNewEpochState era → VState 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