cardano-ledger-shelley-test
Safe HaskellNone
LanguageHaskell2010

Test.Cardano.Ledger.Shelley.Examples.Combinators

Description

A collection of combinators for manipulating Chain State. The idea is to provide a clear way of describing the changes to the chain state when a block is processed.

Synopsis

Documentation

evolveNonceFrozenNonceChainState era → ChainState era Source #

Evolve Nonces - Frozen

Evolve the appropriate nonces under the assumption that the candidate nonce is now frozen.

evolveNonceUnfrozenNonceChainState era → ChainState era Source #

Evolve Nonces - Unfrozen

Evolve the appropriate nonces under the assumption that the candidate nonce is not frozen. Note: do not use this function when crossing the epoch boundary, instead use newEpoch.

newLabBlock (BHeader MockCrypto) era → ChainState era → ChainState era Source #

New LastAppliedBlock (*NOT* on epoch boundaries)

Update the chain state with the details of LastAppliedBlock that occur when a new block is processed. Note: do not use this function when crossing the epoch boundary, instead use newEpoch.

newUTxO ∷ (EraTx era, EraStake era) ⇒ TxBody 'TopTx era → ChainState era → ChainState era Source #

Update the UTxO

Update the UTxO for given transaction body.

newStakeCred ∷ (EraCertState era, EraGov era, ShelleyEraAccounts era) ⇒ Credential 'StakingPtrChainState era → ChainState era Source #

New Stake Credential

Add a newly registered stake credential.

deregStakeCred ∷ (HasCallStack, EraCertState era, ShelleyEraAccounts era) ⇒ Credential 'StakingChainState era → ChainState era Source #

De-Register Stake Credential

De-register a stake credential and all associated data.

delegationEraCertState era ⇒ Credential 'StakingKeyHash 'StakePoolChainState era → ChainState era Source #

New Delegation

Create a delegation from the given stake credential to the given stake pool.

regPool ∷ (EraCertState era, EraGov era) ⇒ StakePoolParamsChainState era → ChainState era Source #

Register a stake pool.

updatePoolParams ∷ (EraCertState era, EraGov era) ⇒ NetworkStakePoolParamsChainState era → ChainState era Source #

Re-Register Stake Pool

stageRetirementEraCertState era ⇒ KeyHash 'StakePoolEpochNoChainState era → ChainState era Source #

Pool Retirement

Stage a stake pool for retirement.

reapPool ∷ (EraGov era, EraCertState era) ⇒ StakePoolParamsChainState era → ChainState era Source #

Reap Pool

Remove a stake pool.

mirEraCertState era ⇒ Credential 'StakingMIRPotCoinChainState era → ChainState era Source #

MIR

Add a credential to the MIR mapping for the given pot (reserves or treasury)

applyMIREraCertState era ⇒ MIRPotMap (Credential 'Staking) CoinChainState era → ChainState era Source #

Apply MIR

On the epoch boundary, reset the MIR mappings and augment the rewards.

rewardUpdateRewardUpdateChainState era → ChainState era Source #

Reward Update

Update the chain state with the given reward update

pulserUpdatePulsingRewUpdateChainState era → ChainState era Source #

Pulser

Update the chain state with the given reward update pulser

applyRewardUpdate ∷ (EraGov era, EraCertState era) ⇒ RewardUpdateChainState era → ChainState era Source #

Apply a Reward Update

Apply the given reward update to the chain state

setPoolDistrPoolDistrChainState era → ChainState era Source #

Set Pool Distribution

Set the stake pool distribution to the given one.

setOCertCounterKeyHash 'BlockIssuerWord64ChainState era → ChainState era Source #

Set Operation Certificate Counter

Set the operational certificates counter for a given stake pool.

newSnapshotSnapShotCoinChainState era → ChainState era Source #

New Snapshot

Add a new snapshot and rotate the others

incrBlockCountKeyHash 'StakePoolChainState era → ChainState era Source #

Increase Block Count

Record that the given stake pool (non-core node) produced a block.

newEpoch ∷ (AtMostEra "Alonzo" era, EraGov era) ⇒ Block (BHeader MockCrypto) era → ChainState era → ChainState era Source #

New Epoch

Update the new epoch number, set the nonces, set the last applied block, and reset blocks made. Note: This function subsumes the manipulations done by newLab, evolveNonceUnfrozen, and evolveNonceFrozen.

setCurrentProposals ∷ (GovState era ~ ShelleyGovState era, EraPParams era) ⇒ ProposedPPUpdates era → ChainState era → ChainState era Source #

Set Current Proposals

Set the current protocol parameter proposals.

setFutureProposalsGovState era ~ ShelleyGovState era ⇒ ProposedPPUpdates era → ChainState era → ChainState era Source #

Set Future Proposals

Set the future protocol parameter proposals.

setPParamsEraGov era ⇒ PParams era → ChainState era → ChainState era Source #

Set the Protocol Proposals

Set the protocol parameters.

setPrevPParamsEraGov era ⇒ PParams era → ChainState era → ChainState era Source #

Set the Previous Protocol Proposals

Set the previous protocol parameters.

setFutureGenDelegEraCertState era ⇒ (FutureGenDeleg, GenDelegPair) → ChainState era → ChainState era Source #

Set a future genesis delegation.

adoptFutureGenDelegEraCertState era ⇒ (FutureGenDeleg, GenDelegPair) → ChainState era → ChainState era Source #

Set a future genesis delegation.