-
Notifications
You must be signed in to change notification settings - Fork 223
Provide Cardano.Api.Tx generators #2975
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
Conversation
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.
This looks fine. 👍
It may be easier to put coverage checks in the actual properties, rather than as standalone generator tests.
describe "genTxFeeCoverage" $ do | ||
it "genTxFee ByronEra" $ | ||
property genTxFeeCoverageByron | ||
it "genTxFee ShelleyEra" $ | ||
property genTxFeeCoverageShelley | ||
it "genTxFee AllegraEra" $ | ||
property genTxFeeCoverageAllegra | ||
it "genTxFee MaryEra" $ | ||
property genTxFeeCoverageMary | ||
it "genTxFee AlonzoEra" $ | ||
property genTxFeeCoverageAlonzo |
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.
You could factor these out using the AnyCardanoEra
existential wrapper. Something like this:
forAllEras :: (AnyCardanoEra -> a) -> a
forAllEras f = do
f (AnyCardanoEra ByronEra)
forAllShelleyBasedEras f
forAllShelleyBasedEras :: (AnyCardanoEra -> a) -> a
forAllShelleyBasedEras f = do
f (AnyCardanoEra ShelleyEra)
f (AnyCardanoEra AllegraEra)
f (AnyCardanoEra MaryEra)
f (AnyCardanoEra AlonzoEra)
Closed in favour of #2985. |
Comments
Issue Number
ADP-1147