diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Key/NonExtendedKey.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Key/NonExtendedKey.hs index 12609f7ad0..2c899ba33e 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Key/NonExtendedKey.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Key/NonExtendedKey.hs @@ -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 @@ -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 @@ -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 diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/key/non-extended-keys/non-extended-payment.vkey b/cardano-cli/test/cardano-cli-golden/files/golden/key/non-extended-keys/non-extended-payment.vkey new file mode 100644 index 0000000000..a4552574ef --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/key/non-extended-keys/non-extended-payment.vkey @@ -0,0 +1,5 @@ +{ + "type": "PaymentVerificationKeyShelley_ed25519", + "description": "Payment Verification Key", + "cborHex": "5820a6f7741bb5559f899e99312f425f52e66b0ff25e4da66523e6dc1c5b21d52c04" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/input/key/non-extended-keys/extended-payment.vkey b/cardano-cli/test/cardano-cli-golden/files/input/key/non-extended-keys/extended-payment.vkey new file mode 100644 index 0000000000..b53e014323 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/key/non-extended-keys/extended-payment.vkey @@ -0,0 +1,5 @@ +{ + "type": "PaymentExtendedVerificationKeyShelley_ed25519_bip32", + "description": "Payment Verification Key", + "cborHex": "5840a6f7741bb5559f899e99312f425f52e66b0ff25e4da66523e6dc1c5b21d52c0450f7a870e38d988c3c57ce9e6e35662c5c379f7247cbe574cfa82550a3f0c181" +}