Skip to content

Commit

Permalink
Merge pull request #457 from input-output-hk/smelc/add-missing-extend…
Browse files Browse the repository at this point in the history
…ed-to-non-extended-golden-tests

Add one missing extended to non extended golden tests
  • Loading branch information
smelc authored Nov 28, 2023
2 parents d4c1a35 + dc568b3 commit 3379069
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
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"
}

0 comments on commit 3379069

Please sign in to comment.