cardano-ledger-core-0.1.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe Haskell None
Language Haskell2010

Cardano.Ledger.Rules.ValidationMode

Description

Describes modes under which we might validate certain rules in the ledger.

What does this mean? Sometimes, we will want to check only certain conditions specified in the rules. For example, when replaying a previously validated chain, we do not care about rerunning _any_ checks, only making the relevant changes to the ledger state.

Synopsis

Documentation

Static checks are used to indicate that a particular predicate depends only on the signal to the transition, rather than the state or environment. This is particularly relevant where the signal is something such as a transaction, which is fixed, whereas the state and environment depend upon the chain tip upon which we are trying to build a block.

lblStatic :: Label Source #

Indicates that this check depends only upon the signal to the transition, not the state or environment.

(?!#) :: Bool -> PredicateFailure sts -> Rule sts ctx () infix 1 Source #

Construct a static predicate check.

The choice of # as a postfix here is made because often these are crypto checks.

(?!#:) :: Either e () -> (e -> PredicateFailure sts) -> Rule sts ctx () infix 1 Source #

Construct a static predicate check with an explanation.

The choice of # as a postfix here is made because often these are crypto checks.

failBecauseS :: PredicateFailure sts -> Rule sts ctx () Source #

Fail, if static checks are enabled.

applySTSNonStatic :: forall s m rtype. ( STS s, RuleTypeRep rtype, m ~ BaseM s) => RuleContext rtype s -> m ( Either [ PredicateFailure s] ( State s)) Source #

Apply an STS system and do not validate any static checks.

Interface with validation-selective libarary

mapMaybeValidation :: (e -> Maybe e') -> Validation ( NonEmpty e) () -> Validation ( NonEmpty e') () Source #

Helper function to filter out unused failures

Interface for independent Tests

class Inject t s where Source #

Methods

inject :: t -> s Source #