1
1
{-# LANGUAGE OverloadedStrings #-}
2
2
3
3
module Test.Golden.Key.NonExtendedKey
4
- ( golden_KeyNonExtendedKey
4
+ ( golden_KeyNonExtendedKey_GenesisExtendedVerificationKey
5
+ , golden_KeyNonExtendedKey_StakeExtendedVerificationKeyShelley
5
6
) where
6
7
7
8
import Control.Monad (void )
@@ -10,30 +11,52 @@ import qualified Hedgehog.Extras.Test.Base as H
10
11
import qualified Hedgehog.Extras.Test.File as H
11
12
import System.FilePath ((</>) )
12
13
import Test.OptParse (execCardanoCLI , propertyOnce )
13
- import Test.Utilities (diffVsGoldenFile )
14
+ import Test.Utilities (diffFileVsGoldenFile )
14
15
15
16
{- HLINT ignore "Use camelCase" -}
16
17
17
18
-- | Test that converting a @cardano-address@ Byron signing key yields the
18
19
-- expected result.
19
- golden_KeyNonExtendedKey :: Property
20
- golden_KeyNonExtendedKey =
20
+ golden_KeyNonExtendedKey_GenesisExtendedVerificationKey :: Property
21
+ golden_KeyNonExtendedKey_GenesisExtendedVerificationKey =
21
22
propertyOnce . H. moduleWorkspace " tmp" $ \ tempDir -> do
22
23
genesisVKeyFp <- H. note " test/data/golden/key/non-extended-keys/shelley.000.vkey"
23
- nonExtendedGenesisVKeyFp <- H. note $ tempDir </> " non-extended-shelley.000.vkey"
24
+ nonExtendedFp <- H. note " test/data/golden/key/non-extended-keys/non-extended-shelley.000.vkey"
25
+ outFp <- H. note $ tempDir </> " non-extended-shelley.000.vkey"
24
26
25
27
H. assertFilesExist [genesisVKeyFp]
26
28
27
29
-- Convert the `cardano-address` signing key
28
30
void $ execCardanoCLI
29
31
[ " key" , " non-extended-key"
30
32
, " --extended-verification-key-file" , genesisVKeyFp
31
- , " --verification-key-file" , nonExtendedGenesisVKeyFp
33
+ , " --verification-key-file" , outFp
32
34
]
33
35
34
36
-- Check for existence of the converted signing key file
35
- H. assertFilesExist [nonExtendedGenesisVKeyFp ]
37
+ H. assertFilesExist [outFp ]
36
38
37
- contents <- H. readFile nonExtendedGenesisVKeyFp
39
+ diffFileVsGoldenFile outFp nonExtendedFp
38
40
39
- diffVsGoldenFile contents nonExtendedGenesisVKeyFp
41
+ -- | Test that converting a @cardano-address@ Byron signing key yields the
42
+ -- expected result.
43
+ golden_KeyNonExtendedKey_StakeExtendedVerificationKeyShelley :: Property
44
+ golden_KeyNonExtendedKey_StakeExtendedVerificationKeyShelley =
45
+ propertyOnce . H. moduleWorkspace " tmp" $ \ tempDir -> do
46
+ genesisVKeyFp <- H. note " test/data/golden/key/non-extended-keys/stake.000.vkey"
47
+ nonExtendedFp <- H. note " test/data/golden/key/non-extended-keys/non-extended-stake.000.vkey"
48
+ outFp <- H. note $ tempDir </> " non-extended-stake.000.vkey"
49
+
50
+ H. assertFilesExist [genesisVKeyFp]
51
+
52
+ -- Convert the `cardano-address` signing key
53
+ void $ execCardanoCLI
54
+ [ " key" , " non-extended-key"
55
+ , " --extended-verification-key-file" , genesisVKeyFp
56
+ , " --verification-key-file" , outFp
57
+ ]
58
+
59
+ -- Check for existence of the converted signing key file
60
+ H. assertFilesExist [outFp]
61
+
62
+ diffFileVsGoldenFile outFp nonExtendedFp
0 commit comments