Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#221 Update description fields on delegation certificates #250

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ runGovernanceDelegationCertificateCmd stakeIdentifier delegationTarget outFp = d
delegatee <- toLedgerDelegatee target
let req = StakeDelegationRequirementsConwayOnwards cOnwards stakeCred delegatee
delegCert = makeStakeAddressDelegationCertificate req
-- TODO: Conway era - update description to say if its delegating voting stake or "regular" stake
description = Just @TextEnvelopeDescr "Stake Address Delegation Certificate"
description = Just $ toDelegateeEnvelope delegatee
firstExceptT DelegationCertificateWriteFileError
. newExceptT
$ writeLazyByteStringFile outFp
Expand Down Expand Up @@ -125,6 +124,12 @@ toLedgerDelegatee t =
conwayEraOnwardsConstraints cOn $
right $ Ledger.DelegVote $ Ledger.DRepCredential $ Ledger.ScriptHashObj scriptHash

toDelegateeEnvelope :: Ledger.Delegatee ledgerera -> TextEnvelopeDescr
toDelegateeEnvelope = \case
Ledger.DelegStake{} -> "Stake Delegation Certificate"
Ledger.DelegVote{} -> "Vote Delegation Certificate"
Ledger.DelegStakeVote{} -> "Stake and Vote Delegation Certificate"
carbolymer marked this conversation as resolved.
Show resolved Hide resolved

runGovernanceDRepIdCmd :: ()
=> ConwayEraOnwards era
-> VerificationKeyOrFile DRepKey
Expand Down