From 465a054c98fd1e77f5c6c9c7bcdcc11f340bcc84 Mon Sep 17 00:00:00 2001 From: Carlos LopezDeLara Date: Mon, 30 Sep 2024 12:07:56 -0600 Subject: [PATCH] add golden test for `stake_reg_deleg_cert` add golden test for `stake_reg_deleg_cert` update golden files --- .../Test/Golden/Governance/StakeAddress.hs | 26 +++++++++++++ .../registerAddressDelegateToPool.cert | 5 +++ .../cardano-cli-golden/files/golden/help.cli | 38 +++++++++++++++++++ .../golden/help/conway_stake-address.cli | 6 +++ ...egistration-and-delegation-certificate.cli | 38 +++++++++++++++++++ .../golden/help/latest_stake-address.cli | 6 +++ ...egistration-and-delegation-certificate.cli | 38 +++++++++++++++++++ 7 files changed, 157 insertions(+) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/governance/stakeaddress/registerAddressDelegateToPool.cert create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address_registration-and-delegation-certificate.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address_registration-and-delegation-certificate.cli diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/StakeAddress.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/StakeAddress.hs index f9bc5164b9..31c5387297 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/StakeAddress.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/StakeAddress.hs @@ -130,3 +130,29 @@ hprop_golden_conway_stakeaddress_delegate_pool_and_drep = ] H.diffFileVsGoldenFile delegFile delegGold + +hprop_golden_conway_stakeaddress_register_and_delegate_pool :: Property +hprop_golden_conway_stakeaddress_register_and_delegate_pool = + propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + vkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/stake.vkey" + vkeyPool <- noteInputFile "test/cardano-cli-golden/files/input/conway/poolCold.vkey" + certFile <- H.noteTempFile tempDir "cert" + certGold <- + H.note "test/cardano-cli-golden/files/golden/governance/stakeaddress/registerAddressDelegateToPool.cert" + + void $ + execCardanoCLI + [ "conway" + , "stake-address" + , "registration-and-delegation-certificate" + , "--stake-verification-key-file" + , vkeyFile + , "--cold-verification-key-file" + , vkeyPool + , "--key-reg-deposit-amt" + , "2000000" + , "--out-file" + , certFile + ] + + H.diffFileVsGoldenFile certFile certGold \ No newline at end of file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/stakeaddress/registerAddressDelegateToPool.cert b/cardano-cli/test/cardano-cli-golden/files/golden/governance/stakeaddress/registerAddressDelegateToPool.cert new file mode 100644 index 0000000000..09313ce10b --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/stakeaddress/registerAddressDelegateToPool.cert @@ -0,0 +1,5 @@ +{ + "type": "CertificateConway", + "description": "Stake address registration and stake delegation certificate", + "cborHex": "840b8200581cef1785cf18928f8353c90e76b7a8fc60855472d31a0ea1c1c774ab01581cc27cf021914a2b3bcb286d3d741979083422378c577fe757702b69881a001e8480" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli index a484484cab..693dc130b3 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -7307,6 +7307,7 @@ Usage: cardano-cli conway stake-address | stake-delegation-certificate | stake-and-vote-delegation-certificate | vote-delegation-certificate + | registration-and-delegation-certificate ) Stake address commands. @@ -7420,6 +7421,24 @@ Usage: cardano-cli conway stake-address vote-delegation-certificate Create a stake address vote delegation certificate, which when submitted in a transaction delegates stake to a DRep. +Usage: cardano-cli conway stake-address registration-and-delegation-certificate + ( --stake-verification-key STRING + | --stake-verification-key-file FILEPATH + | --stake-key-hash HASH + | --stake-script-file FILEPATH + | --stake-address ADDRESS + ) + ( --stake-pool-verification-key STRING + | --cold-verification-key-file FILEPATH + | --stake-pool-id STAKE_POOL_ID + ) + --key-reg-deposit-amt NATURAL + --out-file FILEPATH + + Create a stake address registration and delegation certificate, which when + submitted in a transaction registers a stake address and delegates stake to a + stake pool. + Usage: cardano-cli conway stake-pool ( registration-certificate | deregistration-certificate @@ -9239,6 +9258,7 @@ Usage: cardano-cli latest stake-address | stake-delegation-certificate | stake-and-vote-delegation-certificate | vote-delegation-certificate + | registration-and-delegation-certificate ) Stake address commands. @@ -9352,6 +9372,24 @@ Usage: cardano-cli latest stake-address vote-delegation-certificate Create a stake address vote delegation certificate, which when submitted in a transaction delegates stake to a DRep. +Usage: cardano-cli latest stake-address registration-and-delegation-certificate + ( --stake-verification-key STRING + | --stake-verification-key-file FILEPATH + | --stake-key-hash HASH + | --stake-script-file FILEPATH + | --stake-address ADDRESS + ) + ( --stake-pool-verification-key STRING + | --cold-verification-key-file FILEPATH + | --stake-pool-id STAKE_POOL_ID + ) + --key-reg-deposit-amt NATURAL + --out-file FILEPATH + + Create a stake address registration and delegation certificate, which when + submitted in a transaction registers a stake address and delegates stake to a + stake pool. + Usage: cardano-cli latest stake-pool ( registration-certificate | deregistration-certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address.cli index da11f4b04e..60432ead78 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address.cli @@ -7,6 +7,7 @@ Usage: cardano-cli conway stake-address | stake-delegation-certificate | stake-and-vote-delegation-certificate | vote-delegation-certificate + | registration-and-delegation-certificate ) Stake address commands. @@ -33,3 +34,8 @@ Available commands: Create a stake address vote delegation certificate, which when submitted in a transaction delegates stake to a DRep. + registration-and-delegation-certificate + Create a stake address registration and delegation + certificate, which when submitted in a transaction + registers a stake address and delegates stake to a + stake pool. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address_registration-and-delegation-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address_registration-and-delegation-certificate.cli new file mode 100644 index 0000000000..2dafca1ab6 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address_registration-and-delegation-certificate.cli @@ -0,0 +1,38 @@ +Usage: cardano-cli conway stake-address registration-and-delegation-certificate + ( --stake-verification-key STRING + | --stake-verification-key-file FILEPATH + | --stake-key-hash HASH + | --stake-script-file FILEPATH + | --stake-address ADDRESS + ) + ( --stake-pool-verification-key STRING + | --cold-verification-key-file FILEPATH + | --stake-pool-id STAKE_POOL_ID + ) + --key-reg-deposit-amt NATURAL + --out-file FILEPATH + + Create a stake address registration and delegation certificate, which when + submitted in a transaction registers a stake address and delegates stake to a + stake pool. + +Available options: + --stake-verification-key STRING + Stake verification key (Bech32 or hex-encoded). + --stake-verification-key-file FILEPATH + Filepath of the staking verification key. + --stake-key-hash HASH Stake verification key hash (hex-encoded). + --stake-script-file FILEPATH + Filepath of the staking script. + --stake-address ADDRESS Target stake address (bech32 format). + --stake-pool-verification-key STRING + Stake pool verification key (Bech32 or hex-encoded). + --cold-verification-key-file FILEPATH + Filepath of the stake pool verification key. + --stake-pool-id STAKE_POOL_ID + Stake pool ID/verification key hash (either + Bech32-encoded or hex-encoded). + --key-reg-deposit-amt NATURAL + Key registration deposit amount. + --out-file FILEPATH The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address.cli index ab064b3ee2..f9ee830179 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address.cli @@ -7,6 +7,7 @@ Usage: cardano-cli latest stake-address | stake-delegation-certificate | stake-and-vote-delegation-certificate | vote-delegation-certificate + | registration-and-delegation-certificate ) Stake address commands. @@ -33,3 +34,8 @@ Available commands: Create a stake address vote delegation certificate, which when submitted in a transaction delegates stake to a DRep. + registration-and-delegation-certificate + Create a stake address registration and delegation + certificate, which when submitted in a transaction + registers a stake address and delegates stake to a + stake pool. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address_registration-and-delegation-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address_registration-and-delegation-certificate.cli new file mode 100644 index 0000000000..ea54daa06d --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address_registration-and-delegation-certificate.cli @@ -0,0 +1,38 @@ +Usage: cardano-cli latest stake-address registration-and-delegation-certificate + ( --stake-verification-key STRING + | --stake-verification-key-file FILEPATH + | --stake-key-hash HASH + | --stake-script-file FILEPATH + | --stake-address ADDRESS + ) + ( --stake-pool-verification-key STRING + | --cold-verification-key-file FILEPATH + | --stake-pool-id STAKE_POOL_ID + ) + --key-reg-deposit-amt NATURAL + --out-file FILEPATH + + Create a stake address registration and delegation certificate, which when + submitted in a transaction registers a stake address and delegates stake to a + stake pool. + +Available options: + --stake-verification-key STRING + Stake verification key (Bech32 or hex-encoded). + --stake-verification-key-file FILEPATH + Filepath of the staking verification key. + --stake-key-hash HASH Stake verification key hash (hex-encoded). + --stake-script-file FILEPATH + Filepath of the staking script. + --stake-address ADDRESS Target stake address (bech32 format). + --stake-pool-verification-key STRING + Stake pool verification key (Bech32 or hex-encoded). + --cold-verification-key-file FILEPATH + Filepath of the stake pool verification key. + --stake-pool-id STAKE_POOL_ID + Stake pool ID/verification key hash (either + Bech32-encoded or hex-encoded). + --key-reg-deposit-amt NATURAL + Key registration deposit amount. + --out-file FILEPATH The output file. + -h,--help Show this help text