From d77d91c6404a03328126887493e444cb8c6891ac Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Fri, 23 Feb 2024 05:12:59 +0100 Subject: [PATCH] Update imports --- .github/workflows/haskell.yml | 2 +- cardano-cli/cardano-cli.cabal | 2 -- .../src/Cardano/CLI/Byron/Delegation.hs | 4 --- cardano-cli/src/Cardano/CLI/Byron/Genesis.hs | 3 +- cardano-cli/src/Cardano/CLI/Byron/Key.hs | 4 --- cardano-cli/src/Cardano/CLI/Byron/Parsers.hs | 1 - cardano-cli/src/Cardano/CLI/Byron/Run.hs | 4 --- cardano-cli/src/Cardano/CLI/Byron/Tx.hs | 4 --- .../src/Cardano/CLI/Byron/UpdateProposal.hs | 2 +- cardano-cli/src/Cardano/CLI/Byron/Vote.hs | 4 --- .../Cardano/CLI/EraBased/Options/Common.hs | 1 - .../CLI/EraBased/Options/Transaction.hs | 2 +- cardano-cli/src/Cardano/CLI/EraBased/Run.hs | 2 -- .../src/Cardano/CLI/EraBased/Run/Address.hs | 3 -- .../Cardano/CLI/EraBased/Run/Address/Info.hs | 3 -- .../CLI/EraBased/Run/CreateTestnetData.hs | 5 --- .../src/Cardano/CLI/EraBased/Run/Genesis.hs | 5 --- .../Cardano/CLI/EraBased/Run/Governance.hs | 2 -- .../CLI/EraBased/Run/Governance/Actions.hs | 3 -- .../CLI/EraBased/Run/Governance/Committee.hs | 4 --- .../CLI/EraBased/Run/Governance/DRep.hs | 4 --- .../GenesisKeyDelegationCertificate.hs | 3 -- .../CLI/EraBased/Run/Governance/Hash.hs | 2 -- .../CLI/EraBased/Run/Governance/Poll.hs | 4 --- .../CLI/EraBased/Run/Governance/Vote.hs | 2 -- .../src/Cardano/CLI/EraBased/Run/Key.hs | 3 -- .../src/Cardano/CLI/EraBased/Run/Node.hs | 3 -- .../src/Cardano/CLI/EraBased/Run/Query.hs | 6 ---- .../Cardano/CLI/EraBased/Run/StakeAddress.hs | 5 --- .../src/Cardano/CLI/EraBased/Run/StakePool.hs | 5 --- .../src/Cardano/CLI/EraBased/Run/TextView.hs | 3 -- .../Cardano/CLI/EraBased/Run/Transaction.hs | 5 --- cardano-cli/src/Cardano/CLI/Helpers.hs | 2 +- cardano-cli/src/Cardano/CLI/Json/Friendly.hs | 1 - cardano-cli/src/Cardano/CLI/Legacy/Options.hs | 2 +- .../src/Cardano/CLI/Legacy/Run/Address.hs | 2 -- .../src/Cardano/CLI/Legacy/Run/Genesis.hs | 2 -- .../src/Cardano/CLI/Legacy/Run/Governance.hs | 2 -- cardano-cli/src/Cardano/CLI/Legacy/Run/Key.hs | 1 - .../Cardano/CLI/Legacy/Run/StakeAddress.hs | 2 -- .../src/Cardano/CLI/Legacy/Run/StakePool.hs | 2 -- .../src/Cardano/CLI/Legacy/Run/TextView.hs | 2 -- .../src/Cardano/CLI/Legacy/Run/Transaction.hs | 3 -- cardano-cli/src/Cardano/CLI/Pretty.hs | 35 +++++++++++++++---- cardano-cli/src/Cardano/CLI/Read.hs | 5 --- cardano-cli/src/Cardano/CLI/Run/Ping.hs | 3 +- .../CLI/Types/Errors/AddressCmdError.hs | 2 -- .../CLI/Types/Errors/AddressInfoError.hs | 1 - .../src/Cardano/CLI/Types/Errors/CmdError.hs | 1 - .../CLI/Types/Errors/GenesisCmdError.hs | 1 - .../Types/Errors/GovernanceActionsError.hs | 1 - .../CLI/Types/Errors/GovernanceCmdError.hs | 1 - .../CLI/Types/Errors/GovernanceHashError.hs | 1 - .../CLI/Types/Errors/GovernanceQueryError.hs | 1 - .../Types/Errors/GovernanceVoteCmdError.hs | 1 - .../CLI/Types/Errors/ItnKeyConversionError.hs | 1 - .../Cardano/CLI/Types/Errors/KeyCmdError.hs | 1 - .../Cardano/CLI/Types/Errors/NodeCmdError.hs | 1 - .../CLI/Types/Errors/ProtocolParamsError.hs | 1 - .../Cardano/CLI/Types/Errors/QueryCmdError.hs | 1 - .../Errors/QueryCmdLocalStateQueryError.hs | 2 +- .../Errors/StakeAddressDelegationError.hs | 1 - .../CLI/Types/Errors/StakePoolCmdError.hs | 2 -- .../CLI/Types/Errors/TextViewFileError.hs | 2 -- .../Cardano/CLI/Types/Errors/TxCmdError.hs | 1 - .../CLI/Types/Errors/TxValidationError.hs | 1 - cardano-cli/src/Cardano/CLI/Types/Key.hs | 4 --- cardano-cli/src/Cardano/CLI/Types/Output.hs | 1 - .../Test/Golden/Byron/SigningKeys.hs | 1 - .../Test/Golden/Byron/Tx.hs | 3 -- .../Test/Golden/Byron/UpdateProposal.hs | 3 +- .../Test/Golden/Byron/Vote.hs | 3 +- .../Golden/EraBased/Governance/VerifyPoll.hs | 2 -- .../golden/governance/hash/foo.script.hash | 2 +- .../Test/Cardano/CLI/Util.hs | 4 --- .../Test/Cli/FilePermissions.hs | 2 -- 76 files changed, 40 insertions(+), 178 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index b174810d79..65e26672de 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -24,7 +24,7 @@ jobs: env: # Modify this value to "invalidate" the cabal cache. - CABAL_CACHE_VERSION: "2024-02-23" + CABAL_CACHE_VERSION: "2024-02-23-3" concurrency: group: > diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index c39cd8c49a..bff4c5c591 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -270,7 +270,6 @@ library cardano-cli-test-lib , hedgehog-extras ^>= 0.6.1.0 , process , text - , transformers test-suite cardano-cli-test import: project-config @@ -296,7 +295,6 @@ test-suite cardano-cli-test , tasty-hedgehog , text , time - , transformers build-tool-depends: tasty-discover:tasty-discover diff --git a/cardano-cli/src/Cardano/CLI/Byron/Delegation.hs b/cardano-cli/src/Cardano/CLI/Byron/Delegation.hs index f03f425465..8e49a865ae 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/Delegation.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/Delegation.hs @@ -15,7 +15,6 @@ where import Cardano.Api.Byron import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import qualified Cardano.Chain.Delegation as Dlg import Cardano.Chain.Slotting (EpochNumber) @@ -29,9 +28,6 @@ import Prelude hiding ((.)) import Control.Category import Control.Monad (unless) -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (left) import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as LB import Data.Text (Text) diff --git a/cardano-cli/src/Cardano/CLI/Byron/Genesis.hs b/cardano-cli/src/Cardano/CLI/Byron/Genesis.hs index 8ef60131b6..1e255a13ea 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/Genesis.hs @@ -15,7 +15,7 @@ where import Cardano.Api (Key (..), NetworkId, writeSecrets) import Cardano.Api.Byron (ByronKey, SerialiseAsRawBytes (..), SigningKey (..), toByronRequiresNetworkMagic) -import Cardano.Api.Pretty +import Cardano.CLI.Pretty import qualified Cardano.Chain.Common as Common import Cardano.Chain.Delegation hiding (Map, epoch) @@ -28,7 +28,6 @@ import Cardano.CLI.Types.Common (GenesisFile (..)) import qualified Cardano.Crypto as Crypto import Cardano.Prelude (canonicalDecodePretty, canonicalEncodePretty) -import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Trans (MonadTrans (..)) import Control.Monad.Trans.Except (ExceptT (..), withExceptT) import Control.Monad.Trans.Except.Extra (firstExceptT, left, right) diff --git a/cardano-cli/src/Cardano/CLI/Byron/Key.hs b/cardano-cli/src/Cardano/CLI/Byron/Key.hs index 6bf0df5b7b..c743579831 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/Key.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/Key.hs @@ -17,16 +17,12 @@ module Cardano.CLI.Byron.Key where import Cardano.Api.Byron -import Cardano.Api.Pretty import qualified Cardano.Chain.Common as Common import Cardano.CLI.Types.Common import qualified Cardano.Crypto.Signing as Crypto import Control.Exception (Exception (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, handleIOExceptT, hoistEither, left, - right) import qualified Data.ByteString as SB import qualified Data.ByteString.UTF8 as UTF8 import Data.String (IsString, fromString) diff --git a/cardano-cli/src/Cardano/CLI/Byron/Parsers.hs b/cardano-cli/src/Cardano/CLI/Byron/Parsers.hs index b93a9a1465..5b7cdc1601 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/Parsers.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/Parsers.hs @@ -28,7 +28,6 @@ import Cardano.Api hiding (GenesisParameters, UpdateProposal) import Cardano.Api.Byron (Address (..), ByronProtocolParametersUpdate (..), toByronLovelace) import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import Cardano.Api.Shelley (ReferenceScript (ReferenceScriptNone)) import Cardano.Chain.Common (BlockCount (..), TxFeePolicy (..), TxSizeLinear (..), diff --git a/cardano-cli/src/Cardano/CLI/Byron/Run.hs b/cardano-cli/src/Cardano/CLI/Byron/Run.hs index 5c17012eee..f36ad6e99f 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/Run.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/Run.hs @@ -24,9 +24,6 @@ import Cardano.CLI.Types.Common import qualified Cardano.Crypto.Hashing as Crypto import qualified Cardano.Crypto.Signing as Crypto -import Control.Monad.IO.Class (MonadIO (liftIO)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, hoistEither, left) import Data.Bifunctor (Bifunctor (..)) import qualified Data.ByteString.Char8 as BS import Data.Text (Text) @@ -34,7 +31,6 @@ import qualified Data.Text.IO as Text import qualified Data.Text.Lazy.Builder as Builder import qualified Data.Text.Lazy.IO as TL import qualified Formatting as F -import Prettyprinter -- | Data type that encompasses all the possible errors of the -- Byron client. diff --git a/cardano-cli/src/Cardano/CLI/Byron/Tx.hs b/cardano-cli/src/Cardano/CLI/Byron/Tx.hs index a153a34b06..17369e8efe 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/Tx.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/Tx.hs @@ -28,7 +28,6 @@ where import Cardano.Api import Cardano.Api.Byron import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import qualified Cardano.Binary as Binary import qualified Cardano.Chain.Common as Common @@ -42,9 +41,6 @@ import qualified Ouroboros.Consensus.Byron.Ledger as Byron import Ouroboros.Consensus.Cardano.Block (EraMismatch (..)) import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Client as Net.Tx -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (left) import Data.Bifunctor (Bifunctor (..)) import Data.ByteString (ByteString) import qualified Data.ByteString as B diff --git a/cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs b/cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs index c96450721e..4a2ac1eb6f 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs @@ -13,7 +13,7 @@ module Cardano.CLI.Byron.UpdateProposal import Cardano.Api (NetworkId, SerialiseAsRawBytes (..), SocketPath) import Cardano.Api.Byron (AsType (AsByronUpdateProposal), ByronProtocolParametersUpdate, ByronUpdateProposal, makeByronUpdateProposal, toByronLedgerUpdateProposal) -import Cardano.Api.Pretty +import Cardano.CLI.Pretty import Cardano.Chain.Update (InstallerHash (..), ProtocolVersion (..), SoftwareVersion (..), SystemTag (..)) diff --git a/cardano-cli/src/Cardano/CLI/Byron/Vote.hs b/cardano-cli/src/Cardano/CLI/Byron/Vote.hs index 17d56e1683..29c8502426 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/Vote.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/Vote.hs @@ -11,7 +11,6 @@ module Cardano.CLI.Byron.Vote ) where import Cardano.Api.Byron -import Cardano.Api.Pretty import qualified Cardano.Binary as Binary import Cardano.CLI.Byron.Genesis (ByronGenesisError) @@ -24,9 +23,6 @@ import Cardano.CLI.Types.Common import Ouroboros.Consensus.Ledger.SupportsMempool (txId) import Ouroboros.Consensus.Util.Condense (condense) -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, hoistEither) import Control.Tracer (stdoutTracer, traceWith) import Data.Bifunctor (first) import qualified Data.ByteString as BS diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs index 3977812388..141365e526 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs @@ -13,7 +13,6 @@ module Cardano.CLI.EraBased.Options.Common where import Cardano.Api import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import Cardano.Api.Shelley import Cardano.CLI.Environment (EnvCli (..), envCliAnyShelleyBasedEra, diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs index 8283c64035..687a834816 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs @@ -19,7 +19,7 @@ import Data.Foldable import Options.Applicative hiding (help, str) import qualified Options.Applicative as Opt import qualified Options.Applicative.Help as H -import Prettyprinter (line, pretty) +import Prettyprinter (line) {- HLINT ignore "Use <$>" -} {- HLINT ignore "Move brackets to avoid $" -} diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run.hs index 1907e0c9a6..b3157cdfce 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run.hs @@ -22,8 +22,6 @@ import Cardano.CLI.EraBased.Run.TextView import Cardano.CLI.EraBased.Run.Transaction import Cardano.CLI.Types.Errors.CmdError -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra (firstExceptT) import Data.Function ((&)) runAnyEraCommand :: () diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs index d3ba338a5f..717fb287b5 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs @@ -26,9 +26,6 @@ import Cardano.CLI.Types.Key (PaymentVerifier (..), StakeIdentifier (. StakeVerifier (..), VerificationKeyTextOrFile, generateKeyPair, readVerificationKeyOrFile, readVerificationKeyTextOrFileAnyOf) -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, left, newExceptT) import qualified Data.ByteString.Char8 as BS import Data.Function import qualified Data.Text.IO as Text diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Address/Info.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Address/Info.hs index 7ce5e5d1c6..fe71b29d72 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Address/Info.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Address/Info.hs @@ -9,9 +9,6 @@ import Cardano.Api import Cardano.CLI.Types.Errors.AddressInfoError -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (left) import Data.Aeson (ToJSON (..), object, (.=)) import Data.Aeson.Encode.Pretty (encodePretty) import qualified Data.ByteString.Lazy.Char8 as LBS diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs index 9084638da0..40d79ddf52 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs @@ -52,11 +52,6 @@ import Ouroboros.Consensus.Shelley.Node (ShelleyGenesisStaking (..)) import Control.DeepSeq (NFData, force) import Control.Monad (forM, forM_, unless, void, when, zipWithM) -import Control.Monad.Except (MonadError (..), runExceptT) -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, handleIOExceptT, hoistEither, - newExceptT) import qualified Data.Aeson as Aeson import Data.Bifunctor (Bifunctor (..)) import qualified Data.Binary.Get as Bin diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs index 68223aca8c..b40460826e 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs @@ -75,11 +75,6 @@ import Ouroboros.Consensus.Shelley.Node (ShelleyGenesisStaking (..)) import Control.DeepSeq (NFData, force) import Control.Monad (forM, forM_, unless, when) -import Control.Monad.Except (MonadError (..)) -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT, throwE, withExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, handleIOExceptT, hoistEither, left, - newExceptT) import Data.Aeson hiding (Key) import qualified Data.Aeson as Aeson import Data.Aeson.Encode.Pretty (encodePretty) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance.hs index 6989a4db25..f09f355d3b 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance.hs @@ -31,8 +31,6 @@ import Cardano.CLI.Types.Errors.CmdError import Cardano.CLI.Types.Errors.GovernanceCmdError import Control.Monad -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra import Data.Function import qualified Data.Map.Strict as Map diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs index 9f786ee67d..66065379b3 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs @@ -25,9 +25,6 @@ import Cardano.CLI.Types.Errors.GovernanceActionsError import Cardano.CLI.Types.Key import Control.Monad -import Control.Monad.Except (ExceptT) -import Control.Monad.Trans (MonadTrans (..)) -import Control.Monad.Trans.Except.Extra import Data.Function import qualified Data.Map.Strict as Map diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Committee.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Committee.hs index 91f0616c1e..9295fa78ee 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Committee.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Committee.hs @@ -17,10 +17,6 @@ import Cardano.CLI.Types.Errors.GovernanceCommitteeError import Cardano.CLI.Types.Key import Cardano.CLI.Types.Key.VerificationKey -import Control.Monad.Except (ExceptT) -import Control.Monad.IO.Class (liftIO) -import Control.Monad.Trans (lift) -import Control.Monad.Trans.Except.Extra import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BS import Data.Function diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs index 3872a3aa07..8265dde3e6 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs @@ -27,10 +27,6 @@ import Cardano.CLI.Types.Errors.GovernanceCmdError import Cardano.CLI.Types.Errors.RegistrationError import Cardano.CLI.Types.Key -import Control.Monad.IO.Class -import Control.Monad.Trans.Class -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra import Data.Function import qualified Data.Text.Encoding as Text diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/GenesisKeyDelegationCertificate.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/GenesisKeyDelegationCertificate.hs index 995c1c74d4..de0032d6d7 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/GenesisKeyDelegationCertificate.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/GenesisKeyDelegationCertificate.hs @@ -12,9 +12,6 @@ import Cardano.Api.Shelley import Cardano.CLI.Types.Errors.GovernanceCmdError import Cardano.CLI.Types.Key -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra - runGovernanceGenesisKeyDelegationCertificate :: ShelleyToBabbageEra era -> VerificationKeyOrHashOrFile GenesisKey diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Hash.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Hash.hs index d5fd8d4e81..f7c46a573d 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Hash.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Hash.hs @@ -24,8 +24,6 @@ import Cardano.CLI.Types.Errors.GovernanceCmdError import Cardano.CLI.Types.Errors.GovernanceHashError import Cardano.Crypto.Hash (hashToTextAsHex) -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra import qualified Data.ByteString as BS import Data.Function import qualified Data.Text.Encoding as Text diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Poll.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Poll.hs index 3ac4e6b683..6e8d57a18d 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Poll.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Poll.hs @@ -19,10 +19,6 @@ import Cardano.CLI.Read import Cardano.CLI.Types.Errors.GovernanceCmdError import Control.Monad -import Control.Monad.IO.Class -import Control.Monad.Trans.Class (lift) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra import qualified Data.ByteString.Char8 as BSC import Data.Function ((&)) import Data.String (fromString) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs index 7e34eff091..201df0c1c2 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs @@ -22,8 +22,6 @@ import Cardano.CLI.Types.Errors.GovernanceVoteCmdError import Cardano.CLI.Types.Governance import Cardano.CLI.Types.Key -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra import Data.Aeson.Encode.Pretty import Data.Function import qualified Data.Yaml.Pretty as Yaml diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs index 0d369edf89..ae180f7bdd 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs @@ -48,9 +48,6 @@ import qualified Cardano.Crypto.Wallet as Crypto import qualified Codec.Binary.Bech32 as Bech32 import qualified Control.Exception as Exception -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, hoistEither, left, newExceptT) import Data.Bifunctor (Bifunctor (..)) import Data.ByteString (ByteString) import qualified Data.ByteString as BS diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Node.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Node.hs index af2240a921..cef97c09f8 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Node.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Node.hs @@ -22,9 +22,6 @@ import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.NodeCmdError import Cardano.CLI.Types.Key -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, hoistEither, newExceptT) import qualified Data.ByteString.Char8 as BS import Data.String (fromString) import Data.Word (Word64) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs index ae83f0642f..ee445884e4 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs @@ -41,7 +41,6 @@ import Cardano.Api hiding (QueryInShelleyBasedEra (..)) import qualified Cardano.Api as Api import Cardano.Api.Byron hiding (QueryInShelleyBasedEra (..)) import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import Cardano.Api.Shelley hiding (QueryInShelleyBasedEra (..)) import qualified Cardano.CLI.EraBased.Commands.Query as Cmd @@ -68,11 +67,6 @@ import Ouroboros.Network.Block (Serialised (..)) import qualified Ouroboros.Network.Protocol.LocalStateQuery.Type as Consensus import Control.Monad (forM, forM_, join) -import Control.Monad.IO.Class (MonadIO) -import Control.Monad.IO.Unlift (MonadIO (..)) -import Control.Monad.Trans.Class -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra import Data.Aeson as Aeson import qualified Data.Aeson as A import Data.Aeson.Encode.Pretty (encodePretty) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs index f5a70f23ef..2cc9f724ab 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs @@ -31,11 +31,6 @@ import Cardano.CLI.Types.Errors.StakeAddressRegistrationError import Cardano.CLI.Types.Governance import Cardano.CLI.Types.Key -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans (lift) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, hoistEither, left, newExceptT, - onLeft) import qualified Data.ByteString.Char8 as BS import Data.Function ((&)) import qualified Data.Text.IO as Text diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/StakePool.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/StakePool.hs index f591512cfd..1023c744f7 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/StakePool.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/StakePool.hs @@ -24,11 +24,6 @@ import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.StakePoolCmdError import Cardano.CLI.Types.Key (readVerificationKeyOrFile) -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans (lift) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, handleIOExceptT, hoistEither, left, - newExceptT, onLeft) import qualified Data.ByteString.Char8 as BS import Data.Function ((&)) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/TextView.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/TextView.hs index 232d40883c..4c11600d6f 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/TextView.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/TextView.hs @@ -13,9 +13,6 @@ import Cardano.CLI.EraBased.Commands.TextView import Cardano.CLI.Helpers (pPrintCBOR) import Cardano.CLI.Types.Errors.TextViewFileError -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, newExceptT) import qualified Data.ByteString.Lazy.Char8 as LBS runTextViewCmds :: TextViewCmds era -> ExceptT TextViewFileError IO () diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs index 071e93d675..0ade293acc 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs @@ -52,11 +52,6 @@ import qualified Ouroboros.Network.Protocol.LocalStateQuery.Type as Consensus import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Client as Net.Tx import Control.Monad (forM) -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans (MonadTrans (..)) -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra (firstExceptT, hoistEither, hoistMaybe, left, - newExceptT, onLeft, onNothing) import Data.Aeson.Encode.Pretty (encodePretty) import Data.Bifunctor (Bifunctor (..)) import qualified Data.ByteString.Char8 as BS diff --git a/cardano-cli/src/Cardano/CLI/Helpers.hs b/cardano-cli/src/Cardano/CLI/Helpers.hs index 7249b97ed8..78634e8c35 100644 --- a/cardano-cli/src/Cardano/CLI/Helpers.hs +++ b/cardano-cli/src/Cardano/CLI/Helpers.hs @@ -17,7 +17,7 @@ module Cardano.CLI.Helpers ) where import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty +import Cardano.CLI.Pretty (Doc, pretty, pshow) import Cardano.Chain.Block (decCBORABlockOrBoundary) import qualified Cardano.Chain.Delegation as Delegation diff --git a/cardano-cli/src/Cardano/CLI/Json/Friendly.hs b/cardano-cli/src/Cardano/CLI/Json/Friendly.hs index c36df87daf..5607b8d804 100644 --- a/cardano-cli/src/Cardano/CLI/Json/Friendly.hs +++ b/cardano-cli/src/Cardano/CLI/Json/Friendly.hs @@ -25,7 +25,6 @@ import Cardano.Api.Shelley (Address (ShelleyAddress), Hash (..), ShelleyLedgerEra, StakeAddress (..), fromShelleyPaymentCredential, fromShelleyStakeReference, toShelleyLovelace, toShelleyStakeCredential) -import Control.Monad.Trans (MonadIO) import Data.Aeson (Value (..), object, toJSON, (.=)) import qualified Data.Aeson as Aeson import qualified Data.Aeson.Encode.Pretty as Aeson diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Options.hs b/cardano-cli/src/Cardano/CLI/Legacy/Options.hs index 15fcd7866a..a1f81c395d 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Options.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Options.hs @@ -50,7 +50,7 @@ import Data.Word (Word64) import Options.Applicative hiding (help, str) import qualified Options.Applicative as Opt import qualified Options.Applicative.Help as H -import Prettyprinter (line, pretty) +import Prettyprinter (line) {- HLINT ignore "Use <$>" -} {- HLINT ignore "Move brackets to avoid $" -} diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Address.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Address.hs index 0aa940b4ed..bde7d168aa 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Address.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Address.hs @@ -20,8 +20,6 @@ import Cardano.CLI.Types.Errors.AddressInfoError import Cardano.CLI.Types.Key (PaymentVerifier (..), StakeIdentifier (..), VerificationKeyTextOrFile) -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT) import Data.Function import Data.Text (Text) diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs index b69a5e526b..86b804cbc2 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs @@ -21,8 +21,6 @@ import Cardano.CLI.Legacy.Commands.Genesis import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.GenesisCmdError -import Control.Monad.Trans.Except (ExceptT) - runLegacyGenesisCmds :: LegacyGenesisCmds -> ExceptT GenesisCmdError IO () runLegacyGenesisCmds = \case GenesisKeyGenGenesis vk sk -> diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs index 59b1d4fa28..fafcc686dc 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs @@ -23,8 +23,6 @@ import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.GovernanceCmdError import Control.Monad -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra import Data.Aeson (eitherDecode) import qualified Data.ByteString.Lazy as LB import Data.Function ((&)) diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Key.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Key.hs index 80450fa268..42becd300b 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Key.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Key.hs @@ -13,7 +13,6 @@ import Cardano.CLI.Legacy.Commands.Key import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.KeyCmdError -import Control.Monad.Trans.Except (ExceptT) import Data.Text (Text) runLegacyKeyCmds :: () diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/StakeAddress.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/StakeAddress.hs index d9ed1e287f..889bb029bf 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/StakeAddress.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/StakeAddress.hs @@ -14,8 +14,6 @@ import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.StakeAddressCmdError import Cardano.CLI.Types.Key -import Control.Monad.Trans.Except (ExceptT) - runLegacyStakeAddressCmds :: () => LegacyStakeAddressCmds -> ExceptT StakeAddressCmdError IO () diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/StakePool.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/StakePool.hs index d82e51519e..0eaeb38d43 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/StakePool.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/StakePool.hs @@ -17,8 +17,6 @@ import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.StakePoolCmdError import Cardano.CLI.Types.Key (VerificationKeyOrFile) -import Control.Monad.Trans.Except (ExceptT) - runLegacyStakePoolCmds :: () => LegacyStakePoolCmds -> ExceptT StakePoolCmdError IO () diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/TextView.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/TextView.hs index 53e367c08e..cc8a1e60b8 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/TextView.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/TextView.hs @@ -11,8 +11,6 @@ import Cardano.CLI.EraBased.Run.TextView import Cardano.CLI.Legacy.Commands.TextView import Cardano.CLI.Types.Errors.TextViewFileError -import Control.Monad.Trans.Except (ExceptT) - runLegacyTextViewCmds :: LegacyTextViewCmds -> ExceptT TextViewFileError IO () runLegacyTextViewCmds = \case TextViewInfo fpath mOutfile -> runLegacyTextViewInfoCmd fpath mOutfile diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs index 95b2e6e161..3852a816db 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs @@ -20,9 +20,6 @@ import Cardano.CLI.Types.Errors.TxCmdError import Cardano.CLI.Types.Errors.TxValidationError import Cardano.CLI.Types.Governance -import Control.Monad.Trans.Class -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra import Data.Function runLegacyTransactionCmds :: LegacyTransactionCmds -> ExceptT TxCmdError IO () diff --git a/cardano-cli/src/Cardano/CLI/Pretty.hs b/cardano-cli/src/Cardano/CLI/Pretty.hs index 1e8e0c9150..652e330a3f 100644 --- a/cardano-cli/src/Cardano/CLI/Pretty.hs +++ b/cardano-cli/src/Cardano/CLI/Pretty.hs @@ -1,15 +1,38 @@ module Cardano.CLI.Pretty - ( module Pretty - , putLn + ( putLn , hPutLn - ) where -import Cardano.Api.Pretty -import qualified Cardano.Api.Pretty as Pretty + -- Re-exported functions from Cardano.Api related to pretty-printing + , black + , blue + , cyan + , docToLazyText + , docToString + , docToText + , green + , magenta + , prettyException + , pshow + , red + , white + , yellow + , (<+>) + , hsep + , vsep + , MonadIO(..) + , Ann + , ShowOf(..) + , Doc + , Pretty(..) + + ) where +import Cardano.Api (black, blue, cyan, docToLazyText, docToString, + docToText, green, magenta, prettyException, pshow, + red, white, yellow, (<+>), hsep, vsep, MonadIO(..), + Ann, ShowOf(..), Doc, Pretty(..)) import qualified Control.Concurrent.QSem as IO import Control.Exception (bracket_) -import Control.Monad.IO.Class (MonadIO, liftIO) import qualified Data.Text.Lazy.IO as TextLazy import Prettyprinter.Render.Terminal import qualified System.IO as IO diff --git a/cardano-cli/src/Cardano/CLI/Read.hs b/cardano-cli/src/Cardano/CLI/Read.hs index 05c35494af..f430c2e091 100644 --- a/cardano-cli/src/Cardano/CLI/Read.hs +++ b/cardano-cli/src/Cardano/CLI/Read.hs @@ -100,7 +100,6 @@ module Cardano.CLI.Read import Cardano.Api as Api import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import Cardano.Api.Shelley as Api import qualified Cardano.Binary as CBOR @@ -116,10 +115,6 @@ import Prelude import Control.Exception (bracket, displayException) import Control.Monad (forM, unless, when) -import Control.Monad.IO.Class -import Control.Monad.Trans (MonadTrans (..)) -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra import qualified Data.Aeson as Aeson import Data.Bifunctor import Data.ByteString (ByteString) diff --git a/cardano-cli/src/Cardano/CLI/Run/Ping.hs b/cardano-cli/src/Cardano/CLI/Run/Ping.hs index b466f82ea8..a52e96ac47 100644 --- a/cardano-cli/src/Cardano/CLI/Run/Ping.hs +++ b/cardano-cli/src/Cardano/CLI/Run/Ping.hs @@ -11,7 +11,7 @@ module Cardano.CLI.Run.Ping , parsePingCmd ) where -import Cardano.Api.Pretty +import Cardano.CLI.Pretty import qualified Cardano.Network.Ping as CNP @@ -21,7 +21,6 @@ import qualified Control.Concurrent.Class.MonadSTM.Strict as STM import Control.Exception (SomeException) import Control.Monad (forM, unless) import Control.Monad.Class.MonadAsync (MonadAsync (async, wait, waitCatch)) -import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Except (ExceptT) import Control.Monad.Trans.Except.Extra (left) import Control.Tracer (Tracer (..)) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/AddressCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/AddressCmdError.hs index 06bd8dd80d..0a9b7f23b2 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/AddressCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/AddressCmdError.hs @@ -17,8 +17,6 @@ import Cardano.CLI.Types.Errors.AddressInfoError import Cardano.CLI.Types.Key (VerificationKeyTextOrFileError (..), renderVerificationKeyTextOrFileError) -import Prettyprinter - data AddressCmdError = AddressCmdAddressInfoError !AddressInfoError | AddressCmdReadKeyFileError !(FileError InputDecodeError) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/AddressInfoError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/AddressInfoError.hs index 7c1001a037..a0b0361929 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/AddressInfoError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/AddressInfoError.hs @@ -5,7 +5,6 @@ module Cardano.CLI.Types.Errors.AddressInfoError ) where import Cardano.Api -import Cardano.Api.Pretty import Data.Text (Text) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/CmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/CmdError.hs index fb9e482040..0099bfb3c7 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/CmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/CmdError.hs @@ -25,7 +25,6 @@ import Cardano.CLI.Types.Errors.TextViewFileError import Cardano.CLI.Types.Errors.TxCmdError import Data.Text (Text) -import Prettyprinter data CmdError = CmdAddressError !AddressCmdError diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GenesisCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GenesisCmdError.hs index 56e5bd9b6e..944cd40aa9 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/GenesisCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GenesisCmdError.hs @@ -6,7 +6,6 @@ module Cardano.CLI.Types.Errors.GenesisCmdError ) where import Cardano.Api -import Cardano.Api.Pretty import Cardano.CLI.Byron.Genesis as Byron import Cardano.CLI.Types.Common diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceActionsError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceActionsError.hs index e7e9ad80ca..a7840ad3a1 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceActionsError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceActionsError.hs @@ -5,7 +5,6 @@ module Cardano.CLI.Types.Errors.GovernanceActionsError ) where import Cardano.Api -import Cardano.Api.Pretty import Cardano.CLI.Read diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceCmdError.hs index cce1d5492d..f67cf4daba 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceCmdError.hs @@ -5,7 +5,6 @@ module Cardano.CLI.Types.Errors.GovernanceCmdError where import Cardano.Api -import Cardano.Api.Pretty import Cardano.Api.Shelley import Cardano.Binary (DecoderError) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceHashError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceHashError.hs index b24af608e1..40ca1525e7 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceHashError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceHashError.hs @@ -4,7 +4,6 @@ module Cardano.CLI.Types.Errors.GovernanceHashError ) where import Cardano.Api -import Cardano.Api.Pretty import Cardano.CLI.Read (ScriptDecodeError) import Cardano.Prelude (Exception (displayException), IOException) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceQueryError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceQueryError.hs index 614977a790..4be24f77a4 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceQueryError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceQueryError.hs @@ -2,7 +2,6 @@ module Cardano.CLI.Types.Errors.GovernanceQueryError where import Cardano.Api -import Cardano.Api.Pretty import Cardano.Api.Shelley import Ouroboros.Consensus.Cardano.Block (EraMismatch) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceVoteCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceVoteCmdError.hs index 2cca84fe12..0a3a7e4cba 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceVoteCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceVoteCmdError.hs @@ -11,7 +11,6 @@ import Cardano.CLI.Read (VoteError) import qualified Data.Text.Lazy.Builder as TL import qualified Formatting.Buildable as B -import Prettyprinter data GovernanceVoteCmdError = GovernanceVoteCmdReadVerificationKeyError !(FileError InputDecodeError) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/ItnKeyConversionError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/ItnKeyConversionError.hs index 62a8c221ba..852d9c25e2 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/ItnKeyConversionError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/ItnKeyConversionError.hs @@ -10,7 +10,6 @@ module Cardano.CLI.Types.Errors.ItnKeyConversionError ) where import Cardano.Api -import Cardano.Api.Pretty import Control.Exception (Exception (..), IOException) import Data.ByteString (ByteString) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/KeyCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/KeyCmdError.hs index 3b498c1c9a..a708a80d2f 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/KeyCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/KeyCmdError.hs @@ -9,7 +9,6 @@ module Cardano.CLI.Types.Errors.KeyCmdError ) where import Cardano.Api -import Cardano.Api.Pretty import qualified Cardano.CLI.Byron.Key as Byron import Cardano.CLI.Types.Errors.CardanoAddressSigningKeyConversionError diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/NodeCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/NodeCmdError.hs index 08ac21b308..19680156de 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/NodeCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/NodeCmdError.hs @@ -7,7 +7,6 @@ module Cardano.CLI.Types.Errors.NodeCmdError ) where import Cardano.Api -import Cardano.Api.Pretty {- HLINT ignore "Reduce duplication" -} diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/ProtocolParamsError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/ProtocolParamsError.hs index 91490aef6c..ee62502103 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/ProtocolParamsError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/ProtocolParamsError.hs @@ -10,7 +10,6 @@ module Cardano.CLI.Types.Errors.ProtocolParamsError ) where import Cardano.Api -import Cardano.Api.Pretty import Data.Text (Text) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs index 116d96d5ca..edc730886f 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs @@ -14,7 +14,6 @@ module Cardano.CLI.Types.Errors.QueryCmdError ) where import Cardano.Api hiding (QueryInShelleyBasedEra (..)) -import Cardano.Api.Pretty import Cardano.Api.Shelley hiding (QueryInShelleyBasedEra (..)) import Cardano.Binary (DecoderError) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdLocalStateQueryError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdLocalStateQueryError.hs index 959e95811b..dd55616adc 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdLocalStateQueryError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdLocalStateQueryError.hs @@ -7,7 +7,7 @@ module Cardano.CLI.Types.Errors.QueryCmdLocalStateQueryError ) where import Cardano.Api (Error (..)) -import Cardano.Api.Pretty +import Cardano.CLI.Pretty import Cardano.CLI.Types.Errors.NodeEraMismatchError import Ouroboros.Consensus.Cardano.Block (EraMismatch (..)) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/StakeAddressDelegationError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/StakeAddressDelegationError.hs index 56759c6a50..9a4c96e18b 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/StakeAddressDelegationError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/StakeAddressDelegationError.hs @@ -6,7 +6,6 @@ module Cardano.CLI.Types.Errors.StakeAddressDelegationError ) where import Cardano.Api -import Cardano.Api.Pretty newtype StakeAddressDelegationError = VoteDelegationNotSupported (EraInEon ShelleyToBabbageEra) deriving Show diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/StakePoolCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/StakePoolCmdError.hs index b10526f92f..4715ff7e63 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/StakePoolCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/StakePoolCmdError.hs @@ -10,8 +10,6 @@ module Cardano.CLI.Types.Errors.StakePoolCmdError import Cardano.Api -import Prettyprinter - data StakePoolCmdError = StakePoolCmdReadFileError !(FileError TextEnvelopeError) | StakePoolCmdReadKeyFileError !(FileError InputDecodeError) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/TextViewFileError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/TextViewFileError.hs index caba8b44b0..df558e284e 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/TextViewFileError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/TextViewFileError.hs @@ -10,8 +10,6 @@ import Cardano.Api import Cardano.CLI.Helpers (HelpersError, renderHelpersError) -import Prettyprinter - data TextViewFileError = TextViewReadFileError (FileError TextEnvelopeError) | TextViewCBORPrettyPrintError !HelpersError diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/TxCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/TxCmdError.hs index fbbf73d45a..e267a92674 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/TxCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/TxCmdError.hs @@ -14,7 +14,6 @@ module Cardano.CLI.Types.Errors.TxCmdError ) where import Cardano.Api -import Cardano.Api.Pretty import Cardano.Api.Shelley import Cardano.CLI.Read diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/TxValidationError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/TxValidationError.hs index 5a96a0aae9..5a1b1b2306 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/TxValidationError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/TxValidationError.hs @@ -37,7 +37,6 @@ module Cardano.CLI.Types.Errors.TxValidationError import Cardano.Api import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import Cardano.Api.Shelley import Cardano.CLI.Types.Common diff --git a/cardano-cli/src/Cardano/CLI/Types/Key.hs b/cardano-cli/src/Cardano/CLI/Types/Key.hs index 97784b22e5..6ab142bdd8 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Key.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Key.hs @@ -48,15 +48,11 @@ module Cardano.CLI.Types.Key import Cardano.Api import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import Cardano.Api.Shelley import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.DelegationError -import Control.Monad.Trans -import Control.Monad.Trans.Except -import Control.Monad.Trans.Except.Extra import Data.Bifunctor (Bifunctor (..)) import qualified Data.ByteString as BS import Data.Function diff --git a/cardano-cli/src/Cardano/CLI/Types/Output.hs b/cardano-cli/src/Cardano/CLI/Types/Output.hs index da9387b675..a8f9b797ac 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Output.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Output.hs @@ -14,7 +14,6 @@ module Cardano.CLI.Types.Output import Cardano.Api import qualified Cardano.Api.Ledger as L -import Cardano.Api.Pretty import Cardano.Api.Shelley import Cardano.CLI.Types.Common diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/SigningKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/SigningKeys.hs index b074b77b2c..9dcf4e7c8d 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/SigningKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/SigningKeys.hs @@ -20,7 +20,6 @@ import qualified Cardano.Crypto.Signing as Crypto import Codec.CBOR.Read (deserialiseFromBytes) import Control.Monad (void) -import Control.Monad.Trans.Except (runExceptT) import qualified Data.ByteString.Lazy as LB import Test.Cardano.CLI.Util diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Tx.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Tx.hs index 85d1356634..6c9e44e378 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Tx.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Tx.hs @@ -3,14 +3,11 @@ module Test.Golden.Byron.Tx where import Cardano.Api -import Cardano.Api.Pretty import Cardano.Chain.UTxO (ATxAux) import Cardano.CLI.Byron.Tx import Control.Monad (void) -import Control.Monad.IO.Class (liftIO) -import Control.Monad.Trans.Except (runExceptT) import Data.ByteString (ByteString) import Test.Cardano.CLI.Util diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/UpdateProposal.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/UpdateProposal.hs index fc53082187..0b22c94bb2 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/UpdateProposal.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/UpdateProposal.hs @@ -2,12 +2,11 @@ module Test.Golden.Byron.UpdateProposal where -import Cardano.Api.Pretty +import Cardano.CLI.Pretty import Cardano.CLI.Byron.UpdateProposal import Control.Monad (void) -import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Trans.Except (runExceptT) import Test.Cardano.CLI.Util diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Vote.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Vote.hs index 7330d04062..0257c91c0c 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Vote.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Vote.hs @@ -2,12 +2,11 @@ module Test.Golden.Byron.Vote where -import Cardano.Api.Pretty +import Cardano.CLI.Pretty import Cardano.CLI.Byron.Vote import Control.Monad (void) -import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Trans.Except (runExceptT) import Test.Cardano.CLI.Util diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/EraBased/Governance/VerifyPoll.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/EraBased/Governance/VerifyPoll.hs index b171013934..fe05cf77a6 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/EraBased/Governance/VerifyPoll.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/EraBased/Governance/VerifyPoll.hs @@ -4,12 +4,10 @@ module Test.Golden.EraBased.Governance.VerifyPoll where import Cardano.Api -import Cardano.Api.Pretty import Cardano.CLI.Types.Key (VerificationKeyOrFile (..), readVerificationKeyOrTextEnvFile) -import Control.Monad.IO.Class (liftIO) import qualified Data.ByteString.Char8 as BSC import Test.Cardano.CLI.Util diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/hash/foo.script.hash b/cardano-cli/test/cardano-cli-golden/files/golden/governance/hash/foo.script.hash index 63b4adee4a..18a1b58d25 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/hash/foo.script.hash +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/hash/foo.script.hash @@ -1 +1 @@ -2a7a40032759083907e43e145b770b467cfc0ddbc3c1266bc2c01b40 \ No newline at end of file +7dde1be4d1a2f617ac343dd7ef0388cf497c19ba8dab653a5b9eb1e2 diff --git a/cardano-cli/test/cardano-cli-test-lib/Test/Cardano/CLI/Util.hs b/cardano-cli/test/cardano-cli-test-lib/Test/Cardano/CLI/Util.hs index 3a472e4c9d..3c68330b81 100644 --- a/cardano-cli/test/cardano-cli-test-lib/Test/Cardano/CLI/Util.hs +++ b/cardano-cli/test/cardano-cli-test-lib/Test/Cardano/CLI/Util.hs @@ -15,14 +15,10 @@ module Test.Cardano.CLI.Util ) where import Cardano.Api -import Cardano.Api.Pretty import Cardano.CLI.Read import Control.Monad.Catch -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Class (lift) -import Control.Monad.Trans.Except (runExceptT) import qualified Data.Aeson as Aeson import qualified Data.Aeson.Encode.Pretty as Aeson import qualified Data.Aeson.Key as Aeson diff --git a/cardano-cli/test/cardano-cli-test/Test/Cli/FilePermissions.hs b/cardano-cli/test/cardano-cli-test/Test/Cli/FilePermissions.hs index adf961c3aa..8dc5620628 100644 --- a/cardano-cli/test/cardano-cli-test/Test/Cli/FilePermissions.hs +++ b/cardano-cli/test/cardano-cli-test/Test/Cli/FilePermissions.hs @@ -8,8 +8,6 @@ import Cardano.Api import Cardano.Api.IO (checkVrfFilePermissions) import Control.Monad (void) -import Control.Monad.IO.Class (MonadIO (..)) -import Control.Monad.Trans.Except (runExceptT) import Test.Cardano.CLI.Util (execCardanoCLI)