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

Plug *-poll legacy commands back #349

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Oct 9, 2023

Changelog

- description: |
    Bring back legacy *-poll 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

@newhoggy witnessed after #322 merge that it was removing two many cmomands: the legacy voting commands should have been kept.

This PR brings back the legacy poll commands.

Fix #340

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • The change log section in the PR description has been filled in
  • NA New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • round trip tests
    • integration tests
      See Running tests for more details
  • NA The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • Self-reviewed the diff

@smelc smelc force-pushed the smelc/replug-poll-legacy-commands branch 3 times, most recently from e2a4f8a to 2810fa1 Compare October 9, 2023 13:47
@smelc smelc force-pushed the smelc/replug-poll-legacy-commands branch 3 times, most recently from f659c2a to 34ca701 Compare October 9, 2023 19:50
@smelc smelc marked this pull request as ready for review October 9, 2023 19:51

runGovernanceCreatePoll
:: BabbageEraOnwards era
Copy link
Contributor

Choose a reason for hiding this comment

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

Change this to be BabbageEraOnly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't yet, because we need a release of cardano-api to bring the PR introducing BabbageEraOnly. But I will do so when possible 👍

@smelc smelc force-pushed the smelc/replug-poll-legacy-commands branch 2 times, most recently from 86eb26d to 7d3d364 Compare October 10, 2023 10:51
@newhoggy newhoggy self-requested a review October 10, 2023 12:04
( runGovernancePollCmds,
runGovernanceCreatePoll, {- For legacy caller only -}
runGovernanceAnswerPoll, {- For legacy caller only -}
runGovernanceVerifyPoll {- For legacy caller only -}
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to add a comment here. It is okay to export run commands even if no-one uses them.

In fact, it is preferred in case we want to change the tests to use these instead of the CLI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed 👍

| GovernanceVerifyPoll
(File GovernancePoll In) -- Poll file
(File (Tx ()) In) -- Tx file
(Maybe (File () Out)) -- Tx file
Copy link
Contributor

Choose a reason for hiding this comment

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

Comments are good. If used, then use -- ^.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch 👍 Changed.

{- TODO replace BabbageEraOnwardsBabbage by BabbageEraOnlyBabbage when available -}
runGovernanceAnswerPoll BabbageEraOnwardsBabbage poll ix mOutFile
GovernanceVerifyPoll poll metadata mOutFile ->
{- TODO replace BabbageEraOnwardsBabbage by BabbageEraOnlyBabbage when available -}
Copy link
Contributor

@newhoggy newhoggy Oct 10, 2023

Choose a reason for hiding this comment

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

We shouldn't have to add these comments because when the run command's eon witness type is changed we will get a type error here and know to change it.

In any case, I originally asked for this to be changed to BabbageEraOnly. I now think we should keep the eon type as it is. When we hard fork to Conway, users of this command should still expect this to continue working.

We can deprecate it post-Conway hard-fork.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the comments 👍

You're right, I add in mind those poll commands where babbage only, but this is the legacy part we're speaking here; so it doesn't apply.

@newhoggy newhoggy self-requested a review October 10, 2023 12:11
@smelc smelc force-pushed the smelc/replug-poll-legacy-commands branch from 7d3d364 to 77b483d Compare October 10, 2023 12:59
@smelc smelc enabled auto-merge October 10, 2023 12:59
@smelc smelc added this pull request to the merge queue Oct 10, 2023
Merged via the queue into main with commit 0fef8a4 Oct 10, 2023
@smelc smelc deleted the smelc/replug-poll-legacy-commands branch October 10, 2023 14:51
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.

Plug *-poll legacy commands back
2 participants