diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 708b30db93..91155427e4 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -397,6 +397,7 @@ test-suite cardano-cli-golden Test.Golden.Shelley.StakeAddress.Build Test.Golden.Shelley.StakeAddress.DeregistrationCertificate Test.Golden.Shelley.StakeAddress.KeyGen + Test.Golden.Shelley.StakeAddress.KeyHash Test.Golden.Shelley.StakeAddress.RegistrationCertificate Test.Golden.Shelley.StakePool.RegistrationCertificate Test.Golden.Shelley.TextEnvelope.Certificates.GenesisKeyDelegation diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/StakeAddress/KeyHash.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/StakeAddress/KeyHash.hs new file mode 100644 index 0000000000..214168e071 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/StakeAddress/KeyHash.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE OverloadedStrings #-} + +module Test.Golden.Shelley.StakeAddress.KeyHash where + +import Test.Cardano.CLI.Util as OP + +import Hedgehog (Property) +import qualified Hedgehog.Extras.Test.Base as H +import qualified Hedgehog.Extras.Test.Golden as H + +{- HLINT ignore "Use camelCase" -} + +hprop_golden_shelleyStakeAddressKeyHash :: Property +hprop_golden_shelleyStakeAddressKeyHash = propertyOnce . H.moduleWorkspace "tmp" $ \_ -> do + verificationKeyFile <- noteInputFile "test/cardano-cli-golden/files/input/shelley/keys/stake_keys/verification_key" + goldenVerificationKeyHashFile <- noteInputFile "test/cardano-cli-golden/files/input/shelley/keys/stake_keys/verification_key.key-hash" + + verificationKeyHash <- execCardanoCLI + [ "stake-address","key-hash" + , "--stake-verification-key-file", verificationKeyFile + ] + + H.diffVsGoldenFile verificationKeyHash goldenVerificationKeyHashFile diff --git a/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/stake_keys/verification_key.key-hash b/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/stake_keys/verification_key.key-hash new file mode 100644 index 0000000000..172c28d24d --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/stake_keys/verification_key.key-hash @@ -0,0 +1 @@ +81b4245f84593f63c0ff2296930254f77a0690fa9de5f969cac27cb0