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

queryStateForBalancedTx: return current treasury value #557

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Jun 19, 2024

Changelog

- description: |
    Make the query used by the CLI's `transaction build` return the current treasury value, so that command to do treasury donation doesn't require the user to pass it. Corresponding CLI PR: https://github.com/IntersectMBO/cardano-cli/pull/778
# 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

Required for transaction build not to perform a new call to retrieve the treasury's current value in IntersectMBO/cardano-cli#778

How to trust this PR

It returns additional data. Existing data is unchanged.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Self-reviewed the diff

@smelc smelc mentioned this pull request Jun 19, 2024
2 tasks
@smelc smelc force-pushed the smelc/extend-query-state-for-balanced-tx branch 2 times, most recently from d174341 to bf4e4c9 Compare June 20, 2024 10:04
@smelc smelc changed the base branch from main to smelc/small-improvements-to-queries June 20, 2024 10:05
@smelc smelc force-pushed the smelc/extend-query-state-for-balanced-tx branch from bf4e4c9 to 81508ad Compare June 20, 2024 10:05
@smelc smelc force-pushed the smelc/small-improvements-to-queries branch from 58664b9 to dcd8d61 Compare June 20, 2024 12:32
@smelc smelc force-pushed the smelc/extend-query-state-for-balanced-tx branch from 81508ad to f2e4c98 Compare June 20, 2024 12:33
@smelc smelc force-pushed the smelc/small-improvements-to-queries branch 2 times, most recently from 67808d1 to db0e822 Compare June 24, 2024 09:09
@smelc smelc force-pushed the smelc/extend-query-state-for-balanced-tx branch from 3db8681 to 9e0063f Compare June 24, 2024 09:14
@smelc smelc force-pushed the smelc/small-improvements-to-queries branch from db0e822 to fe7c6e7 Compare June 24, 2024 09:14
@smelc smelc force-pushed the smelc/small-improvements-to-queries branch from fe7c6e7 to 22dbb35 Compare June 25, 2024 10:02
@smelc smelc force-pushed the smelc/extend-query-state-for-balanced-tx branch from 9e0063f to 0f95294 Compare June 25, 2024 12:08
Base automatically changed from smelc/small-improvements-to-queries to main June 25, 2024 13:25
@smelc smelc force-pushed the smelc/extend-query-state-for-balanced-tx branch from 0f95294 to df779d0 Compare June 25, 2024 13:27
@smelc smelc marked this pull request as ready for review June 25, 2024 13:27
@@ -259,3 +261,9 @@ queryStakeVoteDelegatees :: ()
queryStakeVoteDelegatees era stakeCredentials = do
let sbe = conwayEraOnwardsToShelleyBasedEra era
queryExpr $ QueryInEra $ QueryInShelleyBasedEra sbe $ QueryStakeVoteDelegatees stakeCredentials

queryAccountState :: ()
=> ShelleyBasedEra era
Copy link
Contributor

@carbolymer carbolymer Jun 26, 2024

Choose a reason for hiding this comment

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

Are you sure about this witness? If it's in NTC protocol version >= v16, shouldn't there be ConwayEraOnwards era?

Copy link
Contributor

@carbolymer carbolymer Jun 26, 2024

Choose a reason for hiding this comment

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

This should be >= Conway afaik.

Copy link
Contributor Author

@smelc smelc Jun 26, 2024

Choose a reason for hiding this comment

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

@carbolymer, @Jimbo4350> So then I should return a Maybe TxTreasuryValue in queryStateForBalancedTx? (returning None when the era is before Conway?)

And not include the treasury value if the era is before Conway in transaction build in CLI?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would make most sense. Or use Maybe (Featured ConwayEraOnwards era TxTreasuryValue) to signal when treasury is present.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@carbolymer> did the change in the third commit queryStateForBalancedTx: return Maybe (Featured ConwayEraOnwards era TxTreasuryValue 👍

Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

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 but you need to make the change suggested by @carbolymer

@smelc smelc force-pushed the smelc/extend-query-state-for-balanced-tx branch from 11b0310 to b46f7ba Compare June 26, 2024 19:06
@smelc smelc added this pull request to the merge queue Jun 27, 2024
@smelc smelc removed this pull request from the merge queue due to a manual request Jun 27, 2024
@smelc smelc force-pushed the smelc/extend-query-state-for-balanced-tx branch from 9fba00c to f339cfc Compare June 27, 2024 10:12
@smelc smelc enabled auto-merge June 27, 2024 10:13
@smelc smelc added this pull request to the merge queue Jun 27, 2024
Merged via the queue into main with commit e5e1f91 Jun 27, 2024
23 checks passed
@smelc smelc deleted the smelc/extend-query-state-for-balanced-tx branch June 27, 2024 11:14
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