cardano-ledger-shelley-test-1.7.0.0: Test helpers from cardano-ledger-shelley exposed to other packages
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Shelley.Rules.IncrementalStake

Synopsis

Documentation

incrStakeComputationTest ∷ ∀ era. (EraGen era, EraStake era, ShelleyEraAccounts era, InstantStake era ~ ShelleyInstantStake era, ChainProperty era, HasTrace (CHAIN era) (GenEnv MockCrypto era), Environment (EraRule "LEDGER" era) ~ LedgerEnv era, BaseM (EraRule "LEDGER" era) ~ ReaderT Globals Identity, STS (EraRule "LEDGER" era), Signal (EraRule "LEDGER" era) ~ Tx era, State (EraRule "LEDGER" era) ~ LedgerState era) ⇒ TestTree Source #

stakeDistr ∷ ∀ era. (EraTxOut era, ShelleyEraAccounts era) ⇒ UTxO era → DState era → PState era → SnapShot Source #

Compute the current Stake Distribution. This was called at the Epoch boundary in the Snap Rule. Now it is called in the tests to see that its incremental analog incrementalStakeDistr agrees.

aggregateUtxoCoinByCredential ∷ ∀ era. EraTxOut era ⇒ Map Ptr (Credential 'Staking) → UTxO era → Map (Credential 'Staking) (CompactForm Coin) → Map (Credential 'Staking) (CompactForm Coin) Source #

Sum up all the Coin for each staking Credential. This function has an incremental analog. See incrementalAggregateUtxoCoinByCredential