Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data ValidatedChainDiff b l where
- pattern ValidatedChainDiff ∷ ChainDiff b → l → ValidatedChainDiff b l
- getChainDiff ∷ ValidatedChainDiff b l → ChainDiff b
- getLedger ∷ ValidatedChainDiff b l → l
- new ∷ ∀ b l (mk ∷ MapKind). (GetTip l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ChainDiff b → l mk → ValidatedChainDiff b (l mk)
- rollbackExceedsSuffix ∷ HasHeader b ⇒ ValidatedChainDiff b l → Bool
- toValidatedFragment ∷ ∀ l b (mk ∷ MapKind). (GetTip l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ValidatedChainDiff b (l mk) → ValidatedFragment b (l mk)
- newM ∷ ∀ m b l. (MonadSTM m, GetTipSTM m l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ChainDiff b → l → m (ValidatedChainDiff b l)
- toValidatedFragmentM ∷ (MonadSTM m, GetTipSTM m l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ValidatedChainDiff b l → m (ValidatedFragment b l)
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 ValidatedChainDiff ∷ ChainDiff b → l → ValidatedChainDiff b l | Allow for pattern matching on a |
getChainDiff ∷ ValidatedChainDiff b l → ChainDiff b Source #
getLedger ∷ ValidatedChainDiff b l → l Source #
new ∷ ∀ b l (mk ∷ MapKind). (GetTip l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ChainDiff b → l mk → ValidatedChainDiff b (l mk) Source #
rollbackExceedsSuffix ∷ HasHeader b ⇒ ValidatedChainDiff b l → Bool Source #
toValidatedFragment ∷ ∀ l b (mk ∷ MapKind). (GetTip l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ValidatedChainDiff b (l mk) → ValidatedFragment b (l mk) Source #
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 #
toValidatedFragmentM ∷ (MonadSTM m, GetTipSTM m l, HasHeader b, HeaderHash l ~ HeaderHash b, HasCallStack) ⇒ ValidatedChainDiff b l → m (ValidatedFragment b l) Source #