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

Fix missing script proposals in transaction building #602

Merged

Conversation

carbolymer
Copy link
Contributor

@carbolymer carbolymer commented Jul 30, 2024

Changelog

- description: |
    `TxInsReference` is no longer parameterised by `build`.
    New functions `mkFeatured`, `setTxProposalProcedures`, `setTxVotingProcedures`, `mkTxVotingProcedures`, `mkTxProposalProcedures`, `convProposalProcedures`, and `buildTxWithToMaybe`.
    New generator `genValidTxBody`.
    Fix missing script proposals in transaction building [#594](https://github.com/IntersectMBO/cardano-api/issues/594).
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
   - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
   - refactoring    # QoL changes
   - bugfix         # fixes a defect
   - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Fixes #594

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@carbolymer carbolymer added this pull request to the merge queue Jul 30, 2024
@carbolymer carbolymer removed this pull request from the merge queue due to a manual request Jul 30, 2024
@carbolymer carbolymer added this pull request to the merge queue Jul 30, 2024
@carbolymer carbolymer removed this pull request from the merge queue due to a manual request Jul 30, 2024
@carbolymer carbolymer force-pushed the mgalazyn/fix/missing-script-proposal-in-transaction-build branch from 15dfd1b to 3ee255f Compare July 30, 2024 14:49
@carbolymer carbolymer marked this pull request as draft July 31, 2024 15:13
@carbolymer carbolymer force-pushed the mgalazyn/fix/missing-script-proposal-in-transaction-build branch from b98416b to d34b151 Compare July 31, 2024 19:38
@carbolymer carbolymer force-pushed the mgalazyn/fix/missing-script-proposal-in-transaction-build branch 11 times, most recently from 0a9ace3 to 6e1b01d Compare August 6, 2024 11:40
@carbolymer carbolymer requested a review from Jimbo4350 August 8, 2024 08:12
@carbolymer carbolymer force-pushed the mgalazyn/fix/missing-script-proposal-in-transaction-build branch from 64743e2 to 200b65c Compare August 8, 2024 08:14
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert all the changes wrt to data types. I don't want to break the api twice because there may be a way to remove BuildTxWith. Just fix the bug we have encountered.

cardano-api/internal/Cardano/Api/Fees.hs Outdated Show resolved Hide resolved
cardano-api/internal/Cardano/Api/Tx/Body.hs Outdated Show resolved Hide resolved
@carbolymer carbolymer force-pushed the mgalazyn/fix/missing-script-proposal-in-transaction-build branch 4 times, most recently from 9246b94 to ce1f6d9 Compare August 9, 2024 17:51
@carbolymer carbolymer requested a review from Jimbo4350 August 9, 2024 17:56
@carbolymer carbolymer force-pushed the mgalazyn/fix/missing-script-proposal-in-transaction-build branch from ce1f6d9 to 91289ff Compare August 9, 2024 18:02
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some instances can be removed and some minor refactors.

cardano-api/internal/Cardano/Api/Orphans.hs Outdated Show resolved Hide resolved
cardano-api/internal/Cardano/Api/Tx/Body.hs Outdated Show resolved Hide resolved
cardano-api/internal/Cardano/Api/Tx/Body.hs Show resolved Hide resolved
cardano-api/internal/Cardano/Api/Tx/Body.hs Outdated Show resolved Hide resolved
cardano-api/internal/Cardano/Api/Tx/Body.hs Outdated Show resolved Hide resolved
cardano-api/internal/Cardano/Api/Tx/Body.hs Outdated Show resolved Hide resolved
@carbolymer carbolymer force-pushed the mgalazyn/fix/missing-script-proposal-in-transaction-build branch 7 times, most recently from ed6a214 to f170034 Compare August 12, 2024 19:39
@carbolymer carbolymer force-pushed the mgalazyn/fix/missing-script-proposal-in-transaction-build branch from f170034 to 55fadc9 Compare August 12, 2024 19:43
@@ -800,7 +815,7 @@ genMaybeFeaturedInEra
-> f (Maybe (Featured eon era a))
genMaybeFeaturedInEra f =
inEonForEra (pure Nothing) $ \w ->
pure Nothing <|> fmap Just (genFeaturedInEra w (f w))
Just <$> genFeaturedInEra w (f w)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? We also want to generate Nothing even when the feature is available in a given era.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous implementation was always generating Nothing, because the first argument of <|> was never empty.

@carbolymer carbolymer added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit 93026aa Aug 13, 2024
27 checks passed
@carbolymer carbolymer deleted the mgalazyn/fix/missing-script-proposal-in-transaction-build branch August 13, 2024 08:44
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.

[BUG] - Script Proposals are removed on transaction build
2 participants