-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update cardano-api to 8.45.0.0 #720
Changes from all commits
71b4285
ff3ea76
00754e7
da172bc
af8a8ed
0f0a8f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,14 @@ | |
module Test.Golden.Key.NonExtendedKey where | ||
|
||
import Control.Monad (void) | ||
import Control.Monad.Extra (forM_) | ||
import System.FilePath ((</>)) | ||
|
||
import qualified Test.Cardano.CLI.Util as H | ||
import Test.Cardano.CLI.Util (execCardanoCLI, propertyOnce) | ||
|
||
import Hedgehog (Property) | ||
import qualified Hedgehog.Extras.Test.Base as H | ||
import qualified Hedgehog.Extras.Test.File as H | ||
import qualified Hedgehog.Extras.Test.Golden as H | ||
|
||
{- HLINT ignore "Use camelCase" -} | ||
|
@@ -24,8 +24,6 @@ hprop_golden_KeyNonExtendedKey_GenesisExtendedVerificationKey = | |
nonExtendedFp <- H.note "test/cardano-cli-golden/files/golden/key/non-extended-keys/non-extended-shelley.000.vkey" | ||
outFp <- H.note $ tempDir </> "non-extended-shelley.000.vkey" | ||
|
||
H.assertFilesExist [genesisVKeyFp] | ||
|
||
-- Convert the `cardano-address` signing key | ||
void $ execCardanoCLI | ||
[ "key", "non-extended-key" | ||
|
@@ -44,8 +42,6 @@ hprop_golden_KeyNonExtendedKey_StakeExtendedVerificationKeyShelley = | |
nonExtendedFp <- H.note "test/cardano-cli-golden/files/golden/key/non-extended-keys/non-extended-stake.000.vkey" | ||
outFp <- H.note $ tempDir </> "non-extended-stake.000.vkey" | ||
|
||
H.assertFilesExist [genesisVKeyFp] | ||
|
||
-- Convert the `cardano-address` signing key | ||
void $ execCardanoCLI | ||
[ "key", "non-extended-key" | ||
|
@@ -64,8 +60,6 @@ hprop_golden_KeyNonExtendedKey_DRepExtendedVerificationKey = | |
goldenFile <- H.note "test/cardano-cli-golden/files/golden/key/non-extended-keys/non-extended-drep.vkey" | ||
outFp <- H.note $ tempDir </> "non-extended-drep.vkey" | ||
|
||
H.assertFilesExist [extendedKeyFile] | ||
|
||
void $ execCardanoCLI | ||
[ "conway", "key", "non-extended-key" | ||
, "--extended-verification-key-file", extendedKeyFile | ||
|
@@ -83,12 +77,30 @@ hprop_golden_extended_payment_vkey_to_non_extended_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 | ||
|
||
-- | Test that converting a CC extended verification key yields the expected result. | ||
-- | Execute me with: | ||
-- @cabal test cardano-cli-golden --test-options '-p "/golden extended cc vkey to non extended vkey/"'@ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not ideal to have these comments here as they can get out of sync with the function name. Maybe it's worth modifying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally like those comments, because they allow me to run one test without having to think about the complex shell command to enter. So far people received those new comments favorably, you're the first one to remark them 🙂 So I'm tempted to leave it here 😇 |
||
hprop_golden_extended_cc_vkey_to_non_extended_vkey :: Property | ||
hprop_golden_extended_cc_vkey_to_non_extended_vkey = | ||
let supplyValues = [ "cc-cold.vkey", "cc-hot.vkey" ] in | ||
propertyOnce $ forM_ supplyValues $ \suffix-> | ||
H.moduleWorkspace "tmp" $ \tempDir -> do | ||
extendedKeyFile <- H.noteInputFile $ "test/cardano-cli-golden/files/input/key/non-extended-keys/extended-" <> suffix | ||
goldenFile <- H.note $ "test/cardano-cli-golden/files/golden/key/non-extended-keys/non-extended-" <> suffix | ||
outFp <- H.note $ tempDir </> "non-extended-" <> suffix | ||
|
||
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": "ConstitutionalCommitteeColdVerificationKey_ed25519", | ||
"description": "Constitutional Committee Cold Verification Key", | ||
"cborHex": "58200a9d35aa5299580a67b1e43a3a4b6d43ef29c94e56c51ce4c17e9a53c1d0f39a" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "ConstitutionalCommitteeHotVerificationKey_ed25519", | ||
"description": "Constitutional Committee Hot Verification Key", | ||
"cborHex": "5820f010c4332699c6ea1e43b427919860277169382d43d2969b28a110cfa08d955c" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "ConstitutionalCommitteeColdExtendedVerificationKey_ed25519_bip32", | ||
"description": "", | ||
"cborHex": "58400a9d35aa5299580a67b1e43a3a4b6d43ef29c94e56c51ce4c17e9a53c1d0f39aa7f68837c38ef680b2dc8f047581707a32f6fcade23d4e02177d389002484798" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "ConstitutionalCommitteeHotExtendedVerificationKey_ed25519_bip32", | ||
"description": "", | ||
"cborHex": "5840f010c4332699c6ea1e43b427919860277169382d43d2969b28a110cfa08d955c4f178f20955541ce918a6a1352c32536f22677008f9f918d109663e4d2bdc084" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by the role this step has. Can you elaborate what problem you are solving with this temporary workaround?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is more context here on Slack. Gist is that we were not checking that golden files are correct.