Skip to content

Commit

Permalink
Add golden test
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosLopezDeLara committed Sep 5, 2024
1 parent 1f0ae04 commit e3dd380
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,23 @@ hprop_golden_governance_drep_update_certificate_vkey_file = propertyOnce . H.mod
]

H.diffFileVsGoldenFile outFile goldenFile

-- | Execute me with:
-- @cabal test cardano-cli-golden --test-options '-p "/golden governance drep update certificate script hash/"'@
hprop_golden_governance_drep_update_certificate_script_hash :: Property
hprop_golden_governance_drep_update_certificate_script_hash = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
goldenFile <- H.note "test/cardano-cli-golden/files/golden/governance/drep/drep_update_certificate_script_hash.json"
outFile <- H.noteTempFile tempDir "drep-upd-cert.txt"

void $ execCardanoCLI
[ "conway", "governance", "drep", "update-certificate"
, "--drep-script-hash", "8f33600845940d65bdbc7ea7a247a7997aa8558649128fa82c4c0468"
, "--drep-metadata-url", "https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld"
, "--drep-metadata-hash", "fecc1773db89b45557d82e07719c275f6877a6cadfd2469f4dc5a7df5b38b4a4"
, "--out-file", outFile
]

H.diffFileVsGoldenFile outFile goldenFile

-- | Execute me with:
-- @cabal test cardano-cli-golden --test-options '-p "/golden verification key drep/"'@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "CertificateConway",
"description": "DRep Update Certificate",
"cborHex": "83128201581c8f33600845940d65bdbc7ea7a247a7997aa8558649128fa82c4c046882785e68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f63617264616e6f2d666f756e646174696f6e2f434950732f6d61737465722f4349502d303131392f6578616d706c65732f647265702e6a736f6e6c645820fecc1773db89b45557d82e07719c275f6877a6cadfd2469f4dc5a7df5b38b4a4"
}

0 comments on commit e3dd380

Please sign in to comment.