cardano-ledger-core-1.12.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

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.

lblStaticLabel Source #

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

(?!#)BoolPredicateFailure 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.

failBecauseSPredicateFailure sts → Rule sts ctx () Source #

Fail, if static checks are enabled.

applySTSNonStatic ∷ ∀ s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) ⇒ RuleContext rtype s → m (Either (NonEmpty (PredicateFailure s)) (State s)) Source #

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

applySTSValidateSuchThat ∷ ∀ s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) ⇒ ([Label] → Bool) → RuleContext rtype s → m (Either (NonEmpty (PredicateFailure s)) (State s)) Source #

Interface for independent Tests

class Inject t s where Source #

Minimal complete definition

Nothing

Methods

inject ∷ t → s Source #

default inject ∷ t ~ s ⇒ t → s Source #

Instances

Instances details
Inject Void s Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

injectVoid → s Source #

Inject Coin Coin Source # 
Instance details

Defined in Cardano.Ledger.Coin

Methods

injectCoinCoin Source #

Inject Coin DeltaCoin Source # 
Instance details

Defined in Cardano.Ledger.Coin

Methods

injectCoinDeltaCoin Source #

Inject t () Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

inject ∷ t → () Source #

type Test failure = Validation (NonEmpty failure) () Source #

runTestInjectRuleFailure rule f era ⇒ Test (f era) → Rule (EraRule rule era) ctx () Source #

runTestOnSignalInjectRuleFailure rule f era ⇒ Test (f era) → Rule (EraRule rule era) ctx () Source #