|
2 | 2 |
|
3 | 3 | module Test.Golden.Shelley.StakePool.RegistrationCertificate where
|
4 | 4 |
|
| 5 | +import Cardano.Api |
| 6 | + ( AsType (AsStakePoolExtendedKey, AsVerificationKey) |
| 7 | + , File (File) |
| 8 | + , liftIO |
| 9 | + , readFileTextEnvelope |
| 10 | + , serialiseToBech32 |
| 11 | + ) |
| 12 | + |
5 | 13 | import Control.Monad (void)
|
| 14 | +import Data.Text qualified as Text |
6 | 15 |
|
7 | 16 | import Test.Cardano.CLI.Util
|
8 | 17 |
|
9 | 18 | import Hedgehog (Property)
|
| 19 | +import Hedgehog qualified as H |
10 | 20 | import Hedgehog.Extras.Test.Base qualified as H
|
11 | 21 | import Hedgehog.Extras.Test.Golden qualified as H
|
12 | 22 |
|
@@ -89,3 +99,47 @@ hprop_golden_conway_stake_pool_registration_certificate_extended_cold_key = prop
|
89 | 99 | goldenFile <- H.note "test/cardano-cli-golden/files/golden/shelley/reg-certificate-extended.json"
|
90 | 100 |
|
91 | 101 | H.diffFileVsGoldenFile registrationCertFile goldenFile
|
| 102 | + |
| 103 | +hprop_golden_conway_stake_pool_registration_certificate_extended_literal_cold_key :: Property |
| 104 | +hprop_golden_conway_stake_pool_registration_certificate_extended_literal_cold_key = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do |
| 105 | + operatorVerificationKeyFile <- |
| 106 | + noteInputFile "test/cardano-cli-golden/files/input/shelley/node-pool/extended-operator.vkey" |
| 107 | + vrfVerificationKeyFile <- |
| 108 | + noteInputFile "test/cardano-cli-golden/files/input/shelley/node-pool/vrf.vkey" |
| 109 | + ownerVerificationKeyFile <- |
| 110 | + noteInputFile "test/cardano-cli-golden/files/input/shelley/node-pool/owner.vkey" |
| 111 | + registrationCertFile <- noteTempFile tempDir "registration.cert" |
| 112 | + |
| 113 | + stakePoolExtendedKey <- |
| 114 | + H.evalEitherM $ |
| 115 | + liftIO $ |
| 116 | + readFileTextEnvelope (AsVerificationKey AsStakePoolExtendedKey) (File operatorVerificationKeyFile) |
| 117 | + |
| 118 | + void $ |
| 119 | + execCardanoCLI |
| 120 | + [ "conway" |
| 121 | + , "stake-pool" |
| 122 | + , "registration-certificate" |
| 123 | + , "--testnet-magic" |
| 124 | + , "42" |
| 125 | + , "--pool-pledge" |
| 126 | + , "0" |
| 127 | + , "--pool-cost" |
| 128 | + , "0" |
| 129 | + , "--pool-margin" |
| 130 | + , "0" |
| 131 | + , "--stake-pool-verification-extended-key" |
| 132 | + , Text.unpack $ serialiseToBech32 stakePoolExtendedKey |
| 133 | + , "--vrf-verification-key-file" |
| 134 | + , vrfVerificationKeyFile |
| 135 | + , "--pool-reward-account-verification-key-file" |
| 136 | + , ownerVerificationKeyFile |
| 137 | + , "--pool-owner-stake-verification-key-file" |
| 138 | + , ownerVerificationKeyFile |
| 139 | + , "--out-file" |
| 140 | + , registrationCertFile |
| 141 | + ] |
| 142 | + |
| 143 | + goldenFile <- H.note "test/cardano-cli-golden/files/golden/shelley/reg-certificate-extended.json" |
| 144 | + |
| 145 | + H.diffFileVsGoldenFile registrationCertFile goldenFile |
0 commit comments