diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs index 3bf669bf8f..8718f8c270 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {- HLINT ignore "Use camelCase" -} @@ -8,9 +9,11 @@ import Control.Monad (forM_, void) import System.FilePath (()) import Test.Cardano.CLI.Aeson (assertHasMappings) +import qualified Test.Cardano.CLI.Util as H hiding (noteTempFile) import Test.Cardano.CLI.Util import Hedgehog (Property) +import qualified Hedgehog as H import qualified Hedgehog.Extras.Test.Base as H import qualified Hedgehog.Extras.Test.Golden as H @@ -205,3 +208,21 @@ hprop_golden_verification_key_committee = do ] H.diffFileVsGoldenFile vkeyFileOut vkeyGolden + +-- | Execute me with: +-- @cabal test cardano-cli-golden --test-options '-p "/golden governance extended committee key hash/"'@ +hprop_golden_governance_extended_committee_key_hash :: Property +hprop_golden_governance_extended_committee_key_hash = + let supplyValues = [ (inputDir "governance/committee/cc.extended.cold.vkey", "9fe92405abcd903d34e21a97328e7cd222eebd4ced5995a95777f7a3\n") + , (inputDir "governance/committee/cc.extended.hot.vkey", "4eb7202ffcc6d5513dba5edc618bd7b582a257c76d6b0cd83975f4e6\n") + ] in + propertyOnce $ forM_ supplyValues $ \(extendedKeyFile, expected) -> + H.moduleWorkspace "tmp" $ \_tempDir -> do + verificationKeyFile <- H.noteInputFile extendedKeyFile + + result <- execCardanoCLI + [ "conway", "governance", "committee", "key-hash" + , "--verification-key-file", verificationKeyFile + ] + + result H.=== expected diff --git a/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.cold.vkey b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.cold.vkey new file mode 100644 index 0000000000..c2a21b6a0d --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.cold.vkey @@ -0,0 +1,5 @@ +{ + "type": "ConstitutionalCommitteeColdExtendedVerificationKey_ed25519_bip32", + "description": "", + "cborHex": "58400a9d35aa5299580a67b1e43a3a4b6d43ef29c94e56c51ce4c17e9a53c1d0f39aa7f68837c38ef680b2dc8f047581707a32f6fcade23d4e02177d389002484798" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.hot.vkey b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.hot.vkey new file mode 100644 index 0000000000..9cb85beea6 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.hot.vkey @@ -0,0 +1,5 @@ +{ + "type": "ConstitutionalCommitteeHotExtendedVerificationKey_ed25519_bip32", + "description": "", + "cborHex": "5840f010c4332699c6ea1e43b427919860277169382d43d2969b28a110cfa08d955c4f178f20955541ce918a6a1352c32536f22677008f9f918d109663e4d2bdc084" +}