Skip to content

Commit e949639

Browse files
iohk-bors[bot]dependabot[bot]newhoggyJames Browning
authored
4797: Bump future from 0.18.2 to 0.18.3 in /doc/.sphinx r=newhoggy a=dependabot[bot] Bumps [future](https://github.com/PythonCharmers/python-future) from 0.18.2 to 0.18.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/PythonCharmers/python-future/releases">future's releases</a>.</em></p> <blockquote> <h2>v0.18.3</h2> <p>This is a minor bug-fix release containing a number of fixes:</p> <ul> <li>Backport fix for bpo-38804 (c91d70b)</li> <li>Fix bug in fix_print.py fixer (dffc579)</li> <li>Fix bug in fix_raise.py fixer (3401099)</li> <li>Fix newint bool in py3 (fe645ba)</li> <li>Fix bug in super() with metaclasses (6e27aac)</li> <li>docs: fix simple typo, reqest -&gt; request (974eb1f)</li> <li>Correct <strong>eq</strong> (c780bf5)</li> <li>Pass if lint fails (2abe00d)</li> <li>Update docker image and parcel out to constant variable. Add comment to update version constant (45cf382)</li> <li>fix order (f96a219)</li> <li>Add flake8 to image (046ff18)</li> <li>Make lint.sh executable (58cc984)</li> <li>Add docker push to optimize CI (01e8440)</li> <li>Build System (42b3025)</li> <li>Add docs build status badge to README.md (3f40bd7)</li> <li>Use same docs requirements in tox (18ecc5a)</li> <li>Add docs/requirements.txt (5f9893f)</li> <li>Add PY37_PLUS, PY38_PLUS, and PY39_PLUS (bee0247)</li> <li>fix 2.6 test, better comment (ddedcb9)</li> <li>fix 2.6 test (3f1ff7e)</li> <li>remove nan test (4dbded1)</li> <li>include list test values (e3f1a12)</li> <li>fix other python2 test issues (c051026)</li> <li>fix missing subTest (f006cad)</li> <li>import from old imp library on older python versions (fc84fa8)</li> <li>replace fstrings with format for python 3.4,3.5 (4a687ea)</li> <li>minor style/spelling fixes (8302d8c)</li> <li>improve cmp function, add unittest (0d95a40)</li> <li>Pin typing==3.7.4.1 for Python 3.3 compatiblity (1a48f1b)</li> <li>Fix various py26 unit test failures (9ca5a14)</li> <li>Add initial contributing guide with docs build instruction (e55f915)</li> <li>Add docs building to tox.ini (3ee9e7f)</li> <li>Support NumPy's specialized int types in builtins.round (b4b54f0)</li> <li>Added r&quot;&quot;&quot; to the docstring to avoid warnings in python3 (5f94572)</li> <li>Add <strong>subclasscheck</strong> for past.types.basestring (c9bc0ff)</li> <li>Correct example in README (681e78c)</li> <li>Add simple documentation (6c6e3ae)</li> <li>Add pre-commit hooks (a9c6a37)</li> <li>Handling of <strong>next</strong> and next by future.utils.get_next was reversed (52b0ff9)</li> <li>Add a test for our fix (461d77e)</li> <li>Compare headers to correct definition of str (3eaa8fd)</li> <li><a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/322">#322</a> Add support for negative ndigits in round; additionally, fixing a bug so that it handles passing in Decimal properly (a4911b9)</li> <li>Add tkFileDialog to future.movers.tkinter (f6a6549)</li> <li>Sort before comparing dicts in TestChainMap (6126997)</li> <li>Fix typo (4dfa099)</li> <li>Fix formatting in &quot;What's new&quot; (1663dfa)</li> <li>Fix typo (4236061)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/PythonCharmers/python-future/commit/af1db970b0879b59e7aeb798c27a623144561cff"><code>af1db97</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/613">#613</a> from PythonCharmers/lwan/0.18.3-release</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/079ee9b75441d36447cec9981fa1b0032862f64d"><code>079ee9b</code></a> Prepare for 0.18.3 release</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/02f7a8143d5b68f50a1cca44d8f5a58c1925a515"><code>02f7a81</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/610">#610</a> from wshanks/wshanks-patch-1</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/c91d70b34ef0402aef3e9d04364ba98509dca76f"><code>c91d70b</code></a> Backport fix for bpo-38804</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/80523f383fbba1c6de0551e19d0277e73e69573c"><code>80523f3</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/569">#569</a> from jmadler/master</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/5e5af71549c7a7fa0e28f881046e081e231e455d"><code>5e5af71</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/582">#582</a> from r3m0t/patch-6</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/17e4bbd7c676a9a8efd20601e51675c95f74b330"><code>17e4bbd</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/596">#596</a> from abjonnes/fix-print-trailing-comma</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/1b427ba70191927706282840835e31ae0733ee7e"><code>1b427ba</code></a> Merge branch 'xZise-official-count' into master</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/c8eb497336c76d300c6753b47c7f5de505660d7a"><code>c8eb497</code></a> Merge branch 'official-count' of <a href="https://github.com/xZise/python-future">https://github.com/xZise/python-future</a> into ...</li> <li><a href="https://github.com/PythonCharmers/python-future/commit/dffc579dbb7c882fc01fa0c0dfa6b59acef7827d"><code>dffc579</code></a> Fix bug in fix_print.py fixer</li> <li>Additional commits viewable in <a href="https://github.com/PythonCharmers/python-future/compare/v0.18.2...v0.18.3">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=future&package-manager=pip&previous-version=0.18.2&new-version=0.18.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - ``@dependabot` rebase` will rebase this PR - ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it - ``@dependabot` merge` will merge this PR after your CI passes on it - ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it - ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging - ``@dependabot` reopen` will reopen this PR if it is closed - ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` use these labels` will set the current labels as the default for future PRs for this repo and language - ``@dependabot` use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - ``@dependabot` use these assignees` will set the current assignees as the default for future PRs for this repo and language - ``@dependabot` use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/input-output-hk/cardano-node/network/alerts). </details> 4918: Fix key non extended key for StakeExtendedVerificationKeyShelley_ed25519_bip32 envelope r=newhoggy a=newhoggy * Fix key non extended key for `StakeExtendedVerificationKeyShelley_ed25519_bip32` envelope * Add ability to generate golden files from test using `CREATE_GOLDEN_FILES=1` * New `diffFileVsGoldenFile` function Resolves #4914 4919: Check CLI argument bounds r=newhoggy a=newhoggy The bounds of many CLI arguments are now checked. ``` $ cardano-cli transaction build \ --alonzo-era \ --testnet-magic 42 \ --change-address 'addr_test1vztpl4gth92fpxh3zth7w6v7mm7wewt89edae2hq3rptu5qa7ahzt' \ --tx-in 'dee44d80c8b9da8cf20d1fae78a79a03b70b8abf76bfda88fe3651efcb0ab0cd#0' \ --tx-out 'addr_test1vztpl4gth92fpxh3zth7w6v7mm7wewt89edae2hq3rptu5qa7ahzt+1000000' \ --out-file tx.body --invalid-before -1 option --invalid-before: SLOT must not be less than 0 ... ``` Resolves #4863 4922: Deploy Haddock for merge to master only r=newhoggy a=newhoggy To merge changes from this PR #3012 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: John Ky <[email protected]> Co-authored-by: James Browning <[email protected]>
5 parents 101e247 + 436f880 + d06b496 + 2257b95 + 44216e6 commit e949639

File tree

16 files changed

+229
-108
lines changed

16 files changed

+229
-108
lines changed

.github/workflows/github-page.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: "Haddock documentation"
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- master
47

58
jobs:
69
build:

cardano-api/src/Cardano/Api.hs

+3
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,9 @@ module Cardano.Api (
750750
txInsExistInUTxO,
751751
notScriptLockedTxIns,
752752
textShow,
753+
754+
-- ** CLI option parsing
755+
bounded,
753756
) where
754757

755758
import Cardano.Api.Address

cardano-api/src/Cardano/Api/DeserialiseAnyOf.hs

+1
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ deserialiseAnyVerificationKeyTextEnvelope bs =
310310
[ FromSomeType (AsVerificationKey AsByronKey) AByronVerificationKey
311311
, FromSomeType (AsVerificationKey AsPaymentKey) APaymentVerificationKey
312312
, FromSomeType (AsVerificationKey AsPaymentExtendedKey) APaymentExtendedVerificationKey
313+
, FromSomeType (AsVerificationKey AsStakeExtendedKey) AStakeExtendedVerificationKey
313314
, FromSomeType (AsVerificationKey AsGenesisUTxOKey) AGenesisUTxOVerificationKey
314315
, FromSomeType (AsVerificationKey AsGenesisExtendedKey) AGenesisExtendedVerificationKey
315316
]

cardano-api/src/Cardano/Api/Utils.hs

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE GADTs #-}
33
{-# LANGUAGE LambdaCase #-}
4+
{-# LANGUAGE RankNTypes #-}
5+
{-# LANGUAGE ScopedTypeVariables #-}
6+
{-# LANGUAGE TypeApplications #-}
47

58
#if !defined(mingw32_HOST_OS)
69
#define UNIX
@@ -22,10 +25,13 @@ module Cardano.Api.Utils
2225
, runParsecParser
2326
, textShow
2427
, writeSecrets
28+
29+
-- ** CLI option parsing
30+
, bounded
2531
) where
2632

2733
import Control.Exception (bracket)
28-
import Control.Monad (forM_)
34+
import Control.Monad (forM_, when)
2935
import qualified Data.Aeson.Types as Aeson
3036
import qualified Data.ByteString as BS
3137
import qualified Data.ByteString.Builder as Builder
@@ -48,6 +54,9 @@ import System.Directory (emptyPermissions, readable, setPermissions)
4854
#endif
4955

5056
import Cardano.Api.Eras
57+
import Options.Applicative (ReadM)
58+
import Options.Applicative.Builder (eitherReader)
59+
import qualified Text.Read as Read
5160

5261
(?!) :: Maybe a -> e -> Either e a
5362
Nothing ?! e = Left e
@@ -132,3 +141,9 @@ renderEra (AnyCardanoEra MaryEra) = "Mary"
132141
renderEra (AnyCardanoEra AlonzoEra) = "Alonzo"
133142
renderEra (AnyCardanoEra BabbageEra) = "Babbage"
134143

144+
bounded :: forall a. (Bounded a, Integral a, Show a) => String -> ReadM a
145+
bounded t = eitherReader $ \s -> do
146+
i <- Read.readEither @Integer s
147+
when (i < fromIntegral (minBound @a)) $ Left $ t <> " must not be less than " <> show (minBound @a)
148+
when (i > fromIntegral (maxBound @a)) $ Left $ t <> " must not greater than " <> show (maxBound @a)
149+
pure (fromIntegral i)

cardano-cli/src/Cardano/CLI/Byron/Parsers.hs

+5-6
Original file line numberDiff line numberDiff line change
@@ -664,12 +664,11 @@ pNetworkId =
664664

665665
pTestnetMagic :: Parser NetworkMagic
666666
pTestnetMagic =
667-
NetworkMagic <$>
668-
Opt.option Opt.auto
669-
( Opt.long "testnet-magic"
670-
<> Opt.metavar "NATURAL"
671-
<> Opt.help "Specify a testnet magic id."
672-
)
667+
fmap NetworkMagic $ Opt.option (bounded "TESTNET_MAGIC") $ mconcat
668+
[ Opt.long "testnet-magic"
669+
, Opt.metavar "NATURAL"
670+
, Opt.help "Specify a testnet magic id."
671+
]
673672

674673
parseNewSigningKeyFile :: String -> Parser NewSigningKeyFile
675674
parseNewSigningKeyFile opt =

cardano-cli/src/Cardano/CLI/Helpers.hs

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE OverloadedStrings #-}
22
{-# LANGUAGE RankNTypes #-}
3+
{-# LANGUAGE ScopedTypeVariables #-}
34

45
module Cardano.CLI.Helpers
56
( HelpersError(..)
@@ -19,12 +20,22 @@ import Cardano.Prelude (ConvertText (..))
1920
import Codec.CBOR.Pretty (prettyHexEnc)
2021
import Codec.CBOR.Read (DeserialiseFailure, deserialiseFromBytes)
2122
import Codec.CBOR.Term (decodeTerm, encodeTerm)
23+
import Control.Exception (Exception (..), IOException)
24+
import Control.Monad (unless, when)
25+
import Control.Monad.IO.Class (MonadIO (..))
26+
import Control.Monad.Trans.Except (ExceptT)
2227
import Control.Monad.Trans.Except.Extra (handleIOExceptT, left)
28+
import Data.Bifunctor (Bifunctor (..))
29+
import Data.ByteString (ByteString)
2330
import qualified Data.ByteString as BS
2431
import qualified Data.ByteString.Lazy as LB
32+
import Data.Functor (void)
33+
import Data.Text (Text)
2534
import qualified Data.Text as Text
35+
import qualified Data.Text.IO as Text
2636
import qualified System.Console.ANSI as ANSI
2737
import System.Console.ANSI
38+
import qualified System.Directory as IO
2839
import qualified System.IO as IO
2940

3041
import Cardano.Binary (Decoder, fromCBOR)
@@ -34,17 +45,6 @@ import qualified Cardano.Chain.Update as Update
3445
import qualified Cardano.Chain.UTxO as UTxO
3546
import Cardano.CLI.Types
3647

37-
import Control.Exception (Exception (..), IOException)
38-
import Control.Monad (unless, when)
39-
import Control.Monad.IO.Class (MonadIO (..))
40-
import Control.Monad.Trans.Except (ExceptT)
41-
import Data.Bifunctor (Bifunctor (..))
42-
import Data.ByteString (ByteString)
43-
import Data.Functor (void)
44-
import Data.Text (Text)
45-
import qualified Data.Text.IO as Text
46-
import qualified System.Directory as IO
47-
4848
data HelpersError
4949
= CBORPrettyPrintError !DeserialiseFailure
5050
| CBORDecodingError !DeserialiseFailure

cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs

+37-43
Original file line numberDiff line numberDiff line change
@@ -1730,31 +1730,28 @@ pSigningKeyFile fdir =
17301730

17311731
pKesPeriod :: Parser KESPeriod
17321732
pKesPeriod =
1733-
KESPeriod <$>
1734-
Opt.option Opt.auto
1735-
( Opt.long "kes-period"
1736-
<> Opt.metavar "NATURAL"
1737-
<> Opt.help "The start of the KES key validity period."
1738-
)
1733+
fmap KESPeriod $ Opt.option (bounded "KES_PERIOD") $ mconcat
1734+
[ Opt.long "kes-period"
1735+
, Opt.metavar "NATURAL"
1736+
, Opt.help "The start of the KES key validity period."
1737+
]
17391738

17401739
pEpochNo :: Parser EpochNo
17411740
pEpochNo =
1742-
EpochNo <$>
1743-
Opt.option Opt.auto
1744-
( Opt.long "epoch"
1745-
<> Opt.metavar "NATURAL"
1746-
<> Opt.help "The epoch number."
1747-
)
1741+
fmap EpochNo $ Opt.option (bounded "EPOCH") $ mconcat
1742+
[ Opt.long "epoch"
1743+
, Opt.metavar "NATURAL"
1744+
, Opt.help "The epoch number."
1745+
]
17481746

17491747

17501748
pEpochNoUpdateProp :: Parser EpochNo
17511749
pEpochNoUpdateProp =
1752-
EpochNo <$>
1753-
Opt.option Opt.auto
1754-
( Opt.long "epoch"
1755-
<> Opt.metavar "NATURAL"
1756-
<> Opt.help "The epoch number in which the update proposal is valid."
1757-
)
1750+
fmap EpochNo $ Opt.option (bounded "EPOCH") $ mconcat
1751+
[ Opt.long "epoch"
1752+
, Opt.metavar "EPOCH"
1753+
, Opt.help "The epoch number in which the update proposal is valid."
1754+
]
17581755

17591756
pGenesisFile :: String -> Parser GenesisFile
17601757
pGenesisFile desc =
@@ -2054,12 +2051,11 @@ pNetworkId =
20542051

20552052
pTestnetMagic :: Parser NetworkMagic
20562053
pTestnetMagic =
2057-
NetworkMagic <$>
2058-
Opt.option Opt.auto
2059-
( Opt.long "testnet-magic"
2060-
<> Opt.metavar "NATURAL"
2061-
<> Opt.help "Specify a testnet magic id."
2062-
)
2054+
fmap NetworkMagic $ Opt.option (bounded "TESTNET_MAGIC") $ mconcat
2055+
[ Opt.long "testnet-magic"
2056+
, Opt.metavar "TESTNET_MAGIC"
2057+
, Opt.help "Specify a testnet magic id."
2058+
]
20632059

20642060
pTxSubmitFile :: Parser FilePath
20652061
pTxSubmitFile =
@@ -2367,12 +2363,12 @@ pPolicyId =
23672363

23682364
pInvalidBefore :: Parser SlotNo
23692365
pInvalidBefore = fmap SlotNo $ asum
2370-
[ Opt.option Opt.auto $ mconcat
2366+
[ Opt.option (bounded "SLOT") $ mconcat
23712367
[ Opt.long "invalid-before"
23722368
, Opt.metavar "SLOT"
23732369
, Opt.help "Time that transaction is valid from (in slots)."
23742370
]
2375-
, Opt.option Opt.auto $ mconcat
2371+
, Opt.option (bounded "SLOT") $ mconcat
23762372
[ Opt.long "lower-bound"
23772373
, Opt.metavar "SLOT"
23782374
, Opt.help $ mconcat
@@ -2386,12 +2382,12 @@ pInvalidBefore = fmap SlotNo $ asum
23862382
pInvalidHereafter :: Parser SlotNo
23872383
pInvalidHereafter =
23882384
fmap SlotNo $ asum
2389-
[ Opt.option Opt.auto $ mconcat
2385+
[ Opt.option (bounded "SLOT") $ mconcat
23902386
[ Opt.long "invalid-hereafter"
23912387
, Opt.metavar "SLOT"
23922388
, Opt.help "Time that transaction is valid until (in slots)."
23932389
]
2394-
, Opt.option Opt.auto $ mconcat
2390+
, Opt.option (bounded "SLOT") $ mconcat
23952391
[ Opt.long "upper-bound"
23962392
, Opt.metavar "SLOT"
23972393
, Opt.help $ mconcat
@@ -2400,7 +2396,7 @@ pInvalidHereafter =
24002396
]
24012397
, Opt.internal
24022398
]
2403-
, Opt.option Opt.auto $ mconcat
2399+
, Opt.option (bounded "SLOT") $ mconcat
24042400
[ Opt.long "ttl"
24052401
, Opt.metavar "SLOT"
24062402
, Opt.help "Time to live (in slots) (deprecated; use --invalid-hereafter instead)."
@@ -3051,12 +3047,11 @@ pPoolDeposit =
30513047

30523048
pEpochBoundRetirement :: Parser EpochNo
30533049
pEpochBoundRetirement =
3054-
EpochNo <$>
3055-
Opt.option Opt.auto
3056-
( Opt.long "pool-retirement-epoch-boundary"
3057-
<> Opt.metavar "INT"
3058-
<> Opt.help "Epoch bound on pool retirement."
3059-
)
3050+
fmap EpochNo $ Opt.option (bounded "EPOCH_BOUNDARY") $ mconcat
3051+
[ Opt.long "pool-retirement-epoch-boundary"
3052+
, Opt.metavar "EPOCH_BOUNDARY"
3053+
, Opt.help "Epoch bound on pool retirement."
3054+
]
30603055

30613056
pNumberOfPools :: Parser Natural
30623057
pNumberOfPools =
@@ -3248,14 +3243,13 @@ defaultByronEpochSlots = 21600
32483243

32493244
pEpochSlots :: Parser EpochSlots
32503245
pEpochSlots =
3251-
EpochSlots <$>
3252-
Opt.option Opt.auto
3253-
( Opt.long "epoch-slots"
3254-
<> Opt.metavar "NATURAL"
3255-
<> Opt.help "The number of slots per epoch for the Byron era."
3256-
<> Opt.value defaultByronEpochSlots -- Default to the mainnet value.
3257-
<> Opt.showDefault
3258-
)
3246+
fmap EpochSlots $ Opt.option (bounded "SLOTS") $ mconcat
3247+
[ Opt.long "epoch-slots"
3248+
, Opt.metavar "SLOTS"
3249+
, Opt.help "The number of slots per epoch for the Byron era."
3250+
, Opt.value defaultByronEpochSlots -- Default to the mainnet value.
3251+
, Opt.showDefault
3252+
]
32593253

32603254
pProtocolVersion :: Parser (Natural, Natural)
32613255
pProtocolVersion =

cardano-cli/test/Test/Golden/Key.hs

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ keyTests :: IO Bool
1212
keyTests =
1313
H.checkSequential
1414
$ H.Group "Key command group"
15-
[ ("golden_KeyNonExtendedKey", Test.Golden.Key.NonExtendedKey.golden_KeyNonExtendedKey)
15+
[ ( "golden_KeyNonExtendedKey_GenesisExtendedVerificationKey"
16+
, Test.Golden.Key.NonExtendedKey.golden_KeyNonExtendedKey_GenesisExtendedVerificationKey
17+
)
18+
, ( "golden_KeyNonExtendedKey_StakeExtendedVerificationKeyShelley"
19+
, Test.Golden.Key.NonExtendedKey.golden_KeyNonExtendedKey_StakeExtendedVerificationKeyShelley
20+
)
1621
]
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{-# LANGUAGE OverloadedStrings #-}
22

33
module Test.Golden.Key.NonExtendedKey
4-
( golden_KeyNonExtendedKey
4+
( golden_KeyNonExtendedKey_GenesisExtendedVerificationKey
5+
, golden_KeyNonExtendedKey_StakeExtendedVerificationKeyShelley
56
) where
67

78
import Control.Monad (void)
@@ -10,30 +11,52 @@ import qualified Hedgehog.Extras.Test.Base as H
1011
import qualified Hedgehog.Extras.Test.File as H
1112
import System.FilePath ((</>))
1213
import Test.OptParse (execCardanoCLI, propertyOnce)
13-
import Test.Utilities (diffVsGoldenFile)
14+
import Test.Utilities (diffFileVsGoldenFile)
1415

1516
{- HLINT ignore "Use camelCase" -}
1617

1718
-- | Test that converting a @cardano-address@ Byron signing key yields the
1819
-- expected result.
19-
golden_KeyNonExtendedKey :: Property
20-
golden_KeyNonExtendedKey =
20+
golden_KeyNonExtendedKey_GenesisExtendedVerificationKey :: Property
21+
golden_KeyNonExtendedKey_GenesisExtendedVerificationKey =
2122
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
2223
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"
2426

2527
H.assertFilesExist [genesisVKeyFp]
2628

2729
-- Convert the `cardano-address` signing key
2830
void $ execCardanoCLI
2931
[ "key", "non-extended-key"
3032
, "--extended-verification-key-file", genesisVKeyFp
31-
, "--verification-key-file", nonExtendedGenesisVKeyFp
33+
, "--verification-key-file", outFp
3234
]
3335

3436
-- Check for existence of the converted signing key file
35-
H.assertFilesExist [nonExtendedGenesisVKeyFp]
37+
H.assertFilesExist [outFp]
3638

37-
contents <- H.readFile nonExtendedGenesisVKeyFp
39+
diffFileVsGoldenFile outFp nonExtendedFp
3840

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

Comments
 (0)