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

Add one missing extended to non extended golden tests #457

Merged
merged 2 commits into from
Nov 28, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ hprop_golden_KeyNonExtendedKey_GenesisExtendedVerificationKey =
, "--verification-key-file", outFp
]

-- Check for existence of the converted signing key file
H.assertFilesExist [outFp]

H.diffFileVsGoldenFile outFp nonExtendedFp

-- | Test that converting a @cardano-address@ Byron signing key yields the
Expand All @@ -56,9 +53,6 @@ hprop_golden_KeyNonExtendedKey_StakeExtendedVerificationKeyShelley =
, "--verification-key-file", outFp
]

-- Check for existence of the converted signing key file
H.assertFilesExist [outFp]

H.diffFileVsGoldenFile outFp nonExtendedFp

-- | Test that converting a drep extended verification key yields the
Expand All @@ -78,7 +72,23 @@ hprop_golden_KeyNonExtendedKey_DRepExtendedVerificationKey =
, "--verification-key-file", outFp
]

-- Check for existence of the converted signing key file
H.assertFilesExist [outFp]
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"
}