Skip to content

Commit

Permalink
prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosLopezDeLara committed Sep 30, 2024
1 parent 8e8c070 commit ec3d402
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ data StakeAddressCmds era
(VerificationKeyOrHashOrFile StakePoolKey)
Coin
(File () Out)
deriving Show
deriving (Show)

renderStakeAddressCmds :: StakeAddressCmds era -> Text
renderStakeAddressCmds = \case
Expand All @@ -78,4 +78,3 @@ renderStakeAddressCmds = \case
StakeAddressStakeDelegationCertificateCmd{} -> "stake-address stake-delegation-certificate"
StakeAddressVoteDelegationCertificateCmd{} -> "stake-address vote-delegation-certificate"
StakeAddressRegistrationAndDelegationCertificateCmd{} -> "stake-address registration-and-stake-delegation-certificate"

Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,3 @@ pStakeAddressRegistrationAndDelegationCertificateCmd era = do
[ "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."
]

16 changes: 8 additions & 8 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ runStakeAddressCmds = \case
StakeAddressDeregistrationCertificateCmd sbe stakeIdentifier mDeposit outputFp ->
runStakeAddressDeregistrationCertificateCmd sbe stakeIdentifier mDeposit outputFp
StakeAddressRegistrationAndDelegationCertificateCmd w stakeIdentifier poolVKeyOrHashOrFile deposit outFp ->
runStakeAddressRegistrationAndDelegationCertificateCmd w stakeIdentifier poolVKeyOrHashOrFile deposit outFp
runStakeAddressRegistrationAndDelegationCertificateCmd w stakeIdentifier poolVKeyOrHashOrFile deposit outFp

runStakeAddressKeyGenCmd
:: ()
Expand Down Expand Up @@ -338,21 +338,21 @@ runStakeAddressRegistrationAndDelegationCertificateCmd
-> Lovelace
-> File () Out
-> ExceptT StakeAddressCmdError IO ()
runStakeAddressRegistrationAndDelegationCertificateCmd w stakeVerifier poolVKeyOrHashOrFile deposit outFp =
runStakeAddressRegistrationAndDelegationCertificateCmd w stakeVerifier poolVKeyOrHashOrFile deposit outFp =
conwayEraOnwardsConstraints w $ do
StakePoolKeyHash poolStakeVKeyHash <-
modifyError StakeAddressCmdReadKeyFileError $
readVerificationKeyOrHashOrFile AsStakePoolKey poolVKeyOrHashOrFile

stakeCred <-
getStakeCredentialFromIdentifier stakeVerifier
& firstExceptT StakeAddressCmdStakeCredentialError
& firstExceptT StakeAddressCmdStakeCredentialError

let deleg = L.DelegStake poolStakeVKeyHash

let certificate = makeStakeAddressAndDRepDelegationCertificate w stakeCred deleg deposit

firstExceptT StakeAddressCmdWriteFileError
. newExceptT
$ writeLazyByteStringFile outFp
$ textEnvelopeToJSON (Just @TextEnvelopeDescr "Stake address registration and stake delegation certificate") certificate
. newExceptT
$ writeLazyByteStringFile outFp
$ textEnvelopeToJSON (Just @TextEnvelopeDescr "Stake address registration and stake delegation certificate") certificate
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ hprop_golden_conway_stakeaddress_register_and_delegate_pool =
, certFile
]

H.diffFileVsGoldenFile certFile certGold
H.diffFileVsGoldenFile certFile certGold

0 comments on commit ec3d402

Please sign in to comment.