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
cli: Add 'shelley query ledger-state' command #1016
Conversation
666051d
to
3611e19
Compare
@@ -155,27 +192,27 @@ runQueryStakeDistribution network mOutFile = do | |||
let ptclClientInfo = pClientInfoCodecConfig . protocolClientInfo $ mkNodeClientProtocolTPraos | |||
tip <- liftIO $ withIOManager $ \iomgr -> | |||
getLocalTip iomgr ptclClientInfo network sockPath | |||
stakeDistr <- firstExceptT NodeLocalStateQueryError $ | |||
stakeDist <- firstExceptT NodeLocalStateQueryError $ |
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.
These changes were required to avoid name shadowing warnings.
3611e19
to
3bee0d9
Compare
3bee0d9
to
d636485
Compare
This command queries the node to the LedgerState to be returned as CBOR-in-CBOR. If the node and the cli are compatible, the LedgerState will be printed as JSON. If they are incompatible it will be printed as generic decoded CBOR.
d636485
to
ba755ab
Compare
=> Network | ||
-> SocketPath | ||
-> Point blk | ||
-> ExceptT LocalStateQueryError IO (Either LByteString (Ledger.LedgerState TPraosStandardCrypto)) |
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.
Shouldn't we move that LByteString
error into LocalStateQueryError
as a new constructor?
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.
No, these really are two different things. If CBOR decoding is successful, the return the LedgerState
. If decoding fails, return the ByteString.
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.
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, one comment.
bors r+ |
Build succeeded |
No description provided.