diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/DRep.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/DRep.hs index 7dea7340a8..380380c44e 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/DRep.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/DRep.hs @@ -4,7 +4,7 @@ module Test.Golden.Governance.DRep where import Control.Monad (void) -import Test.Cardano.CLI.Util (execCardanoCLI, noteInputFile, propertyOnce, noteTempFile) +import Test.Cardano.CLI.Util (execCardanoCLI, noteInputFile, noteTempFile, propertyOnce) import Hedgehog import qualified Hedgehog as H @@ -94,3 +94,21 @@ hprop_golden_governance_drep_metadata_hash = propertyOnce . H.moduleWorkspace "t ] H.diffFileVsGoldenFile goldenDRepMetadataHash outputDRepMetadataHash + +hprop_golden_governance_drep_registration_certificate :: Property +hprop_golden_governance_drep_registration_certificate = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + drepKeyFile <- noteInputFile "test/cardano-cli-golden/files/golden/governance/drep/drep.vkey" + goldenFile <- noteInputFile "test/cardano-cli-golden/files/golden/governance/drep/drep_registration_certificate.json" + + outFile <- H.noteTempFile tempDir "drep-reg-cert.txt" + + void $ execCardanoCLI + [ "conway", "governance", "drep", "registration-certificate" + , "--drep-verification-key-file", drepKeyFile + , "--key-reg-deposit-amt", "0" + , "--drep-metadata-url", "dummy-url" + , "--drep-metadata-hash", "52e69500a92d80f2126c836a4903dc582006709f004cf7a28ed648f732dff8d2" + , "--out-file", outFile + ] + + H.diffFileVsGoldenFile goldenFile outFile diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/drep/drep.vkey b/cardano-cli/test/cardano-cli-golden/files/golden/governance/drep/drep.vkey new file mode 100644 index 0000000000..ac1c19f7cd --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/drep/drep.vkey @@ -0,0 +1,5 @@ +{ + "type": "DRepVerificationKey_ed25519", + "description": "Delegate Representative Verification Key", + "cborHex": "582063a24b920d31119c5b06bd7bf64941b215f2de501b3ec7d2a7e65081fb4e999c" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/drep/drep_registration_certificate.json b/cardano-cli/test/cardano-cli-golden/files/golden/governance/drep/drep_registration_certificate.json new file mode 100644 index 0000000000..c1cc305cb9 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/drep/drep_registration_certificate.json @@ -0,0 +1,5 @@ +{ + "type": "CertificateShelley", + "description": "DRep Key Registration Certificate", + "cborHex": "84108200581ce68f9ee70599cb93d9f60678f9c6463c01938c27d9820c7bf93887a500826964756d6d792d75726c582052e69500a92d80f2126c836a4903dc582006709f004cf7a28ed648f732dff8d2" +}