Skip to content

Commit

Permalink
Remove dependency to golden-test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Sep 30, 2024
1 parent 710ef81 commit 89e267d
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions cardano-cli/test/cardano-cli-test/Test/Cli/Governance/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import Control.Monad.Catch (MonadCatch)
import Control.Monad.Trans.Control (MonadBaseControl)

import Test.Cardano.CLI.Hash (exampleAnchorDataHash, exampleAnchorDataIpfsHash,
exampleAnchorDataPathGolden, serveFilesWhile, tamperBase16Hash)
exampleAnchorDataPathTest, serveFilesWhile, tamperBase16Hash)
import Test.Cardano.CLI.Util (execCardanoCLI, execCardanoCLIWithEnvVars, expectFailure,
noteInputFile, propertyOnce)
propertyOnce)

import Hedgehog
import qualified Hedgehog as H
Expand Down Expand Up @@ -112,13 +112,26 @@ hprop_golden_governance_drep_registration_certificate_vkey_file =
base_golden_governance_drep_registration_certificate_vkey_file
:: (MonadBaseControl IO m, MonadTest m, MonadIO m, MonadCatch m) => String -> FilePath -> m ()
base_golden_governance_drep_registration_certificate_vkey_file hash tempDir = do
drepVKeyFile <- noteInputFile "test/cardano-cli-golden/files/input/drep.vkey"
drepVKeyFile <- H.noteTempFile tempDir "drep.vkey"
drepSKeyFile <- H.noteTempFile tempDir "drep.skey"

H.noteShowM_ $
execCardanoCLI
[ "conway"
, "governance"
, "drep"
, "key-gen"
, "--verification-key-file"
, drepVKeyFile
, "--signing-key-file"
, drepSKeyFile
]

outFile <- H.noteTempFile tempDir "drep-reg-cert.txt"

let relativeUrl = ["ipfs", exampleAnchorDataIpfsHash]
serveFilesWhile
[(relativeUrl, exampleAnchorDataPathGolden)]
[(relativeUrl, exampleAnchorDataPathTest)]
( \port -> do
void $
execCardanoCLIWithEnvVars
Expand Down Expand Up @@ -159,13 +172,26 @@ hprop_golden_governance_drep_update_certificate_vkey_file =
base_golden_governance_drep_update_certificate_vkey_file
:: (MonadBaseControl IO m, MonadTest m, MonadIO m, MonadCatch m) => String -> FilePath -> m ()
base_golden_governance_drep_update_certificate_vkey_file hash tempDir = do
drepVKeyFile <- noteInputFile "test/cardano-cli-golden/files/input/drep.vkey"
drepVKeyFile <- H.noteTempFile tempDir "drep.vkey"
drepSKeyFile <- H.noteTempFile tempDir "drep.skey"

H.noteShowM_ $
execCardanoCLI
[ "conway"
, "governance"
, "drep"
, "key-gen"
, "--verification-key-file"
, drepVKeyFile
, "--signing-key-file"
, drepSKeyFile
]

outFile <- H.noteTempFile tempDir "drep-upd-cert.txt"

let relativeUrl = ["ipfs", exampleAnchorDataIpfsHash]
serveFilesWhile
[(relativeUrl, exampleAnchorDataPathGolden)]
[(relativeUrl, exampleAnchorDataPathTest)]
( \port -> do
void $
execCardanoCLIWithEnvVars
Expand Down

0 comments on commit 89e267d

Please sign in to comment.