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

Move parsing helpers from API #894

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Sep 12, 2024

Changelog

- description: |
    Adapts to https://github.com/IntersectMBO/cardano-api/pull/635
# 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

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

Code compiling suffices, because this PR doesn't change the runtime behavior.

Checklist

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

@smelc smelc force-pushed the smelc/adapt-to-api-removal-of-optparse branch from 3637569 to db1c97a Compare September 12, 2024 13:58
cardano-cli/src/Cardano/CLI/Helpers.hs Outdated Show resolved Hide resolved
@@ -101,6 +106,22 @@ ensureNewFile writer outFile blob = do
ensureNewFileLBS :: FilePath -> ByteString -> ExceptT HelpersError IO ()
ensureNewFileLBS = ensureNewFile BS.writeFile

bounded :: forall a. (Bounded a, Integral a, Show a) => String -> Opt.ReadM a
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used?

Copy link
Contributor Author

@smelc smelc Sep 12, 2024

Choose a reason for hiding this comment

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

Here:

Opt.option (bounded "TESTNET_MAGIC") $

(and in multiple other places in this file)

cabal.project Outdated
@@ -58,3 +58,8 @@ write-ghc-environment-files: always
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

source-repository-package
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need SRP for this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially I wanted to show this was compatible with IntersectMBO/cardano-api#635, but yeah you're right. Removed the SRP.

@smelc smelc force-pushed the smelc/adapt-to-api-removal-of-optparse branch from 204cc97 to 854e56e Compare September 12, 2024 15:14
@smelc smelc marked this pull request as ready for review September 12, 2024 15:19
@smelc smelc mentioned this pull request Sep 12, 2024
2 tasks
Base automatically changed from smelc/share-code-in-filepaths-parsers to main September 12, 2024 15:21
An error occurred while trying to automatically change base from smelc/share-code-in-filepaths-parsers to main September 12, 2024 15:21
@smelc smelc force-pushed the smelc/adapt-to-api-removal-of-optparse branch from 854e56e to 0e0a107 Compare September 12, 2024 15:33
@smelc smelc force-pushed the smelc/adapt-to-api-removal-of-optparse branch from 0e0a107 to fcec670 Compare September 16, 2024 19:06
@smelc smelc added this pull request to the merge queue Sep 17, 2024
Merged via the queue into main with commit ca49409 Sep 17, 2024
25 checks passed
@smelc smelc deleted the smelc/adapt-to-api-removal-of-optparse branch September 17, 2024 05:22
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