Skip to content

Commit a0a5063

Browse files
committed
WIP
1 parent 78ff484 commit a0a5063

File tree

11 files changed

+43
-11
lines changed

11 files changed

+43
-11
lines changed

cardano-cli/src/Cardano/CLI/EraBased/Genesis/Run.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import Cardano.CLI.EraIndependent.Node.Run
5656
, runNodeKeyGenVrfCmd
5757
)
5858
import Cardano.CLI.IO.Lazy qualified as Lazy
59+
import Cardano.CLI.Read
5960
import Cardano.CLI.Type.Common
6061
import Cardano.CLI.Type.Error.GenesisCmdError
6162
import Cardano.CLI.Type.Error.NodeCmdError

cardano-cli/src/Cardano/CLI/EraBased/Governance/Vote/Run.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{-# LANGUAGE NamedFieldPuns #-}
66
{-# LANGUAGE RankNTypes #-}
77
{-# LANGUAGE ScopedTypeVariables #-}
8+
{-# LANGUAGE TypeApplications #-}
89
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
910

1011
{-# HLINT ignore "Redundant id" #-}
@@ -119,5 +120,4 @@ runGovernanceVoteViewCmd
119120
)
120121
$ unVotingProcedures voteProcedures
121122

122-
fromExceptTCli $
123-
writeLazyByteStringOutput mOutFile output
123+
fromEitherIOCli @(FileError ()) $ writeLazyByteStringOutput mOutFile output

cardano-cli/src/Cardano/CLI/Legacy/Governance/Run.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ import Cardano.CLI.EraBased.Governance.GenesisKeyDelegationCertificate.Run
2323
import Cardano.CLI.EraBased.Governance.Run
2424
import Cardano.CLI.Legacy.Governance.Command
2525
import Cardano.CLI.Orphan ()
26+
import Cardano.CLI.Read
2627
import Cardano.CLI.Type.Common
2728
import Cardano.CLI.Type.Error.GovernanceCmdError
2829

2930
import Control.Monad
3031
import Data.Aeson (eitherDecode)
3132
import Data.ByteString.Lazy qualified as LB
32-
import Data.Text (Text)
3333

3434
runLegacyGovernanceCmds :: LegacyGovernanceCmds -> CIO e ()
3535
runLegacyGovernanceCmds = \case

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import Cardano.Ledger.Conway.Governance qualified as L
2525
import Cardano.Ledger.State qualified as L
2626

2727
import Data.Aeson
28-
import Data.Text qualified as Text
2928

3029
instance ToJSON L.DefaultVote where
3130
toJSON defaultVote =
@@ -69,6 +68,8 @@ instance Convert Era ConwayEraOnwards where
6968
convert = \case
7069
Exp.ConwayEra -> ConwayEraOnwardsConway
7170

71+
-- TODO: Convert readVerificationKeySource to use CIO. We can then
72+
-- remove this instance
7273
instance
7374
Error
7475
( Either
@@ -83,7 +84,7 @@ instance
8384
Right e -> prettyError e
8485

8586
instance Error GovernancePollError where
86-
prettyError = pshow . Text.unpack . renderGovernancePollError
87+
prettyError = pretty . renderGovernancePollError
8788

8889
instance Error String where
89-
prettyError = pshow
90+
prettyError = pretty

cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,6 @@ hprop_golden_governance_committee_checks_wrong_hash_fails =
390390

391391
exitCode === ExitFailure 1
392392

393-
H.diffVsGoldenFile
393+
diffVsGoldenFileExcludeTrace
394394
result
395395
"test/cardano-cli-golden/files/golden/governance/committee/governance_committee_checks_wrong_hash_fails.out"

cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/DRep.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import System.Posix.Files (fileMode, getFileStatus)
2020
import GHC.IO.Exception (ExitCode (ExitFailure))
2121
import Test.Cardano.CLI.Hash (exampleAnchorDataHash, exampleAnchorDataIpfsHash,
2222
exampleAnchorDataPathGolden, serveFilesWhile, tamperBase16Hash)
23-
import Test.Cardano.CLI.Util (execCardanoCLI, execDetailCardanoCLI,
23+
import Test.Cardano.CLI.Util (diffVsGoldenFileExcludeTrace, execCardanoCLI, execDetailCardanoCLI,
2424
noteInputFile, noteTempFile, propertyOnce)
2525

2626
import Hedgehog
@@ -502,6 +502,6 @@ hprop_golden_drep_metadata_hash_url_wrong_hash_fails =
502502

503503
exitCode === ExitFailure 1
504504

505-
H.diffVsGoldenFile
505+
diffVsGoldenFileExcludeTrace
506506
result
507507
"test/cardano-cli-golden/files/golden/governance/drep/drep_metadata_hash_url_wrong_hash_fails.out"

cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import Test.Cardano.CLI.Hash
1515
, tamperBase16Hash
1616
)
1717
import Test.Cardano.CLI.Util
18-
( execCardanoCLI
18+
( diffVsGoldenFileExcludeTrace
19+
, execCardanoCLI
1920
, execDetailConfigCardanoCLI
2021
, noteInputFile
2122
, propertyOnce
@@ -241,4 +242,4 @@ hprop_golden_governance_vote_create_hash_fails =
241242

242243
exitCode === ExitFailure 1
243244

244-
H.diffVsGoldenFile result voteGold
245+
diffVsGoldenFileExcludeTrace result voteGold
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Command failed: governance committee create-cold-key-resignation-certificate
2+
Error: Command failed: governance committee create-cold-key-resignation-certificate
3+
Error: Hashes do not match!
4+
Expected: "ee38a4f5b8b9d8372386cc923bad19d1a0662298cf355bbe947e5eedf127fa9c"
5+
Actual: "de38a4f5b8b9d8372386cc923bad19d1a0662298cf355bbe947e5eedf127fa9c"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Command failed: governance drep metadata-hash
2+
Error: Command failed: governance drep metadata-hash
3+
Error: Hashes do not match!
4+
Expected: "ee38a4f5b8b9d8372386cc923bad19d1a0662298cf355bbe947e5eedf127fa9c"
5+
Actual: "de38a4f5b8b9d8372386cc923bad19d1a0662298cf355bbe947e5eedf127fa9c"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Command failed: governance vote create
2+
Error: Command failed: governance vote create
3+
Error: Hashes do not match!
4+
Expected: "ee38a4f5b8b9d8372386cc923bad19d1a0662298cf355bbe947e5eedf127fa9c"
5+
Actual: "de38a4f5b8b9d8372386cc923bad19d1a0662298cf355bbe947e5eedf127fa9c"

0 commit comments

Comments
 (0)