Skip to content

Commit

Permalink
Test conversion of extended payment key to non-extended one
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Nov 27, 2023
1 parent d1d1932 commit dc568b3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,22 @@ hprop_golden_KeyNonExtendedKey_DRepExtendedVerificationKey =
]

H.diffFileVsGoldenFile outFp goldenFile

-- | Test that converting a payment extended verification key yields the
-- expected result.
hprop_golden_extended_payment_vkey_to_non_extended_vkey :: Property
hprop_golden_extended_payment_vkey_to_non_extended_vkey =
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
extendedKeyFile <- H.noteInputFile "test/cardano-cli-golden/files/input/key/non-extended-keys/extended-payment.vkey"
goldenFile <- H.note "test/cardano-cli-golden/files/golden/key/non-extended-keys/non-extended-payment.vkey"
outFp <- H.note $ tempDir </> "non-extended-payment.vkey"

H.assertFilesExist [extendedKeyFile]

void $ execCardanoCLI
[ "conway", "key", "non-extended-key"
, "--extended-verification-key-file", extendedKeyFile
, "--verification-key-file", outFp
]

H.diffFileVsGoldenFile outFp goldenFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "PaymentVerificationKeyShelley_ed25519",
"description": "Payment Verification Key",
"cborHex": "5820a6f7741bb5559f899e99312f425f52e66b0ff25e4da66523e6dc1c5b21d52c04"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "PaymentExtendedVerificationKeyShelley_ed25519_bip32",
"description": "Payment Verification Key",
"cborHex": "5840a6f7741bb5559f899e99312f425f52e66b0ff25e4da66523e6dc1c5b21d52c0450f7a870e38d988c3c57ce9e6e35662c5c379f7247cbe574cfa82550a3f0c181"
}

0 comments on commit dc568b3

Please sign in to comment.