Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- evolveNonceFrozen ∷ ∀ era. Nonce → ChainState era → ChainState era
- evolveNonceUnfrozen ∷ ∀ era. Nonce → ChainState era → ChainState era
- newLab ∷ ∀ era. Block (BHeader MockCrypto) era → ChainState era → ChainState era
- feesAndKeyRefund ∷ ∀ era. Coin → Credential 'Staking → ChainState era → ChainState era
- feesAndDeposits ∷ ∀ era. EraPParams era ⇒ PParams era → Coin → [Credential 'Staking] → [PoolParams] → ChainState era → ChainState era
- newUTxO ∷ ∀ era. (EraTx era, EraGov era) ⇒ TxBody era → ChainState era → ChainState era
- newStakeCred ∷ ∀ era. Credential 'Staking → Ptr → ChainState era → ChainState era
- deregStakeCred ∷ ∀ era. Credential 'Staking → ChainState era → ChainState era
- delegation ∷ ∀ era. Credential 'Staking → KeyHash 'StakePool → ChainState era → ChainState era
- newPool ∷ ∀ era. PoolParams → ChainState era → ChainState era
- reregPool ∷ ∀ era. PoolParams → ChainState era → ChainState era
- updatePoolParams ∷ ∀ era. PoolParams → ChainState era → ChainState era
- stageRetirement ∷ ∀ era. KeyHash 'StakePool → EpochNo → ChainState era → ChainState era
- reapPool ∷ ∀ era. EraGov era ⇒ PoolParams → ChainState era → ChainState era
- mir ∷ ∀ era. Credential 'Staking → MIRPot → Coin → ChainState era → ChainState era
- applyMIR ∷ ∀ era. MIRPot → Map (Credential 'Staking) Coin → ChainState era → ChainState era
- rewardUpdate ∷ ∀ era. RewardUpdate → ChainState era → ChainState era
- pulserUpdate ∷ ∀ era. PulsingRewUpdate → ChainState era → ChainState era
- applyRewardUpdate ∷ ∀ era. EraGov era ⇒ RewardUpdate → ChainState era → ChainState era
- setPoolDistr ∷ ∀ era. PoolDistr → ChainState era → ChainState era
- setOCertCounter ∷ ∀ era. KeyHash 'BlockIssuer → Word64 → ChainState era → ChainState era
- newSnapshot ∷ ∀ era. SnapShot → Coin → ChainState era → ChainState era
- incrBlockCount ∷ ∀ era. KeyHash 'StakePool → ChainState era → ChainState era
- newEpoch ∷ ∀ era. (ProtVerAtMost era 6, EraGov era) ⇒ Block (BHeader MockCrypto) era → ChainState era → ChainState era
- setCurrentProposals ∷ ∀ era. (GovState era ~ ShelleyGovState era, EraPParams era) ⇒ ProposedPPUpdates era → ChainState era → ChainState era
- setFutureProposals ∷ ∀ era. GovState era ~ ShelleyGovState era ⇒ ProposedPPUpdates era → ChainState era → ChainState era
- solidifyProposals ∷ ∀ era. EraGov era ⇒ ChainState era → ChainState era
- setPParams ∷ ∀ era. EraGov era ⇒ PParams era → ChainState era → ChainState era
- setPrevPParams ∷ ∀ era. EraGov era ⇒ PParams era → ChainState era → ChainState era
- setFutureGenDeleg ∷ ∀ era. (FutureGenDeleg, GenDelegPair) → ChainState era → ChainState era
- adoptFutureGenDeleg ∷ ∀ era. (FutureGenDeleg, GenDelegPair) → ChainState era → ChainState era
Documentation
evolveNonceFrozen ∷ ∀ era. Nonce → ChainState era → ChainState era Source #
Evolve Nonces - Frozen
Evolve the appropriate nonces under the assumption that the candidate nonce is now frozen.
evolveNonceUnfrozen ∷ ∀ era. Nonce → ChainState 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
.
newLab ∷ ∀ era. Block (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
.
feesAndKeyRefund ∷ ∀ era. Coin → Credential 'Staking → ChainState era → ChainState era Source #
feesAndDeposits ∷ ∀ era. EraPParams era ⇒ PParams era → Coin → [Credential 'Staking] → [PoolParams] → ChainState era → ChainState era Source #
Update Fees and Deposits
Update the fee pot and deposit pot with the new fees and deposits
adjust the deposit tables in the UTxOState and the CertState.
Notes
1) do not give this function duplicates in the stakes
or pools
inputs.
2) do not use this function when crossing the epoch boundary,
instead use newEpoch
.
newUTxO ∷ ∀ era. (EraTx era, EraGov era) ⇒ TxBody era → ChainState era → ChainState era Source #
Update the UTxO
Update the UTxO for given transaction body.
newStakeCred ∷ ∀ era. Credential 'Staking → Ptr → ChainState era → ChainState era Source #
New Stake Credential
Add a newly registered stake credential, initialize the rdRewards component of the RDPair.
The rdDeposit component of the RDPair is set by feesAndDeposits
deregStakeCred ∷ ∀ era. Credential 'Staking → ChainState era → ChainState era Source #
De-Register Stake Credential
De-register a stake credential and all associated data.
Be sure to run feesAndKeyRefund
before you run this
because this throws away the stored refund, which then
can't be used to balance the utxosDeposited field in feesAndKeyRefund
delegation ∷ ∀ era. Credential 'Staking → KeyHash 'StakePool → ChainState era → ChainState era Source #
New Delegation
Create a delegation from the given stake credential to the given stake pool.
newPool ∷ ∀ era. PoolParams → ChainState era → ChainState era Source #
New Stake Pool
Add a newly registered stake pool
reregPool ∷ ∀ era. PoolParams → ChainState era → ChainState era Source #
Re-Register Stake Pool
updatePoolParams ∷ ∀ era. PoolParams → ChainState era → ChainState era Source #
Re-Register Stake Pool
stageRetirement ∷ ∀ era. KeyHash 'StakePool → EpochNo → ChainState era → ChainState era Source #
Pool Retirement
Stage a stake pool for retirement.
reapPool ∷ ∀ era. EraGov era ⇒ PoolParams → ChainState era → ChainState era Source #
Reap Pool
Remove a stake pool.
mir ∷ ∀ era. Credential 'Staking → MIRPot → Coin → ChainState era → ChainState era Source #
MIR
Add a credential to the MIR mapping for the given pot (reserves or treasury)
applyMIR ∷ ∀ era. MIRPot → Map (Credential 'Staking) Coin → ChainState era → ChainState era Source #
Apply MIR
On the epoch boundary, reset the MIR mappings and augment the rewards.
rewardUpdate ∷ ∀ era. RewardUpdate → ChainState era → ChainState era Source #
Reward Update
Update the chain state with the given reward update
pulserUpdate ∷ ∀ era. PulsingRewUpdate → ChainState era → ChainState era Source #
Pulser
Update the chain state with the given reward update pulser
applyRewardUpdate ∷ ∀ era. EraGov era ⇒ RewardUpdate → ChainState era → ChainState era Source #
Apply a Reward Update
Apply the given reward update to the chain state
setPoolDistr ∷ ∀ era. PoolDistr → ChainState era → ChainState era Source #
Set Pool Distribution
Set the stake pool distribution to the given one.
setOCertCounter ∷ ∀ era. KeyHash 'BlockIssuer → Word64 → ChainState era → ChainState era Source #
Set Operation Certificate Counter
Set the operational certificates counter for a given stake pool.
newSnapshot ∷ ∀ era. SnapShot → Coin → ChainState era → ChainState era Source #
New Snapshot
Add a new snapshot and rotate the others
incrBlockCount ∷ ∀ era. KeyHash 'StakePool → ChainState era → ChainState era Source #
Increase Block Count
Record that the given stake pool (non-core node) produced a block.
newEpoch ∷ ∀ era. (ProtVerAtMost era 6, 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 ∷ ∀ era. (GovState era ~ ShelleyGovState era, EraPParams era) ⇒ ProposedPPUpdates era → ChainState era → ChainState era Source #
Set Current Proposals
Set the current protocol parameter proposals.
setFutureProposals ∷ ∀ era. GovState era ~ ShelleyGovState era ⇒ ProposedPPUpdates era → ChainState era → ChainState era Source #
Set Future Proposals
Set the future protocol parameter proposals.
solidifyProposals ∷ ∀ era. EraGov era ⇒ ChainState era → ChainState era Source #
setPParams ∷ ∀ era. EraGov era ⇒ PParams era → ChainState era → ChainState era Source #
Set the Protocol Proposals
Set the protocol parameters.
setPrevPParams ∷ ∀ era. EraGov era ⇒ PParams era → ChainState era → ChainState era Source #
Set the Previous Protocol Proposals
Set the previous protocol parameters.
setFutureGenDeleg ∷ ∀ era. (FutureGenDeleg, GenDelegPair) → ChainState era → ChainState era Source #
Set a future genesis delegation.
adoptFutureGenDeleg ∷ ∀ era. (FutureGenDeleg, GenDelegPair) → ChainState era → ChainState era Source #