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 --current-treasury-value and --treasury-donation to transaction build and friends #778

Merged
merged 4 commits into from
Jul 1, 2024

Conversation

smelc
Copy link
Contributor

@smelc smelc commented May 27, 2024

Changelog

- description: |
    Add --current-treasury-value and --treasury-donation to transaction build and friends
# 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 #590

How to trust this PR

We tested this new feature in cardano-testnet in this cardano-node PR: IntersectMBO/cardano-node#5866

Checklist

@smelc smelc force-pushed the smelc/treasury-donations branch 4 times, most recently from de41efe to 53f5350 Compare June 6, 2024 10:19
@smelc smelc force-pushed the smelc/treasury-donations branch 4 times, most recently from 110e911 to 7a16057 Compare June 6, 2024 13:40
@smelc smelc marked this pull request as ready for review June 6, 2024 13:58
@smelc smelc marked this pull request as draft June 6, 2024 14:00
@smelc smelc marked this pull request as ready for review June 6, 2024 14:11
@smelc smelc force-pushed the smelc/treasury-donations branch from 7a16057 to 528f47e Compare June 6, 2024 14:11
@smelc smelc force-pushed the smelc/treasury-donations branch from 528f47e to 2096e19 Compare June 12, 2024 15:15
@smelc smelc requested review from a team as code owners June 12, 2024 15:15
@smelc smelc changed the base branch from main to smelc/update-cardano-api-to-8.47.0.0 June 12, 2024 15:17
Base automatically changed from smelc/update-cardano-api-to-8.47.0.0 to main June 13, 2024 09:39
@smelc smelc force-pushed the smelc/treasury-donations branch from 2096e19 to b2b9781 Compare June 13, 2024 09:40
@@ -735,14 +751,18 @@ runTxBuild :: ()
-> Maybe Word
-> [(VotingProcedures era, Maybe (ScriptWitness WitCtxStake era))]
-> [(Proposal era, Maybe (ScriptWitness WitCtxStake era))]
-> Maybe TxCurrentTreasuryValue
Copy link
Contributor

@Jimbo4350 Jimbo4350 Jun 13, 2024

Choose a reason for hiding this comment

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

So we are already querying the node state in transaction build command. What we should do is modify queryStateForBalancedTx to return the currency treasury value and this will allow us to avoid exposing a cli argument for the current treasury value.

build-raw will still need the argument however (as you've already done 👍 ).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Jimbo4350> OK I see, will do 👍

@smelc smelc force-pushed the smelc/treasury-donations branch from b2b9781 to 6762dbd Compare June 18, 2024 14:35
@smelc
Copy link
Contributor Author

smelc commented Jun 18, 2024

Putting draft until the required change in cardano-api is done.

@smelc smelc marked this pull request as draft June 18, 2024 15:51
@smelc smelc force-pushed the smelc/treasury-donations branch 4 times, most recently from e6bda53 to 66ad2c5 Compare June 28, 2024 12:37
@smelc smelc force-pushed the smelc/treasury-donations branch from 66ad2c5 to 1d055c5 Compare July 1, 2024 08:07
@smelc smelc marked this pull request as ready for review July 1, 2024 08:08
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!

@@ -126,6 +128,7 @@ data TransactionBuildCmdArgs era = TransactionBuildCmdArgs
, mUpdateProposalFile :: !(Maybe (Featured ShelleyToBabbageEra era (Maybe UpdateProposalFile)))
, voteFiles :: ![(VoteFile In, Maybe (ScriptWitnessFiles WitCtxStake))]
, proposalFiles :: ![(ProposalFile In, Maybe (ScriptWitnessFiles WitCtxStake))]
, treasuryDonation :: !(Maybe TxTreasuryDonation)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

txUpdateProposal mOverrideWits votingProcedures proposals _outputOptions = shelleyBasedEraConstraints sbe $ do
txUpdateProposal mOverrideWits votingProcedures proposals
mCurrentTreasuryValue mTreasuryDonation
_outputOptions = shelleyBasedEraConstraints sbe $ do
Copy link
Contributor

Choose a reason for hiding this comment

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

Separately, can you investigate why we ignore _outputOptions?

@smelc smelc enabled auto-merge July 1, 2024 09:27
@smelc smelc disabled auto-merge July 1, 2024 09:57
@smelc smelc enabled auto-merge July 1, 2024 09:57
@smelc smelc disabled auto-merge July 1, 2024 13:15
@smelc smelc merged commit e4c0f56 into main Jul 1, 2024
19 of 22 checks passed
@smelc smelc deleted the smelc/treasury-donations branch July 1, 2024 13:15
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.

[FR] - Implement treasury donations on the CLI
3 participants