shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.API.Validation

Description

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

Documentation

class (ChainData (Block era), AnnotatedData (Block era), ChainData (BHeader (Crypto era)), AnnotatedData (BHeader (Crypto era)), ChainData (NewEpochState era), SerialisableData (NewEpochState era), ChainData (BlockTransitionError era), ChainData (PredicateFailure (CHAIN era))) => ApplyBlock era where Source #

Minimal complete definition

Nothing

Methods

applyTick :: Globals -> NewEpochState era -> SlotNo -> 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.

applyBlock :: MonadError (BlockTransitionError era) m => Globals -> NewEpochState era -> Block era -> m (NewEpochState era) Source #

Apply the block level ledger transition.

default applyBlock :: (STS (BBODY era), MonadError (BlockTransitionError era) m) => Globals -> NewEpochState era -> Block era -> m (NewEpochState era) Source #

reapplyBlock :: Globals -> NewEpochState era -> Block 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 :: STS (BBODY era) => Globals -> NewEpochState era -> Block era -> NewEpochState era Source #

Instances

Instances details
PraosCrypto crypto => ApplyBlock (ShelleyEra crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.API.Validation

newtype TickTransitionError era Source #

Instances

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

Defined in Shelley.Spec.Ledger.API.Validation

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

Defined in Shelley.Spec.Ledger.API.Validation

Generic (TickTransitionError era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.API.Validation

Associated Types

type Rep (TickTransitionError era) :: Type -> Type #

NoThunks (PredicateFailure (TICK era)) => NoThunks (TickTransitionError era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.API.Validation

type Rep (TickTransitionError era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.API.Validation

type Rep (TickTransitionError era) = D1 ('MetaData "TickTransitionError" "Shelley.Spec.Ledger.API.Validation" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'True) (C1 ('MetaCons "TickTransitionError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PredicateFailure (TICK era)])))

newtype BlockTransitionError era Source #

Instances

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

Defined in Shelley.Spec.Ledger.API.Validation

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

Defined in Shelley.Spec.Ledger.API.Validation

Generic (BlockTransitionError era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.API.Validation

Associated Types

type Rep (BlockTransitionError era) :: Type -> Type #

NoThunks (PredicateFailure (BBODY era)) => NoThunks (BlockTransitionError era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.API.Validation

type Rep (BlockTransitionError era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.API.Validation

type Rep (BlockTransitionError era) = D1 ('MetaData "BlockTransitionError" "Shelley.Spec.Ledger.API.Validation" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'True) (C1 ('MetaCons "BlockTransitionError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PredicateFailure (BBODY era)])))

chainChecks :: forall era m. (Era era, MonadError (PredicateFailure (CHAIN era)) m) => Globals -> ChainChecksData -> BHeader (Crypto era) -> m () Source #