Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 #
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 :: 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.
Instances
ShelleyEraCrypto crypto => ApplyBlock ( ShelleyEra crypto) Source # | |
Defined in Cardano.Ledger.Shelley.API.Validation applyTickOpts :: forall (ep :: EventPolicy ). ApplySTSOpts ep -> Globals -> NewEpochState ( ShelleyEra crypto) -> SlotNo -> EventReturnType ep ( EraRule "TICK" ( ShelleyEra crypto)) ( NewEpochState ( ShelleyEra crypto)) Source # applyBlockOpts :: forall (ep :: EventPolicy ) m. ( EventReturnTypeRep ep, MonadError ( BlockTransitionError ( ShelleyEra crypto)) m) => ApplySTSOpts ep -> Globals -> NewEpochState ( ShelleyEra crypto) -> Block ( BHeaderView ( Crypto ( ShelleyEra crypto))) ( ShelleyEra crypto) -> m ( EventReturnType ep ( EraRule "BBODY" ( ShelleyEra crypto)) ( NewEpochState ( ShelleyEra crypto))) Source # reapplyBlock :: Globals -> NewEpochState ( ShelleyEra crypto) -> Block ( BHeaderView ( Crypto ( ShelleyEra crypto))) ( ShelleyEra crypto) -> NewEpochState ( ShelleyEra crypto) Source # |
applyBlock :: ( ApplyBlock era, MonadError ( BlockTransitionError era) m) => Globals -> NewEpochState era -> Block ( BHeaderView ( Crypto era)) era -> m ( NewEpochState era) Source #
applyTick :: ApplyBlock era => Globals -> NewEpochState era -> SlotNo -> NewEpochState era Source #
newtype TickTransitionError era Source #
TickTransitionError [ PredicateFailure ( EraRule "TICK" era)] |
Instances
newtype BlockTransitionError era Source #
BlockTransitionError [ PredicateFailure ( EraRule "BBODY" era)] |
Instances
:: forall crypto m. MonadError ChainPredicateFailure m | |
=> Natural |
Max major protocol version |
-> ChainChecksPParams | |
-> BHeaderView crypto | |
-> m () |
type ShelleyEraCrypto crypto = ( Crypto crypto, DSignable crypto ( Hash crypto EraIndependentTxBody )) Source #