-
Notifications
You must be signed in to change notification settings - Fork 22
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
Draft: Use era type class constraints in generators #709
base: master
Are you sure you want to change the base?
Draft: Use era type class constraints in generators #709
Conversation
) | ||
(genTxBodyContent sbe) | ||
(genTxBodyContent) |
Check warning
Code scanning / HLint
Redundant bracket Warning generated
Found:
(genTxBodyContent)
Perhaps:
genTxBodyContent
:: IsShelleyBasedEra era | ||
=> Gen [KeyWitness era] | ||
genWitnesses = do | ||
bsWits <- Gen.list (Range.constant 0 10) (genShelleyBootstrapWitness) |
Check warning
Code scanning / HLint
Redundant bracket Warning generated
Found:
(genShelleyBootstrapWitness)
Perhaps:
genShelleyBootstrapWitness
=> Gen [KeyWitness era] | ||
genWitnesses = do | ||
bsWits <- Gen.list (Range.constant 0 10) (genShelleyBootstrapWitness) | ||
keyWits <- Gen.list (Range.constant 0 10) (genShelleyKeyWitness) |
Check warning
Code scanning / HLint
Redundant bracket Warning generated
Found:
(genShelleyKeyWitness)
Perhaps:
genShelleyKeyWitness
@@ -33,7 +34,7 @@ | |||
prop_roundtrip_txbodycontent_txouts :: forall era. ShelleyBasedEra era -> Property | |||
prop_roundtrip_txbodycontent_txouts era = H.property $ do | |||
(body, content :: TxBodyContent BuildTx era) <- | |||
shelleyBasedEraConstraints era $ H.forAll $ genValidTxBody era | |||
shelleyBasedEraConstraints era $ H.forAll $ genValidTxBody |
Check notice
Code scanning / HLint
Redundant $ Note test
Found:
H.forAll $ genValidTxBody
Perhaps:
H.forAll genValidTxBody
Draft. I tried to change some generator to use type classes rather than witnesses, which works - but I struggled to update the tests that use generators in any era. I managed to make it compile, but what I had to do is very unsatisfying, so I'm wondering if anyone can see how to do that part better - or explain why it isn't possible.
Thanks.
Changelog
Context
Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.
How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist