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

Add Cardano.Api.Tx.Compatible #644

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Add Cardano.Api.Tx.Compatible #644

merged 2 commits into from
Oct 3, 2024

Conversation

Jimbo4350
Copy link
Contributor

Changelog

- description: |
    This module exposes `createCompatibleSignedTx` which is intended to be used in testing only. It allows the creation of simple unbalanced transactions that can submit protocol updates in any era.
# uncomment types applicable to the change:
  type:
  - feature        # introduces a new feature

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

  • 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

@palas palas left a comment

Choose a reason for hiding this comment

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

Looks good 👍
Just a couple of lints

cardano-api/internal/Cardano/Api/Tx/Compatible.hs Outdated Show resolved Hide resolved
Comment on lines 117 to 121
txbody =
conwayEraOnwardsConstraints conwayOnwards $
createCommonTxBody sbe ins outs txFee'
& L.proposalProceduresTxBodyL
.~ OSet.singleton updateProposalProcedure
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
txbody =
conwayEraOnwardsConstraints conwayOnwards $
createCommonTxBody sbe ins outs txFee'
& L.proposalProceduresTxBodyL
.~ OSet.singleton updateProposalProcedure
bodyWithProtocolUpdate =
conwayEraOnwardsConstraints conwayOnwards $
createCommonTxBody sbe ins outs txFee'
& L.proposalProceduresTxBodyL
.~ OSet.singleton updateProposalProcedure

Best to use the same terminology as other branches. I would also recommend moving common bits to outside the case, but I've tried, and it seems the Haskell constraint solver doesn't like that at all

@Jimbo4350
Copy link
Contributor Author

This is still a WIP as it's being integrated in cardano-cli and needs to be tested by QA.

Comment on lines +7 to +9
-- | This module provides a way to construct a simple transaction over all eras.
-- It is exposed for testing purposes only.
module Cardano.Api.Tx.Compatible
Copy link
Contributor

@carbolymer carbolymer Sep 30, 2024

Choose a reason for hiding this comment

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

The module name and the description is not quite clear for me. Is it supposed to be a module for support of transaction building for older eras once we remove them from API?

Maybe we should add Internal to the module name e.g. Cardano.Api.Tx.Internal.Compatible, to mark that it's not meant to be directly used?

I'm not sure about the name as well. Maybe we should name it something like Old or Legacy to put emphasis that it's meant just for backwards compatibility for tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's meant to be directly used. It's supposed to house all functions that are expected to be backwards compatible across all shelley based eras. I'm not opposed to a rename but I'm not blocking the PR on this.

This module exposes createCompatibleSignedTx which is intended to be
used in testing only. It allows creation of simple unbalanced
transactions that can submit protocol updates in any era.
@Jimbo4350 Jimbo4350 added this pull request to the merge queue Oct 3, 2024
Merged via the queue into main with commit b5e8819 Oct 3, 2024
24 of 25 checks passed
@Jimbo4350 Jimbo4350 deleted the jordan/simple-tx-interface branch October 3, 2024 13:40
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.

3 participants