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

drep id: change output to honor CIP129 #1059

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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: 5 additions & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ runGovernanceDRepIdCmd
modifyError ReadFileError $
readVerificationKeyOrHashOrTextEnvFile AsDRepKey vkeySource

content <-
pure $ case idOutputFormat of
IdOutputFormatHex -> serialiseToRawBytesHex drepVerKeyHash
IdOutputFormatBech32 -> Text.encodeUtf8 $ serialiseToBech32 drepVerKeyHash
let keyType = Text.encodeUtf8 "22"
content =
case idOutputFormat of
IdOutputFormatHex -> serialiseToRawBytesHex drepVerKeyHash
IdOutputFormatBech32 -> Text.encodeUtf8 $ serialiseToBech32CIP129 keyType drepVerKeyHash

lift (writeByteStringOutput mOutFile content)
& onLeft (left . WriteFileError)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
drep1avya24t2308yyyr5uw2dqtreemvkwst90dx00j5fj5556meyztm
drep1xgewkzw4244ghnjzzp6w89xs93uuakt8g9jhkn8he2ye222dygt8nr
Original file line number Diff line number Diff line change
@@ -1 +1 @@
drep1cx359uxlhq4e8j3wddqxht9sfqp004t2n8v0jk5q4zmv27sh0h5
drep1xgevrg6z7r0ms2uneghxksrt4jcysqhh644fnk8et2q23dk9wxfze4
Loading