-
Notifications
You must be signed in to change notification settings - Fork 720
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
Tidy up query tip output #2885
Tidy up query tip output #2885
Conversation
|
bors merge |
Build succeeded: |
@@ -0,0 +1,47 @@ | |||
module Cardano.CLI.Shelley.Output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@newhoggy This would have been better placed in Cardano.CLI.Types
rather than creating a separate module.
|
||
case mOutFile of | ||
Just (OutputFile fpath) -> liftIO $ LBS.writeFile fpath output | ||
Nothing -> liftIO $ LBS.putStrLn output | ||
|
||
mode -> left (ShelleyQueryCmdUnsupportedMode (AnyConsensusMode mode)) | ||
|
||
where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
let jsonSyncProgress = either | ||
identity (toJSON . flip (percentage tolerance) nowSeconds) tipTimeResult | ||
|
||
let output = encodePretty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this is way cleaner 👍
Remove unnecessary fields and ensure the output fields are in a sensible order using the
toEncoding
function.