Skip to content

Commit

Permalink
formatting with fourmolu
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosLopezDeLara committed Sep 30, 2024
1 parent 8e8c070 commit 0ca3935
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]

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

runStakeAddressKeyGenCmd
:: ()
Expand Down Expand Up @@ -338,21 +348,23 @@ 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 @@ -138,7 +138,8 @@ hprop_golden_conway_stakeaddress_register_and_delegate_pool =
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"
H.note
"test/cardano-cli-golden/files/golden/governance/stakeaddress/registerAddressDelegateToPool.cert"

void $
execCardanoCLI
Expand All @@ -155,4 +156,4 @@ hprop_golden_conway_stakeaddress_register_and_delegate_pool =
, certFile
]

H.diffFileVsGoldenFile certFile certGold
H.diffFileVsGoldenFile certFile certGold

0 comments on commit 0ca3935

Please sign in to comment.