ouroboros-consensus-0.26.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Fragment.ValidatedDiff

Contents

Description

Intended for qualified import

import Ouroboros.Consensus.Fragment.ValidatedDiff (ValidatedChainDiff (..))
import qualified Ouroboros.Consensus.Fragment.ValidatedDiff as ValidatedDiff
Synopsis

Documentation

data ValidatedChainDiff b l where Source #

A ChainDiff along with the ledger state after validation.

INVARIANT:

getTip chainDiff == ledgerTipPoint ledger

The invariant is only checked on construction, maintaining it afterwards is up to the user.

Bundled Patterns

pattern ValidatedChainDiffChainDiff b → l → ValidatedChainDiff b l

Allow for pattern matching on a ValidatedChainDiff without exposing the (unsafe) constructor. Use new to construct a ValidatedChainDiff.

new ∷ ∀ b l (mk ∷ MapKind). (GetTip l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ChainDiff b → l mk → ValidatedChainDiff b (l mk) Source #

Create a ValidatedChainDiff.

PRECONDITION:

getTip chainDiff == ledgerTipPoint ledger

Monadic

newM ∷ ∀ m b l. (MonadSTM m, GetTipSTM m l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ChainDiff b → l → m (ValidatedChainDiff b l) Source #