Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- type MUtxo era = Map TxIn (TxOut era)
- pcMUtxo ∷ Reflect era ⇒ Proof era → MUtxo era → PDoc
- data ModelNewEpochState era = ModelNewEpochState {
- mPoolParams ∷ !(Map (KeyHash 'StakePool) PoolParams)
- mPoolDeposits ∷ !(Map (KeyHash 'StakePool) Coin)
- mRewards ∷ !(Map (Credential 'Staking) Coin)
- mDelegations ∷ !(Map (Credential 'Staking) (KeyHash 'StakePool))
- mKeyDeposits ∷ !(Map (Credential 'Staking) Coin)
- mUTxO ∷ !(Map TxIn (TxOut era))
- mMutFee ∷ !(Map TxIn (TxOut era))
- mAccountState ∷ !AccountState
- mPoolDistr ∷ !(Map (KeyHash 'StakePool) IndividualPoolStake)
- mPParams ∷ !(PParams era)
- mDeposited ∷ !Coin
- mFees ∷ !Coin
- mCount ∷ !Int
- mIndex ∷ !(Map Int TxId)
- mFPoolParams ∷ !(Map (KeyHash 'StakePool) PoolParams)
- mRetiring ∷ !(Map (KeyHash 'StakePool) EpochNo)
- mSnapshots ∷ !SnapShots
- mEL ∷ !EpochNo
- mBprev ∷ !(Map (KeyHash 'StakePool) Natural)
- mBcur ∷ !(Map (KeyHash 'StakePool) Natural)
- mRu ∷ !(StrictMaybe RewardUpdate)
- type UtxoEntry era = (TxIn, TxOut era)
- type Model era = ModelNewEpochState era
- blocksMadeZero ∷ BlocksMade
- poolDistrZero ∷ PoolDistr
- accountStateZero ∷ AccountState
- utxoZero ∷ UTxO era
- genDelegsZero ∷ GenDelegs
- instantaneousRewardsZero ∷ InstantaneousRewards
- dStateZero ∷ DState c
- pStateZero ∷ PState c
- dPStateZero ∷ CertState era
- incrementalStakeZero ∷ IncrementalStake
- nonMyopicZero ∷ NonMyopic
- pParamsZeroByProof ∷ Proof era → PParams era
- uTxOStateZero ∷ ∀ era. Reflect era ⇒ UTxOState era
- pParamsZero ∷ Reflect era ⇒ PParams era
- ledgerStateZero ∷ ∀ era. Reflect era ⇒ LedgerState era
- epochStateZero ∷ Reflect era ⇒ EpochState era
- newEpochStateZero ∷ ∀ era. Reflect era ⇒ NewEpochState era
- stashedAVVMAddressesZero ∷ Proof era → StashedAVVMAddresses era
- mNewEpochStateZero ∷ Reflect era ⇒ ModelNewEpochState era
- testNES ∷ NewEpochState BabbageEra
- testMNES ∷ ModelNewEpochState BabbageEra
- class Extract t era where
- extract ∷ ModelNewEpochState era → t
- makeRewards ∷ ModelNewEpochState era → Map (Credential 'Staking) RDPair
- abstract ∷ EraGov era ⇒ NewEpochState era → ModelNewEpochState era
- complete ∷ PulsingRewUpdate → RewardUpdate
- pcModelNewEpochState ∷ Reflect era ⇒ Proof era → ModelNewEpochState era → PDoc
- epochBoundaryPDoc ∷ Proof era → ModelNewEpochState era → [Maybe (Text, PDoc)]
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 #
ModelNewEpochState | |
|
Instances
Reflect era ⇒ Show (ModelNewEpochState era) Source # | |
Defined in Test.Cardano.Ledger.Generic.ModelState | |
Reflect era ⇒ PrettyA (ModelNewEpochState era) Source # | |
Defined in Test.Cardano.Ledger.Generic.ModelState prettyA ∷ ModelNewEpochState era → PDoc Source # |
type Model era = ModelNewEpochState era Source #
dStateZero ∷ DState c Source #
pStateZero ∷ PState c Source #
dPStateZero ∷ CertState era Source #
pParamsZeroByProof ∷ Proof era → PParams era Source #
uTxOStateZero ∷ ∀ era. Reflect era ⇒ UTxOState era Source #
pParamsZero ∷ Reflect era ⇒ PParams era Source #
ledgerStateZero ∷ ∀ era. Reflect era ⇒ LedgerState era Source #
epochStateZero ∷ Reflect era ⇒ EpochState era Source #
newEpochStateZero ∷ ∀ era. Reflect era ⇒ NewEpochState era Source #
stashedAVVMAddressesZero ∷ Proof era → StashedAVVMAddresses era Source #
mNewEpochStateZero ∷ Reflect era ⇒ ModelNewEpochState era Source #
class Extract t era where Source #
extract ∷ ModelNewEpochState era → t Source #
Instances
makeRewards ∷ ModelNewEpochState era → Map (Credential 'Staking) RDPair Source #
abstract ∷ EraGov era ⇒ NewEpochState era → ModelNewEpochState era Source #
pcModelNewEpochState ∷ Reflect era ⇒ Proof era → ModelNewEpochState era → PDoc Source #
epochBoundaryPDoc ∷ Proof era → ModelNewEpochState era → [Maybe (Text, PDoc)] Source #