cardano-ledger-shelley-1.16.0.0: Shelley Ledger Executable Model
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Shelley.API.Validation

Description

Interface to the block validation and chain extension logic in the Shelley API.

Synopsis

Documentation

class (EraGov era, EraSegWits era) ⇒ ApplyBlock era where Source #

Minimal complete definition

Nothing

Methods

applyBlockSingEP ep → ValidationPolicyGlobalsNewEpochState era → Block BHeaderView era → (NewEpochState era, [PredicateFailure (EraRule "BBODY" era)], [Event (EraRule "BBODY" era)]) Source #

Run the BBODY rule with globalAssertionPolicy. This function always succeeds, but whenever validation is turned on it is necessary to check for presence of predicate failures before a call can be marked successful. Therefore it is recommended to call applyBlockEither instead.

default applyBlock ∷ (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 era, State (EraRule "LEDGERS" era) ~ LedgerState era) ⇒ SingEP ep → ValidationPolicyGlobalsNewEpochState era → Block BHeaderView era → (NewEpochState era, [PredicateFailure (EraRule "BBODY" era)], [Event (EraRule "BBODY" era)]) Source #

applyTickSingEP ep → GlobalsNewEpochState era → SlotNo → (NewEpochState era, [Event (EraRule "TICK" era)]) Source #

Run the TICK rule with globalAssertionPolicy and without any validation, since it can't fail anyways.

default applyTick ∷ (STS (EraRule "TICK" era), BaseM (EraRule "TICK" era) ~ ShelleyBase, Environment (EraRule "TICK" era) ~ (), State (EraRule "TICK" era) ~ NewEpochState era, Signal (EraRule "TICK" era) ~ SlotNo) ⇒ SingEP ep → GlobalsNewEpochState era → SlotNo → (NewEpochState era, [Event (EraRule "TICK" era)]) Source #

applyBlockEitherApplyBlock era ⇒ SingEP ep → ValidationPolicyGlobalsNewEpochState era → Block BHeaderView era → Either (BlockTransitionError era) (NewEpochState era, [Event (EraRule "BBODY" era)]) Source #

Same as applyBlock, except it produces a Left when there are failures present and Right with result otherwise.

applyBlockNoValidatonApplyBlock era ⇒ GlobalsNewEpochState era → Block BHeaderView 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.

applyTickNoEventsApplyBlock era ⇒ GlobalsNewEpochState era → SlotNoNewEpochState era Source #

Same as applyTick, but do not retain any ledger events

newtype TickTransitionError era Source #

Constructors

TickTransitionError (NonEmpty (PredicateFailure (EraRule "TICK" era))) 

Instances

Instances details
Generic (TickTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

Associated Types

type Rep (TickTransitionError era) ∷ TypeType #

Show (PredicateFailure (EraRule "TICK" era)) ⇒ Show (TickTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

Eq (PredicateFailure (EraRule "TICK" era)) ⇒ Eq (TickTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

NoThunks (PredicateFailure (EraRule "TICK" era)) ⇒ NoThunks (TickTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

type Rep (TickTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

type Rep (TickTransitionError era) = D1 ('MetaData "TickTransitionError" "Cardano.Ledger.Shelley.API.Validation" "cardano-ledger-shelley-1.16.0.0-inplace" 'True) (C1 ('MetaCons "TickTransitionError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty (PredicateFailure (EraRule "TICK" era))))))

newtype BlockTransitionError era Source #

Constructors

BlockTransitionError (NonEmpty (PredicateFailure (EraRule "BBODY" era))) 

Instances

Instances details
Generic (BlockTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

Associated Types

type Rep (BlockTransitionError era) ∷ TypeType #

Show (PredicateFailure (EraRule "BBODY" era)) ⇒ Show (BlockTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

Eq (PredicateFailure (EraRule "BBODY" era)) ⇒ Eq (BlockTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

NoThunks (PredicateFailure (EraRule "BBODY" era)) ⇒ NoThunks (BlockTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

type Rep (BlockTransitionError era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

type Rep (BlockTransitionError era) = D1 ('MetaData "BlockTransitionError" "Cardano.Ledger.Shelley.API.Validation" "cardano-ledger-shelley-1.16.0.0-inplace" 'True) (C1 ('MetaCons "BlockTransitionError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty (PredicateFailure (EraRule "BBODY" era))))))

chainChecks Source #

Arguments

∷ ∀ m. MonadError ChainPredicateFailure m 
Version

Max major protocol version

ChainChecksPParams 
BHeaderView 
→ m ()