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 (EraCrypto era)) (TxOut era)
- pcMUtxo ∷ Reflect era ⇒ Proof era → MUtxo era → PDoc
- data ModelNewEpochState era = ModelNewEpochState {
- mPoolParams ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)))
- mPoolDeposits ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) Coin)
- mRewards ∷ !(Map (Credential 'Staking (EraCrypto era)) Coin)
- mDelegations ∷ !(Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era)))
- mKeyDeposits ∷ !(Map (Credential 'Staking (EraCrypto era)) Coin)
- mUTxO ∷ !(Map (TxIn (EraCrypto era)) (TxOut era))
- mMutFee ∷ !(Map (TxIn (EraCrypto era)) (TxOut era))
- mAccountState ∷ !AccountState
- mPoolDistr ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) (IndividualPoolStake (EraCrypto era)))
- mPParams ∷ !(PParams era)
- mDeposited ∷ !Coin
- mFees ∷ !Coin
- mCount ∷ !Int
- mIndex ∷ !(Map Int (TxId (EraCrypto era)))
- mFPoolParams ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)))
- mRetiring ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) EpochNo)
- mSnapshots ∷ !(SnapShots (EraCrypto era))
- mEL ∷ !EpochNo
- mBprev ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) Natural)
- mBcur ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) Natural)
- mRu ∷ !(StrictMaybe (RewardUpdate (EraCrypto era)))
- type UtxoEntry era = (TxIn (EraCrypto era), TxOut era)
- type Model era = ModelNewEpochState era
- blocksMadeZero ∷ BlocksMade c
- poolDistrZero ∷ PoolDistr c
- accountStateZero ∷ AccountState
- utxoZero ∷ UTxO era
- genDelegsZero ∷ GenDelegs c
- instantaneousRewardsZero ∷ InstantaneousRewards c
- dStateZero ∷ DState c
- pStateZero ∷ PState c
- dPStateZero ∷ CertState era
- incrementalStakeZero ∷ IncrementalStake c
- nonMyopicZero ∷ NonMyopic c
- 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 StandardCrypto)
- testMNES ∷ ModelNewEpochState (BabbageEra StandardCrypto)
- class Extract t era where
- extract ∷ ModelNewEpochState era → t
- makeRewards ∷ ModelNewEpochState era → Map (Credential 'Staking (EraCrypto era)) RDPair
- abstract ∷ EraGov era ⇒ NewEpochState era → ModelNewEpochState era
- complete ∷ PulsingRewUpdate c → RewardUpdate c
- pcModelNewEpochState ∷ Reflect era ⇒ Proof era → ModelNewEpochState era → PDoc
- epochBoundaryPDoc ∷ Proof era → ModelNewEpochState era → [Maybe (Text, PDoc)]
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)
data ModelNewEpochState era Source #
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 (EraCrypto era)) RDPair Source #
abstract ∷ EraGov era ⇒ NewEpochState era → ModelNewEpochState era Source #
complete ∷ PulsingRewUpdate c → RewardUpdate c Source #
pcModelNewEpochState ∷ Reflect era ⇒ Proof era → ModelNewEpochState era → PDoc Source #
epochBoundaryPDoc ∷ Proof era → ModelNewEpochState era → [Maybe (Text, PDoc)] Source #