Skip to content

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

Closed

Conversation

sevanspowell
Copy link
Contributor

  • I have provided a basic set of Tx generators, mostly copied from cardano-api.

Comments

Issue Number

ADP-1147

@sevanspowell sevanspowell self-assigned this Oct 14, 2021
Copy link
Contributor

@rvl rvl left a 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.

Comment on lines +174 to +184
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
Copy link
Contributor

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)

@rvl rvl mentioned this pull request Oct 27, 2021
2 tasks
@sevanspowell
Copy link
Contributor Author

Closed in favour of #2985.

@HeinrichApfelmus HeinrichApfelmus deleted the feature/adp-1147-cardano-api-tx-generators branch July 5, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants