Skip to content

Commit

Permalink
Merge pull request #418 from input-output-hk/mkoura/add_stake_address…
Browse files Browse the repository at this point in the history
…_key_hash_test

Add golden test for stake-address key-hash command
  • Loading branch information
newhoggy authored Nov 1, 2023
2 parents d168465 + 6de5116 commit 43976ce
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
81b4245f84593f63c0ff2296930254f77a0690fa9de5f969cac27cb0

0 comments on commit 43976ce

Please sign in to comment.