Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Accept BLS signing keys, in text envelope and bech32 form, in `key verification-key`.
kind:
- bugfix
pr: 1502
project: cardano-cli
4 changes: 4 additions & 0 deletions cardano-cli/src/Cardano/CLI/Type/Key.hs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ data SomeSigningKey
| ACommitteeHotExtendedSigningKey (SigningKey CommitteeHotExtendedKey)
| AVrfSigningKey (SigningKey VrfKey)
| AKesSigningKey (SigningKey KesKey)
| ABlsSigningKey (SigningKey BlsKey)

withSomeSigningKey
:: ()
Expand Down Expand Up @@ -439,6 +440,7 @@ withSomeSigningKey ssk f =
ACommitteeHotExtendedSigningKey sk -> f sk
AVrfSigningKey sk -> f sk
AKesSigningKey sk -> f sk
ABlsSigningKey sk -> f sk

readSigningKeyFile
:: ()
Expand Down Expand Up @@ -471,6 +473,7 @@ readSigningKeyFile skFile =
, FromSomeType (AsSigningKey AsCommitteeHotExtendedKey) ACommitteeHotExtendedSigningKey
, FromSomeType (AsSigningKey AsVrfKey) AVrfSigningKey
, FromSomeType (AsSigningKey AsKesKey) AKesSigningKey
, FromSomeType (AsSigningKey AsBlsKey) ABlsSigningKey
]

bech32FileTypes =
Expand All @@ -482,6 +485,7 @@ readSigningKeyFile skFile =
, FromSomeType (AsSigningKey AsStakePoolExtendedKey) AStakePoolExtendedSigningKey
, FromSomeType (AsSigningKey AsVrfKey) AVrfSigningKey
, FromSomeType (AsSigningKey AsKesKey) AKesSigningKey
, FromSomeType (AsSigningKey AsBlsKey) ABlsSigningKey
]

-- | Source for hashes of stake pool keys (potentially extended)
Expand Down
21 changes: 15 additions & 6 deletions cardano-cli/test/cardano-cli-test/Test/Cli/VerificationKey.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,35 @@ import Hedgehog.Extras.Test.Base qualified as H
-- @cabal test cardano-cli-test --test-options '-p "/verification key drep/"'@
hprop_verification_key_drep :: Property
hprop_verification_key_drep =
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ runOne ["drep", "key-gen"]
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $
runOne ["conway", "governance", "drep", "key-gen"]

-- | Execute me with:
-- @cabal test cardano-cli-test --test-options '-p "/verification key committee hot/"'@
hprop_verification_key_committee_hot :: Property
hprop_verification_key_committee_hot =
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ runOne ["committee", "key-gen-hot"]
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $
runOne ["conway", "governance", "committee", "key-gen-hot"]

-- | Execute me with:
-- @cabal test cardano-cli-test --test-options '-p "/verification key committee cold/"'@
hprop_verification_key_committee_cold :: Property
hprop_verification_key_committee_cold =
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ runOne ["committee", "key-gen-cold"]
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $
runOne ["conway", "governance", "committee", "key-gen-cold"]

-- | Execute me with:
-- @cabal test cardano-cli-test --test-options '-p "/verification key bls/"'@
hprop_verification_key_bls :: Property
hprop_verification_key_bls =
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $
runOne ["dijkstra", "node", "key-gen-BLS"]

runOne
:: ()
=> (HasCallStack, MonadCatch m, MonadIO m, MonadTest m)
=> [String]
-- ^ The piece of the command to generate the keys
-- ^ The command to generate the keys
-> FilePath
-- ^ The temporary directory, i.e. where the test is allowed to generate files
-> m ()
Expand All @@ -46,8 +56,7 @@ runOne cmd tempDir = GHC.withFrozenCallStack $ do

H.noteM_ $
execCardanoCLI $
["conway", "governance"]
++ cmd
cmd
++ [ "--verification-key-file"
, verificationKeyFile
, "--signing-key-file"
Expand Down
Loading