cardano-ledger-shelley-0.1.0.0
Safe Haskell None
Language Haskell2010

Cardano.Ledger.Shelley.API.Validation

Description

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

Documentation

class ( ChainData ( NewEpochState era), SerialisableData ( NewEpochState era), ChainData ( BlockTransitionError era), ChainData ChainPredicateFailure , 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) ~ BbodyState era, Signal ( EraRule "BBODY" era) ~ Block ( BHeaderView ( Crypto era)) era, ToCBORGroup ( TxSeq era)) => ApplyBlock era where Source #

Minimal complete definition

Nothing

Methods

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 :: forall ep m. ( EventReturnTypeRep ep, MonadError ( BlockTransitionError era) m) => ApplySTSOpts ep -> Globals -> NewEpochState era -> Block ( BHeaderView ( Crypto era)) era -> m ( EventReturnType ep ( EraRule "BBODY" era) ( NewEpochState era)) Source #

Apply the block level ledger transition.

reapplyBlock :: Globals -> NewEpochState era -> Block ( BHeaderView ( Crypto 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.

newtype TickTransitionError era Source #

Instances

Instances details
Eq ( PredicateFailure ( EraRule "TICK" era)) => Eq ( TickTransitionError era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

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

Defined in Cardano.Ledger.Shelley.API.Validation

Generic ( 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-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' True ) ( C1 (' MetaCons "TickTransitionError" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 [ PredicateFailure ( EraRule "TICK" era)])))

newtype BlockTransitionError era Source #

Instances

Instances details
Eq ( PredicateFailure ( EraRule "BBODY" era)) => Eq ( BlockTransitionError era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.API.Validation

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

Defined in Cardano.Ledger.Shelley.API.Validation

Generic ( 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-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' True ) ( C1 (' MetaCons "BlockTransitionError" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 [ PredicateFailure ( EraRule "BBODY" era)])))

chainChecks Source #

Arguments

:: forall crypto m. MonadError ChainPredicateFailure m
=> Natural

Max major protocol version

-> ChainChecksPParams
-> BHeaderView crypto
-> m ()