Skip to content

Commit

Permalink
consensus-testlib: add ChainGenerators
Browse files Browse the repository at this point in the history
For those involved in this PR's development, this commit is a manual full
"squash" of 8f3b50b.

Co-authored-by: Facundo Domínguez <facundominguez@gmail.com>
Co-authored-by: amesgen <amesgen@amesgen.de>
  • Loading branch information
3 people committed Aug 31, 2023
1 parent 4c0a421 commit ecfbdd6
Show file tree
Hide file tree
Showing 17 changed files with 3,118 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Non-Breaking

- Added `ChainGenerators`.
See `checkAdversarialChain` and `checkHonestChain` for the invariants these generators ensure.
17 changes: 17 additions & 0 deletions ouroboros-consensus/ouroboros-consensus.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,14 @@ library unstable-consensus-testlib
visibility: public
hs-source-dirs: src/unstable-consensus-testlib
exposed-modules:
Test.Ouroboros.Consensus.ChainGenerator.Adversarial
Test.Ouroboros.Consensus.ChainGenerator.BitVector
Test.Ouroboros.Consensus.ChainGenerator.Counting
Test.Ouroboros.Consensus.ChainGenerator.Honest
Test.Ouroboros.Consensus.ChainGenerator.Params
Test.Ouroboros.Consensus.ChainGenerator.RaceIterator
Test.Ouroboros.Consensus.ChainGenerator.Slot
Test.Ouroboros.Consensus.ChainGenerator.Some
Test.Util.BoolProps
Test.Util.ChainDB
Test.Util.ChainUpdates
Expand Down Expand Up @@ -362,6 +370,7 @@ library unstable-consensus-testlib
, time
, tree-diff
, utf8-string
, vector

library unstable-mock-block
import: common-lib
Expand Down Expand Up @@ -507,16 +516,24 @@ test-suite infra-test
main-is: Main.hs
other-modules:
Ouroboros.Consensus.Util.Tests
Test.Ouroboros.Consensus.ChainGenerator.Tests
Test.Ouroboros.Consensus.ChainGenerator.Tests.Adversarial
Test.Ouroboros.Consensus.ChainGenerator.Tests.BitVector
Test.Ouroboros.Consensus.ChainGenerator.Tests.Counting
Test.Ouroboros.Consensus.ChainGenerator.Tests.Honest
Test.Util.ChainUpdates.Tests
Test.Util.Schedule.Tests
Test.Util.Split.Tests

build-depends:
, base
, mtl
, ouroboros-consensus:{ouroboros-consensus, unstable-consensus-testlib}
, QuickCheck
, random
, tasty
, tasty-quickcheck
, vector

test-suite storage-test
import: common-test
Expand Down
Loading

0 comments on commit ecfbdd6

Please sign in to comment.