diff --git a/.changes/20261111_162405_cardano-cli_pablo.lamela_bls_verification_key.yml b/.changes/20261111_162405_cardano-cli_pablo.lamela_bls_verification_key.yml new file mode 100644 index 0000000000..95dd424129 --- /dev/null +++ b/.changes/20261111_162405_cardano-cli_pablo.lamela_bls_verification_key.yml @@ -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 diff --git a/cardano-cli/src/Cardano/CLI/Type/Key.hs b/cardano-cli/src/Cardano/CLI/Type/Key.hs index 05d2786350..bac03d6af7 100644 --- a/cardano-cli/src/Cardano/CLI/Type/Key.hs +++ b/cardano-cli/src/Cardano/CLI/Type/Key.hs @@ -411,6 +411,7 @@ data SomeSigningKey | ACommitteeHotExtendedSigningKey (SigningKey CommitteeHotExtendedKey) | AVrfSigningKey (SigningKey VrfKey) | AKesSigningKey (SigningKey KesKey) + | ABlsSigningKey (SigningKey BlsKey) withSomeSigningKey :: () @@ -439,6 +440,7 @@ withSomeSigningKey ssk f = ACommitteeHotExtendedSigningKey sk -> f sk AVrfSigningKey sk -> f sk AKesSigningKey sk -> f sk + ABlsSigningKey sk -> f sk readSigningKeyFile :: () @@ -471,6 +473,7 @@ readSigningKeyFile skFile = , FromSomeType (AsSigningKey AsCommitteeHotExtendedKey) ACommitteeHotExtendedSigningKey , FromSomeType (AsSigningKey AsVrfKey) AVrfSigningKey , FromSomeType (AsSigningKey AsKesKey) AKesSigningKey + , FromSomeType (AsSigningKey AsBlsKey) ABlsSigningKey ] bech32FileTypes = @@ -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) diff --git a/cardano-cli/test/cardano-cli-test/Test/Cli/VerificationKey.hs b/cardano-cli/test/cardano-cli-test/Test/Cli/VerificationKey.hs index d657ce545f..6d4c85709b 100644 --- a/cardano-cli/test/cardano-cli-test/Test/Cli/VerificationKey.hs +++ b/cardano-cli/test/cardano-cli-test/Test/Cli/VerificationKey.hs @@ -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 () @@ -46,8 +56,7 @@ runOne cmd tempDir = GHC.withFrozenCallStack $ do H.noteM_ $ execCardanoCLI $ - ["conway", "governance"] - ++ cmd + cmd ++ [ "--verification-key-file" , verificationKeyFile , "--signing-key-file"