-
Notifications
You must be signed in to change notification settings - Fork 23
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
Small improvements to queries #559
Conversation
97292c7
to
d174341
Compare
07c3bcf
to
58664b9
Compare
db0e822
to
fe7c6e7
Compare
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.
LGTM but I disagree with StateForBalancedTx
. It's not necessary and IMO it takes away from code readability.
@@ -69,22 +71,26 @@ renderQueryConvenienceError (QceUnsupportedNtcVersion (UnsupportedNtcVersionErro | |||
"This query requires at least " <> textShow minNtcVersion <> " but the node negotiated " <> textShow ntcVersion <> ".\n" <> | |||
"Later node versions support later protocol versions (but development protocol versions are not enabled in the node by default)." | |||
|
|||
-- | Data returned by 'queryStateForBalancedTx'. Parameterized on the type of 'eraHistory', | |||
-- because sometimes we don't need it. | |||
data StateForBalancedTx history era = StateForBalancedTx |
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.
I don't think this refactor is necessary. It's better to explicitly have the parameters needed rather than introduce a new data type with an additional type variable is sometimes ()
or EraHistory
. This is also introducing more churn in the cli for not much benefit.
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.
The thing is, I'm adding another member to this record in this follow-up PR: #557
If we don't add this record, this follow-up PR will make queryStateForBalancedTx
return yet another value, which I think is not really nice.
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.
I'm also unsure about this new datatype. But I think my gripe is parameterisation by history
. I think having a single type parameter and returning a product (EraHistory, StateForBalancedTx era)
where needed instead, would be cleaner.
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.
Alright, let me scratch the new datatype then 👍 (@carbolymer> I think it'd be weird if StateForBalancedTx
didn't return all values, so I'm not keen on the product version)
@@ -842,133 +845,123 @@ fromConsensusQueryResultShelleyBased | |||
-> Consensus.BlockQuery (Consensus.ShelleyBlock protocol ledgerera) result' | |||
-> result' | |||
-> result |
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.
👍
fe7c6e7
to
22dbb35
Compare
Changelog
Context
fromConsensusQueryResultShelleyBased
more maintainable.How to trust this PR
Checklist