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

Replace usages of assertFileOccurences (6/6) #451

Merged
merged 2 commits into from
Nov 13, 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 @@ -5,6 +5,7 @@ module Test.Golden.Shelley.Node.KeyGen

import Control.Monad (void)

import Test.Cardano.CLI.Aeson
import Test.Cardano.CLI.Util

import Hedgehog (Property)
Expand All @@ -26,9 +27,9 @@ hprop_golden_shelleyNodeKeyGen = propertyOnce . H.moduleWorkspace "tmp" $ \tempD
, "--operational-certificate-issue-counter", opCertCounterFile
]

H.assertFileOccurences 1 "StakePoolVerificationKey_ed25519" verificationKeyFile
H.assertFileOccurences 1 "StakePoolSigningKey_ed25519" signingKeyFile
H.assertFileOccurences 1 "NodeOperationalCertificateIssueCounter" opCertCounterFile
assertHasMappings [("type", "StakePoolVerificationKey_ed25519"), ("description", "Stake Pool Operator Verification Key")] verificationKeyFile
assertHasMappings [("type", "StakePoolSigningKey_ed25519"), ("description", "Stake Pool Operator Signing Key")] signingKeyFile
assertHasMappings [("type", "NodeOperationalCertificateIssueCounter"), ("description", "Next certificate issue number: 0")] opCertCounterFile

H.assertEndsWithSingleNewline verificationKeyFile
H.assertEndsWithSingleNewline signingKeyFile
Expand All @@ -47,9 +48,9 @@ hprop_golden_shelleyNodeKeyGen_te = propertyOnce . H.moduleWorkspace "tmp" $ \te
, "--operational-certificate-issue-counter", opCertCounterFile
]

H.assertFileOccurences 1 "StakePoolVerificationKey_ed25519" verificationKeyFile
H.assertFileOccurences 1 "StakePoolSigningKey_ed25519" signingKeyFile
H.assertFileOccurences 1 "NodeOperationalCertificateIssueCounter" opCertCounterFile
assertHasMappings [("type", "StakePoolVerificationKey_ed25519"), ("description", "Stake Pool Operator Verification Key")] verificationKeyFile
assertHasMappings [("type", "StakePoolSigningKey_ed25519"), ("description", "Stake Pool Operator Signing Key")] signingKeyFile
assertHasMappings [("type", "NodeOperationalCertificateIssueCounter"), ("description", "Next certificate issue number: 0")] opCertCounterFile

H.assertEndsWithSingleNewline verificationKeyFile
H.assertEndsWithSingleNewline signingKeyFile
Expand All @@ -71,6 +72,6 @@ hprop_golden_shelleyNodeKeyGen_bech32 = propertyOnce . H.moduleWorkspace "tmp" $

H.assertFileOccurences 1 "pool_vk" verificationKeyFile
H.assertFileOccurences 1 "pool_sk" signingKeyFile
H.assertFileOccurences 1 "NodeOperationalCertificateIssueCounter" opCertCounterFile
assertHasMappings [("type", "NodeOperationalCertificateIssueCounter"), ("description", "Next certificate issue number: 0")] opCertCounterFile

H.assertEndsWithSingleNewline opCertCounterFile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Test.Golden.Shelley.Node.KeyGenKes where

import Control.Monad (void)

import Test.Cardano.CLI.Aeson
import Test.Cardano.CLI.Util

import Hedgehog (Property)
Expand All @@ -23,8 +24,8 @@ hprop_golden_shelleyNodeKeyGenKes = propertyOnce . H.moduleWorkspace "tmp" $ \te
, "--signing-key-file", signingKey
]

H.assertFileOccurences 1 "KesVerificationKey_ed25519_kes_2^6" verificationKey
H.assertFileOccurences 1 "KesSigningKey_ed25519_kes_2^6" signingKey
assertHasMappings [("type", "KesVerificationKey_ed25519_kes_2^6"), ("description", "KES Verification Key")] verificationKey
assertHasMappings [("type", "KesSigningKey_ed25519_kes_2^6"), ("description", "KES Signing Key")] signingKey

H.assertEndsWithSingleNewline verificationKey
H.assertEndsWithSingleNewline signingKey
Expand All @@ -41,8 +42,8 @@ hprop_golden_shelleyNodeKeyGenKes_te = propertyOnce . H.moduleWorkspace "tmp" $
, "--signing-key-file", signingKey
]

H.assertFileOccurences 1 "KesVerificationKey_ed25519_kes_2^6" verificationKey
H.assertFileOccurences 1 "KesSigningKey_ed25519_kes_2^6" signingKey
assertHasMappings [("type", "KesVerificationKey_ed25519_kes_2^6"), ("description", "KES Verification Key")] verificationKey
assertHasMappings [("type", "KesSigningKey_ed25519_kes_2^6"), ("description", "KES Signing Key")] signingKey

H.assertEndsWithSingleNewline verificationKey
H.assertEndsWithSingleNewline signingKey
Expand Down