Skip to content

Commit

Permalink
drep verification key: extended->non extended: specify description
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Oct 30, 2023
1 parent 9787634 commit a98fc17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,26 +110,27 @@ runNonExtendedKeyCmd
writeVerificationKey ssk =
case ssk of
APaymentExtendedVerificationKey vk ->
writeToDisk vkf (castVerificationKey vk :: VerificationKey PaymentKey)
writeToDisk vkf Nothing (castVerificationKey vk :: VerificationKey PaymentKey)
ADRepExtendedVerificationKey vk ->
writeToDisk vkf (castVerificationKey vk :: VerificationKey DRepKey)
writeToDisk vkf (Just "drep verification key") (castVerificationKey vk :: VerificationKey DRepKey)
AStakeExtendedVerificationKey vk ->
writeToDisk vkf (castVerificationKey vk :: VerificationKey StakeKey)
writeToDisk vkf Nothing (castVerificationKey vk :: VerificationKey StakeKey)
AGenesisExtendedVerificationKey vk ->
writeToDisk vkf (castVerificationKey vk :: VerificationKey GenesisKey)
writeToDisk vkf Nothing (castVerificationKey vk :: VerificationKey GenesisKey)
AGenesisDelegateExtendedVerificationKey vk ->
writeToDisk vkf (castVerificationKey vk :: VerificationKey GenesisDelegateKey)
writeToDisk vkf Nothing (castVerificationKey vk :: VerificationKey GenesisDelegateKey)
nonExtendedKey -> left $ KeyCmdExpectedExtendedVerificationKey nonExtendedKey


writeToDisk
:: Key keyrole
=> File content Out
-> Maybe TextEnvelopeDescr
-> VerificationKey keyrole
-> ExceptT KeyCmdError IO ()
writeToDisk vkf' vk =
writeToDisk vkf' descr vk =
firstExceptT KeyCmdWriteFileError . newExceptT
$ writeLazyByteStringFile vkf' $ textEnvelopeToJSON Nothing vk
$ writeLazyByteStringFile vkf' $ textEnvelopeToJSON descr vk


readExtendedVerificationKeyFile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "DRepVerificationKey_ed25519",
"description": "",
"description": "drep verification key",
"cborHex": "5820b0cd9e6e3e274f4f38f55ef274af123cf4600ac0c58294399b7e076175262553"
}

0 comments on commit a98fc17

Please sign in to comment.