Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- lblStatic ∷ Label
- (?!#) ∷ Bool → PredicateFailure sts → Rule sts ctx ()
- (?!#:) ∷ Either e () → (e → PredicateFailure sts) → Rule sts ctx ()
- failBecauseS ∷ PredicateFailure sts → Rule sts ctx ()
- applySTSNonStatic ∷ ∀ s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) ⇒ RuleContext rtype s → m (Either (NonEmpty (PredicateFailure s)) (State s))
- applySTSValidateSuchThat ∷ ∀ s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) ⇒ ([Label] → Bool) → RuleContext rtype s → m (Either (NonEmpty (PredicateFailure s)) (State s))
- class Inject t s where
- inject ∷ t → s
- type Test failure = Validation (NonEmpty failure) ()
- runTest ∷ InjectRuleFailure rule f era ⇒ Test (f era) → Rule (EraRule rule era) ctx ()
- runTestOnSignal ∷ InjectRuleFailure rule f era ⇒ Test (f era) → Rule (EraRule rule era) ctx ()
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.
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 ∷ ∀ 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
type Test failure = Validation (NonEmpty failure) () Source #
runTestOnSignal ∷ InjectRuleFailure rule f era ⇒ Test (f era) → Rule (EraRule rule era) ctx () Source #