Skip to content

Commit

Permalink
Add golden test: conway governance hash script
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhammann committed Jan 15, 2024
1 parent dddef9d commit f8f652c
Show file tree
Hide file tree
Showing 4 changed files with 33 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 @@ -373,6 +373,7 @@ test-suite cardano-cli-golden
Test.Golden.Governance.Action
Test.Golden.Governance.Committee
Test.Golden.Governance.DRep
Test.Golden.Governance.Hash
Test.Golden.Governance.StakeAddress
Test.Golden.Governance.Vote
Test.Golden.Help
Expand Down
26 changes: 26 additions & 0 deletions cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Hash.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
{-# HLINT ignore "Use camelCase" #-}
module Test.Golden.Governance.Hash where
import Control.Monad

import Test.Cardano.CLI.Util

import Hedgehog (Property)
import qualified Hedgehog.Extras as H
import qualified Hedgehog.Extras.Test.Golden as H


hprop_golden_governance_hash_script :: Property
hprop_golden_governance_hash_script =
H.propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
scriptFile <- noteInputFile "test/cardano-cli-golden/files/input/governance/hash/foo.script"
hashFile <- H.noteTempFile tempDir "foo.script.hash"
hashGold <- H.note "test/cardano-cli-golden/files/golden/governance/hash/foo.script.hash"

void $ execCardanoCLI
[ "conway", "governance", "hash", "script"
, "--script-file", scriptFile
, "--out-file", hashFile
]

H.diffFileVsGoldenFile hashFile hashGold
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7dde1be4d1a2f617ac343dd7ef0388cf497c19ba8dab653a5b9eb1e2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "PlutusScriptV3",
"description": "",
"cborHex": "587458720101003232232322230033006900191480148888888888888888040300422590018c00a442b2600a005180044c010004300322590018c00a4432005225333573466e3c00801c60002600c0061800912c800c6001221801c80148a400644440064c0100042323001001223300330020020011"
}

0 comments on commit f8f652c

Please sign in to comment.