Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides a watcher of the invariants that are specific to the
ChainSync jumping (CSJ) implementation. Those invariants are typically
documented in the codebase but are not checked in any way, yet they are
crucial for CSJ to work properly. This watcher monitors the ChainSync
handlers and throws a Violation
exception when an invariant stops holding.
It is intended for testing purposes.
Synopsis
- data Violation peer blk
- watcher ∷ (MonadSTM m, MonadThrow m, Eq peer, Show peer, Typeable peer, Typeable blk, StandardHash blk) ⇒ StrictTVar m (Map peer (ChainSyncClientHandle m blk)) → Watcher m (View peer blk) (View peer blk)
Documentation
data Violation peer blk Source #
An exception that is thrown when an invariant is violated. It carries the name of the invariant and the view of the state that triggered the invariant violation.
Instances
(Typeable blk, StandardHash blk, Eq peer, Show peer, Typeable peer) ⇒ Exception (Violation peer blk) Source # | |
Defined in Test.Consensus.PeerSimulator.CSJInvariants toException ∷ Violation peer blk → SomeException # fromException ∷ SomeException → Maybe (Violation peer blk) # displayException ∷ Violation peer blk → String # | |
(StandardHash blk, Show peer) ⇒ Show (Violation peer blk) Source # | |
(StandardHash blk, Eq peer) ⇒ Eq (Violation peer blk) Source # | |
watcher ∷ (MonadSTM m, MonadThrow m, Eq peer, Show peer, Typeable peer, Typeable blk, StandardHash blk) ⇒ StrictTVar m (Map peer (ChainSyncClientHandle m blk)) → Watcher m (View peer blk) (View peer blk) Source #
The watcher of ChainSync jumping invariants. It receives the ChainSync
handles and monitors them for changes. When a change is detected, it runs all
the invariants and throws Violation
if any of the invariants is violated.