Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Interface to the block validation and chain extension logic in the Shelley API.
Documentation
class (STS (EraRule "TICK" era), BaseM (EraRule "TICK" era) ~ ShelleyBase, Environment (EraRule "TICK" era) ~ (), State (EraRule "TICK" era) ~ NewEpochState era, Signal (EraRule "TICK" era) ~ SlotNo, STS (EraRule "BBODY" era), BaseM (EraRule "BBODY" era) ~ ShelleyBase, Environment (EraRule "BBODY" era) ~ BbodyEnv era, State (EraRule "BBODY" era) ~ ShelleyBbodyState era, Signal (EraRule "BBODY" era) ~ Block (BHeaderView (EraCrypto era)) era, EncCBORGroup (TxSeq era), State (EraRule "LEDGERS" era) ~ LedgerState era) ⇒ ApplyBlock era where Source #
Nothing
applyTickOpts ∷ ApplySTSOpts ep → Globals → NewEpochState era → SlotNo → EventReturnType ep (EraRule "TICK" era) (NewEpochState era) Source #
Apply the header level ledger transition.
This handles checks and updates that happen on a slot tick, as well as a few header level checks, such as size constraints.
applyBlockOpts ∷ ∀ ep m. (EventReturnTypeRep ep, MonadError (BlockTransitionError era) m) ⇒ ApplySTSOpts ep → Globals → NewEpochState era → Block (BHeaderView (EraCrypto era)) era → m (EventReturnType ep (EraRule "BBODY" era) (NewEpochState era)) Source #
Apply the block level ledger transition.
default applyBlockOpts ∷ ∀ ep m. (EventReturnTypeRep ep, MonadError (BlockTransitionError era) m, EraGov era) ⇒ ApplySTSOpts ep → Globals → NewEpochState era → Block (BHeaderView (EraCrypto era)) era → m (EventReturnType ep (EraRule "BBODY" era) (NewEpochState era)) Source #
reapplyBlock ∷ Globals → NewEpochState era → Block (BHeaderView (EraCrypto era)) era → NewEpochState era Source #
Re-apply a ledger block to the same state it has been applied to before.
This function does no validation of whether the block applies successfully;
the caller implicitly guarantees that they have previously called
applyBlockTransition
on the same block and that this was successful.
default reapplyBlock ∷ EraGov era ⇒ Globals → NewEpochState era → Block (BHeaderView (EraCrypto era)) era → NewEpochState era Source #
Instances
(Crypto c, DSignable c (Hash c EraIndependentTxBody)) ⇒ ApplyBlock (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.API.Validation applyTickOpts ∷ ∀ (ep ∷ EventPolicy). ApplySTSOpts ep → Globals → NewEpochState (ShelleyEra c) → SlotNo → EventReturnType ep (EraRule "TICK" (ShelleyEra c)) (NewEpochState (ShelleyEra c)) Source # applyBlockOpts ∷ ∀ (ep ∷ EventPolicy) m. (EventReturnTypeRep ep, MonadError (BlockTransitionError (ShelleyEra c)) m) ⇒ ApplySTSOpts ep → Globals → NewEpochState (ShelleyEra c) → Block (BHeaderView (EraCrypto (ShelleyEra c))) (ShelleyEra c) → m (EventReturnType ep (EraRule "BBODY" (ShelleyEra c)) (NewEpochState (ShelleyEra c))) Source # reapplyBlock ∷ Globals → NewEpochState (ShelleyEra c) → Block (BHeaderView (EraCrypto (ShelleyEra c))) (ShelleyEra c) → NewEpochState (ShelleyEra c) Source # |
applyBlock ∷ (ApplyBlock era, MonadError (BlockTransitionError era) m) ⇒ Globals → NewEpochState era → Block (BHeaderView (EraCrypto era)) era → m (NewEpochState era) Source #
applyTick ∷ ApplyBlock era ⇒ Globals → NewEpochState era → SlotNo → NewEpochState era Source #
newtype TickTransitionError era Source #
TickTransitionError (NonEmpty (PredicateFailure (EraRule "TICK" era))) |
Instances
newtype BlockTransitionError era Source #
BlockTransitionError (NonEmpty (PredicateFailure (EraRule "BBODY" era))) |
Instances
∷ ∀ c m. MonadError ChainPredicateFailure m | |
⇒ Version | Max major protocol version |
→ ChainChecksPParams | |
→ BHeaderView c | |
→ m () |