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

Share code in fields of queries #985

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Nov 29, 2024

Changelog

- description: |
    Share code in fields of queries
# 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 #983

How to trust this PR

  • This is one of the PRs where, if it typechecks, it works.
  • -292+225

Checklist

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

@smelc smelc force-pushed the smelc/share-code-in-fields-of-queries branch from 4aff890 to 4a6f48c Compare November 29, 2024 17:22
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.

We should exclude the output file from the refactor. It's a UI wart IMO but the rest of the refactor is 👍. I'm sure @CarlosLopezDeLara would agree here. I also think leaving the original out-file help is more informative.

--op-cert-file FILEPATH Filepath of the node's operational certificate.
--out-file FILEPATH Optional output file. Default is to write to stdout.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the change? It was more informative before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted this to use the better message 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(the difference was between using optional pOutputFile and pMaybeOutputFile. The latter has the better message and I made sure to use it everywhere now)

( --mainnet
| --testnet-magic NATURAL
)
[--out-file FILEPATH]
--address ADDRESS
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the downside of the refactor. It affects the parsers and I would argue having --out-file as the last argument is more natural. More and more I wish for monadic parsers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I agree too and was wondering after the initial golden files changes myself.

I pulled mOutFile out of the QueryCommons type and made sure that --out-file is the last argument in every query 👍

@smelc smelc force-pushed the smelc/share-code-in-fields-of-queries branch 2 times, most recently from c7f6ece to ddea918 Compare December 2, 2024 15:27
@smelc smelc force-pushed the smelc/share-code-in-fields-of-queries branch from ddea918 to 530f929 Compare December 2, 2024 15:37
@smelc smelc enabled auto-merge December 2, 2024 15:46
@smelc smelc added this pull request to the merge queue Dec 2, 2024
Merged via the queue into master with commit 0e98188 Dec 2, 2024
24 of 25 checks passed
@smelc smelc deleted the smelc/share-code-in-fields-of-queries branch December 2, 2024 17:24
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.

Reduce duplication in Commands/Query.hs
2 participants