-
Notifications
You must be signed in to change notification settings - Fork 15
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 "conway governance hash" commands to "hash" #787
Conversation
de8b437
to
3abbac0
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.
Makes sense to me. I'm wondering if it would be a good idea to move other hashing commands into this subcommand (e.g. key hash).
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.
So the hint that hashing is not era based is in the type signature of hashAnchorData
:
hashAnchorData :: forall c. Crypto c => AnchorData -> SafeHash c AnchorData
Same for hashKey
etc...
And then if you take a look at ledger there is only one instance of Crypto
:
instance Crypto StandardCrypto where
type DSIGN StandardCrypto = Ed25519DSIGN
type KES StandardCrypto = Sum6KES Ed25519DSIGN Blake2b_256
type VRF StandardCrypto = PraosVRF
type HASH StandardCrypto = Blake2b_256
type ADDRHASH StandardCrypto = Blake2b_224
So what we really want is a top level command that can hash all the hashable things. Or at least not give the impression that hashing depends on the era.
cc @CarlosLopezDeLara since the current design is your ask from #782 I can make |
@smelc I like the idea! sounds great. |
3abbac0
to
2d0a701
Compare
e8972dc
to
601808c
Compare
@Jimbo4350> Made the command top-level and removed the era. I will consider in a follow-up PR if other hashing commands can be moved there too (hashing keys). |
085cd2e
to
72e643f
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! However I would be wary of breaking the existing hashing functionality. Talk to @CarlosLopezDeLara about this as it may be an annoying for users who have existing scripts etc.
{-# LANGUAGE LambdaCase #-} | ||
|
||
module Cardano.CLI.Commands.Hash | ||
( |
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.
Unnecessary newline
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.
Done 👍
@@ -48,8 +47,6 @@ data GovernanceCmds era | |||
(GovernanceCommitteeCmds era) | |||
| GovernanceDRepCmds | |||
(GovernanceDRepCmds era) | |||
| GovernanceHashCmds |
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 not sure I would break this immediately. Better to deprecate it first.
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 need to go through a deprecation period, as per @CarlosLopezDeLara's comment below 👇
{-# LANGUAGE GADTs #-} | ||
|
||
module Cardano.CLI.Options.Hash | ||
( |
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.
Unnecessary newline.
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.
Done 👍
I think we can afford the breaking change here since 9.0 is still in the makings and 8.12 will not cross the hardfork. I'll update docs after this is on a cardano-cli release. |
b13fb62
to
68048ca
Compare
68048ca
to
fe71860
Compare
@smelc there are a lot of leftovers in the help texts like:
pointing to the old location of the hash function |
@gitmachtl> yes, it's being fixed by #821. I think that's because I I lost some of my changes while polishing the PR |
Changelog
Context
Fixes #782