| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Util.ChainUpdates
Contents
Description
Generate sequences of updates to model an evolving chain
Synopsis
- data ChainUpdate
- data UpdateBehavior
- genChainUpdates ∷ UpdateBehavior → SecurityParam → Int → Gen [ChainUpdate]
- toChainUpdates ∷ [ChainUpdate] → [ChainUpdate TestBlock TestBlock]
- prop_genChainUpdates ∷ SecurityParam → Int → Property
Documentation
data ChainUpdate Source #
Constructors
| AddBlock TestBlock | |
| SwitchFork (Point TestBlock) [TestBlock] | Roll back to the given |
Instances
| Show ChainUpdate Source # | |
Defined in Test.Util.ChainUpdates Methods showsPrec ∷ Int → ChainUpdate → ShowS # show ∷ ChainUpdate → String # showList ∷ [ChainUpdate] → ShowS # | |
| Eq ChainUpdate Source # | |
Defined in Test.Util.ChainUpdates | |
| Condense ChainUpdate Source # | |
Defined in Test.Util.ChainUpdates Methods condense ∷ ChainUpdate → String Source # | |
data UpdateBehavior Source #
Different strategies how to generate a sequence of ChainUpdates.
Constructors
| SelectedChainBehavior | Chain updates tracking the selected chain of an honest node. In particular, this includes:
|
| TentativeChainBehavior | Chain updates tracking the tentative chain of an honest node (in the
context of diffusion pipelining). This is similiar to
|
Instances
| Bounded UpdateBehavior Source # | |
Defined in Test.Util.ChainUpdates | |
| Enum UpdateBehavior Source # | |
Defined in Test.Util.ChainUpdates Methods succ ∷ UpdateBehavior → UpdateBehavior # pred ∷ UpdateBehavior → UpdateBehavior # toEnum ∷ Int → UpdateBehavior # fromEnum ∷ UpdateBehavior → Int # enumFrom ∷ UpdateBehavior → [UpdateBehavior] # enumFromThen ∷ UpdateBehavior → UpdateBehavior → [UpdateBehavior] # enumFromTo ∷ UpdateBehavior → UpdateBehavior → [UpdateBehavior] # enumFromThenTo ∷ UpdateBehavior → UpdateBehavior → UpdateBehavior → [UpdateBehavior] # | |
| Show UpdateBehavior Source # | |
Defined in Test.Util.ChainUpdates Methods showsPrec ∷ Int → UpdateBehavior → ShowS # show ∷ UpdateBehavior → String # showList ∷ [UpdateBehavior] → ShowS # | |
| Eq UpdateBehavior Source # | |
Defined in Test.Util.ChainUpdates Methods (==) ∷ UpdateBehavior → UpdateBehavior → Bool # (/=) ∷ UpdateBehavior → UpdateBehavior → Bool # | |
Arguments
| ∷ UpdateBehavior | |
| → SecurityParam | |
| → Int | The number of updates to generate |
| → Gen [ChainUpdate] |
Tests
prop_genChainUpdates ∷ SecurityParam → Int → Property Source #
Test that applying the generated updates gives us the same chain
as cusCurrentChain.