-
Notifications
You must be signed in to change notification settings - Fork 156
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
Ts newstyle specs #4314
Ts newstyle specs #4314
Conversation
38b4263
to
d78d73b
Compare
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Gov.hs
Outdated
Show resolved
Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances.hs
Show resolved
Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances.hs
Show resolved
Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances.hs
Show resolved
Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Gov.hs
Outdated
Show resolved
Hide resolved
bc6ff1d
to
87d7cd0
Compare
@TimSheard may I suggest - to make the Another thing I've been thinking about is it it wouldn't be better to just bite the bullet and implement |
e132b2d
to
191a9e6
Compare
So my experience with maps suggests a solution for List. We can add that later. |
0b11983
to
08a72c4
Compare
276731a
to
6de375e
Compare
6de375e
to
fcebece
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't had time to look at the new style generators for maps in detail yet, but I trust that once we run enough tests we'll be quite sure they work correctly enough. It's important that we don't reduce the number of tests we run here because this is very tricky territory.
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Utxo.hs
Show resolved
Hide resolved
3592815
to
4f6955e
Compare
Added ToDelta as operation on Coin, RngSetFn as operation on Map Added a tractible type PParamSubset as a SimpleRep type for PParam specs Added PPUdates, canFollow abstraction Added CertState, UTxOState, LedgerState, EpochState Use reify to propagate invariants Added class WellFormed Made a few changes to Base.hs, replacing (MemberSpec []) with ErrorSpec Added HSpec tests Work on canFollow and dependencies, added (>=.) Added MinValSize to track size when using rngSet_ Fix omissions and problems with cardinality Improved SizeSpec's in Sets, List, and Maps. Also add typeSpecOpt to Map and Set
7447138
to
fadd5f9
Compare
Closing in favor of #4575 |
Use the new style constrained generators to build Specifications of well formed type used in the Cardano Ledger.
Well formed means that constraints that should hold in the NewEpochState on the chain will hold on the randomly generated
values. The (WellFormed t) class has a has a member function with type ( wff :: Gen t )
These Specifications will probably have to be refined over time. But they are complete in that the machinery exists for every
type in the Ledger. Currently they mimic the constraints in the oldstyle constrained generators. They are significantly simpler and much more composeable.
The PR also has a few fixes that were necessary to handle the constraints we wrote. This PR exercised the constrained generators library quite a bit, and it needed some additions. These include
Checklist
.cabal
andCHANGELOG.md
files according to theversioning process.
.cabal
files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)CHANGELOG.md
for the affected packages. New section is never added with the code changes. (See RELEASING.md)fourmolu
(usescripts/fourmolize.sh
)scripts/cabal-format.sh
)hie.yaml
has been updated (usescripts/gen-hie.sh
)