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 Plutus script hash support in update-committee, overnance committee create-cold-key-resignation-certificate and query committee-state commands. #658

Merged
merged 8 commits into from
Mar 20, 2024

Conversation

carbolymer
Copy link
Contributor

@carbolymer carbolymer commented Mar 18, 2024

Changelog

- description: |
    Add Plutus script hash support in `update-committee`, `overnance committee create-cold-key-resignation-certificate` and `query committee-state` commands.
# 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
   - improvement    # QoL changes e.g. refactoring
  # - 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

This PR consists of two commits:

  1. Refactoring extending use of MonadTransIOError
  2. Implementation of plutus script hash in update-committee.

It is better to review this PR commit-by-commit.

Requires changes from the following PR to compile successfully:

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

@carbolymer carbolymer force-pushed the mgalazyn/feature/script-support-in-update-committe branch from 50f710a to c4d4a94 Compare March 18, 2024 21:06
@carbolymer carbolymer marked this pull request as ready for review March 18, 2024 21:06
stakeVKeyHash <- firstExceptT AddressCmdReadKeyFileError $
newExceptT $ readVerificationKeyOrHashOrFile AsStakeKey stkVkeyOrFile

stakeVKeyHash <- modifyError AddressCmdReadKeyFileError $
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍 I've always found those firstExcepT _ $ newExceptT a bit clunky.

@carbolymer carbolymer force-pushed the mgalazyn/feature/script-support-in-update-committe branch from c4d4a94 to 4f423d5 Compare March 19, 2024 12:09
@carbolymer carbolymer marked this pull request as draft March 19, 2024 13:36
@carbolymer carbolymer force-pushed the mgalazyn/feature/script-support-in-update-committe branch 4 times, most recently from 7d65f7d to df8c56a Compare March 19, 2024 16:43
@carbolymer carbolymer marked this pull request as ready for review March 19, 2024 16:43
@carbolymer carbolymer linked an issue Mar 19, 2024 that may be closed by this pull request
18 tasks
@carbolymer carbolymer force-pushed the mgalazyn/feature/script-support-in-update-committe branch from ada9409 to e0bdbcf Compare March 19, 2024 17:10
cardano-cli/src/Cardano/CLI/Types/Key.hs Outdated Show resolved Hide resolved
cardano-cli/src/Cardano/CLI/Types/Key.hs Outdated Show resolved Hide resolved
Comment on lines +168 to +171
{ Cmd.eon
, Cmd.vkeyColdKeySource
, Cmd.anchor
, Cmd.outFile
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice usage of punning to reduce noise 👍

Copy link
Contributor

@CarlosLopezDeLara CarlosLopezDeLara left a comment

Choose a reason for hiding this comment

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

Tested both the governance action and the resignation certificate. Both work as expected!

@carbolymer carbolymer force-pushed the mgalazyn/feature/script-support-in-update-committe branch from 52ec0c1 to 5a2bd72 Compare March 20, 2024 11:05
@@ -686,11 +690,26 @@ pAddCommitteeColdVerificationKeyFile =
]

---
pRemoveCommitteeColdVerificationKeyOrHashOrFile :: Parser (VerificationKeyOrHashOrFile CommitteeColdKey)
pRemoveCommitteeColdVerificationKeyOrHashOrFile :: Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

If being nitpicky, this function should be named pRemoveCommitteeColdVerificationKeyOrHashOrFileOrScriptHash (note the additional suffix).

But probably this is overkill, since this is also indicated in the return type. So maybe just rename to pRemoveCommitteeColdVerificationKeySource?

The same remark applies to pAddCommitteeColdVerificationKeyOrHashOrFile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that's a good idea. I think we can go with source since it's a single-use parser and it would define what's happening in an unique way.

@carbolymer carbolymer linked an issue Mar 20, 2024 that may be closed by this pull request
@carbolymer carbolymer force-pushed the mgalazyn/feature/script-support-in-update-committe branch from 80e8f4b to 3f8ed28 Compare March 20, 2024 14:41
@carbolymer carbolymer force-pushed the mgalazyn/feature/script-support-in-update-committe branch 2 times, most recently from fabae22 to 5b66907 Compare March 20, 2024 16:25
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.

Thanks, code looks much neater now. Just a couple of lints

cardano-cli/src/Cardano/CLI/Types/Key.hs Outdated Show resolved Hide resolved
cardano-cli/src/Cardano/CLI/Types/Key.hs Outdated Show resolved Hide resolved
cardano-cli/src/Cardano/CLI/Types/Key.hs Outdated Show resolved Hide resolved
@carbolymer carbolymer force-pushed the mgalazyn/feature/script-support-in-update-committe branch from f87ae78 to cdf58a7 Compare March 20, 2024 18:01
@carbolymer carbolymer added this pull request to the merge queue Mar 20, 2024
Merged via the queue into main with commit 372aa48 Mar 20, 2024
18 checks passed
@carbolymer carbolymer deleted the mgalazyn/feature/script-support-in-update-committe branch March 20, 2024 18:58
@carbolymer carbolymer changed the title Add plutus script hash support for update-committee Add Plutus script hash support in update-committee, overnance committee create-cold-key-resignation-certificate and query committee-state commands. Mar 26, 2024
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.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants