Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consensus-testlib: add chain generators #240

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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