Skip to content

Commit

Permalink
add golden test for stake_reg_deleg_cert
Browse files Browse the repository at this point in the history
add golden test for `stake_reg_deleg_cert`
update golden files
  • Loading branch information
CarlosLopezDeLara committed Sep 30, 2024
1 parent 004a37d commit 465a054
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "CertificateConway",
"description": "Stake address registration and stake delegation certificate",
"cborHex": "840b8200581cef1785cf18928f8353c90e76b7a8fc60855472d31a0ea1c1c774ab01581cc27cf021914a2b3bcb286d3d741979083422378c577fe757702b69881a001e8480"
}
38 changes: 38 additions & 0 deletions cardano-cli/test/cardano-cli-golden/files/golden/help.cli
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 465a054

Please sign in to comment.