Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import qualified Hedgehog.Extras.Test.Base as H
import qualified Hedgehog.Extras.Test.Golden as H
import qualified Hedgehog.Extras.Test.Process as H

-- | Semaphore protecting against locked file error, when running properties concurrently.
regCertificate2Sem :: FileSem
regCertificate2Sem = newFileSem "test/cardano-cli-golden/files/golden/shelley/stake-address/reg-certificate-2.json"
{-# NOINLINE regCertificate2Sem #-}

{- HLINT ignore "Use camelCase" -}

hprop_golden_shelley_stake_address_registration_certificate :: Property
Expand Down Expand Up @@ -77,7 +82,7 @@ hprop_golden_shelley_stake_address_registration_certificate_with_build_raw = pro

goldenFile1 <-
H.note "test/cardano-cli-golden/files/golden/shelley/stake-address/reg-certificate-2.json"
H.diffFileVsGoldenFile registrationCertFile goldenFile1
bracketSem regCertificate2Sem $ H.diffFileVsGoldenFile goldenFile1

void $
execCardanoCLI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Test.Cardano.CLI.Util

import Hedgehog
import qualified Hedgehog.Extras as H
import Test.Golden.Shelley.StakeAddress.RegistrationCertificate (regCertificate2Sem)

inputDir :: FilePath
inputDir = "test/cardano-cli-test/files/input/shelley/transaction"
Expand All @@ -36,8 +37,6 @@ hprop_compatible_conway_transaction_build_one_voter_many_votes = propertyOnce $
, "addr_test1vpfwv0ezc5g8a4mkku8hhy3y3vp92t7s3ul8g778g5yegsgalc6gc+24910487859"
, "--fee"
, "178569"
, "--certificate-file"
, "test/cardano-cli-golden/files/golden/shelley/stake-address/reg-certificate-2.json"
, "--certificate-script-file"
, "test/cardano-cli-golden/files/input/AlwaysSucceeds.plutus"
, "--certificate-redeemer-value"
Expand All @@ -47,27 +46,31 @@ hprop_compatible_conway_transaction_build_one_voter_many_votes = propertyOnce $
]

-- reference transaction
_ <-
_ <- bracketSem regCertificate2Sem $ \regFile ->
execCardanoCLI $
[ eraName
, "transaction"
, "build-raw"
]
<> args
<> [ "--out-file"
<> [ "--certificate-file"
, regFile
, "--out-file"
, refOutFile
]

-- tested compatible transaction
_ <-
_ <- bracketSem regCertificate2Sem $ \regFile ->
execCardanoCLI $
[ "compatible"
, eraName
, "transaction"
, "signed-transaction"
]
<> args
<> [ "--out-file"
<> [ "--certificate-file"
, regFile
, "--out-file"
, outFile
]

Expand Down
Loading