diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 1e6bd31539..4ec0e758f4 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -62,6 +62,7 @@ library Cardano.CLI.Commands.Debug.LogEpochState Cardano.CLI.Commands.Debug.TransactionView Cardano.CLI.Commands.Hash + Cardano.CLI.Commands.Key Cardano.CLI.Commands.Node Cardano.CLI.Commands.Ping Cardano.CLI.Environment @@ -74,7 +75,6 @@ library Cardano.CLI.EraBased.Commands.Governance.DRep Cardano.CLI.EraBased.Commands.Governance.Poll Cardano.CLI.EraBased.Commands.Governance.Vote - Cardano.CLI.EraBased.Commands.Key Cardano.CLI.EraBased.Commands.Query Cardano.CLI.EraBased.Commands.StakeAddress Cardano.CLI.EraBased.Commands.StakePool @@ -108,7 +108,6 @@ library Cardano.CLI.EraBased.Run.Governance.GenesisKeyDelegationCertificate Cardano.CLI.EraBased.Run.Governance.Poll Cardano.CLI.EraBased.Run.Governance.Vote - Cardano.CLI.EraBased.Run.Key Cardano.CLI.EraBased.Run.Query Cardano.CLI.EraBased.Run.StakeAddress Cardano.CLI.EraBased.Run.StakePool @@ -141,6 +140,7 @@ library Cardano.CLI.Run.Debug.LogEpochState Cardano.CLI.Run.Debug.TransactionView Cardano.CLI.Run.Hash + Cardano.CLI.Run.Key Cardano.CLI.Run.Node Cardano.CLI.Run.Ping Cardano.CLI.TopHandler diff --git a/cardano-cli/src/Cardano/CLI/Commands.hs b/cardano-cli/src/Cardano/CLI/Commands.hs index 20c4f4b9cd..eda4ed836c 100644 --- a/cardano-cli/src/Cardano/CLI/Commands.hs +++ b/cardano-cli/src/Cardano/CLI/Commands.hs @@ -8,6 +8,7 @@ where import Cardano.CLI.Byron.Commands (ByronCommand) import Cardano.CLI.Commands.Debug import Cardano.CLI.Commands.Hash (HashCmds) +import Cardano.CLI.Commands.Key import Cardano.CLI.Commands.Node import Cardano.CLI.Commands.Ping (PingCmd (..)) import Cardano.CLI.EraBased.Commands @@ -20,8 +21,10 @@ data ClientCommand = AnyEraCommand AnyEraCommand | -- | Byron Related Commands ByronCommand ByronCommand - | -- | Era-agnostic hashing commands + | -- | Era agnostic hashing commands HashCmds HashCmds + | -- | Era agnostic key commands + KeyCommands KeyCmds | -- | Era agnostic node commands NodeCommands NodeCmds | -- | Legacy shelley-based Commands diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Key.hs b/cardano-cli/src/Cardano/CLI/Commands/Key.hs similarity index 99% rename from cardano-cli/src/Cardano/CLI/EraBased/Commands/Key.hs rename to cardano-cli/src/Cardano/CLI/Commands/Key.hs index 76c41973dd..413cc24ab5 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Key.hs +++ b/cardano-cli/src/Cardano/CLI/Commands/Key.hs @@ -2,7 +2,7 @@ {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE LambdaCase #-} -module Cardano.CLI.EraBased.Commands.Key +module Cardano.CLI.Commands.Key ( KeyCmds (..) , KeyVerificationKeyCmdArgs (..) , KeyNonExtendedKeyCmdArgs (..) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands.hs index 7b7e4fbe5b..b95658a082 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands.hs @@ -13,11 +13,11 @@ where import Cardano.Api (ShelleyBasedEra (..), toCardanoEra) +import Cardano.CLI.Commands.Key import Cardano.CLI.Commands.Node import Cardano.CLI.Environment import Cardano.CLI.EraBased.Commands.Address import Cardano.CLI.EraBased.Commands.Genesis -import Cardano.CLI.EraBased.Commands.Key import Cardano.CLI.EraBased.Commands.Query import Cardano.CLI.EraBased.Commands.StakeAddress import Cardano.CLI.EraBased.Commands.StakePool hiding (sbe) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Key.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Key.hs index b499548c84..aab5e80b36 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Key.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Key.hs @@ -10,7 +10,7 @@ where import Cardano.Api hiding (QueryInShelleyBasedEra (..), parseFilePath) -import Cardano.CLI.EraBased.Commands.Key +import Cardano.CLI.Commands.Key import Cardano.CLI.EraBased.Options.Common import Cardano.CLI.Types.Common diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run.hs index bbe26a8614..ad7e9f4970 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run.hs @@ -14,13 +14,13 @@ import Cardano.CLI.EraBased.Commands import Cardano.CLI.EraBased.Run.Address import Cardano.CLI.EraBased.Run.Genesis import Cardano.CLI.EraBased.Run.Governance -import Cardano.CLI.EraBased.Run.Key import Cardano.CLI.EraBased.Run.Query import Cardano.CLI.EraBased.Run.StakeAddress import Cardano.CLI.EraBased.Run.StakePool import Cardano.CLI.EraBased.Run.TextView import Cardano.CLI.EraBased.Run.Transaction import Cardano.CLI.Helpers (printEraDeprecationWarning) +import Cardano.CLI.Run.Key import Cardano.CLI.Run.Node import Cardano.CLI.Types.Errors.CmdError diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs index 6850d92e21..97e32bae74 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs @@ -20,8 +20,8 @@ import Cardano.Api.Shelley import Cardano.CLI.EraBased.Commands.Address import Cardano.CLI.EraBased.Run.Address.Info -import qualified Cardano.CLI.EraBased.Run.Key as Key import Cardano.CLI.Read +import qualified Cardano.CLI.Run.Key as Key import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.AddressCmdError import Cardano.CLI.Types.Key (PaymentVerifier (..), StakeIdentifier (..), diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs index f3340a0113..46c6cffd36 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs @@ -39,9 +39,9 @@ import qualified Cardano.CLI.EraBased.Commands.Governance.DRep as DRep import Cardano.CLI.EraBased.Run.Address (generateAndWriteKeyFiles) import Cardano.CLI.EraBased.Run.Genesis.Common import qualified Cardano.CLI.EraBased.Run.Governance.DRep as DRep -import qualified Cardano.CLI.EraBased.Run.Key as Key import Cardano.CLI.EraBased.Run.StakeAddress (runStakeAddressKeyGenCmd) import qualified Cardano.CLI.IO.Lazy as Lazy +import qualified Cardano.CLI.Run.Key as Key import Cardano.CLI.Run.Node (runNodeIssueOpCertCmd, runNodeKeyGenColdCmd, runNodeKeyGenKesCmd, runNodeKeyGenVrfCmd) import Cardano.CLI.Types.Common 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 3f862d9602..f3f2e018df 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Committee.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Committee.hs @@ -14,8 +14,8 @@ import Cardano.Api.Shelley import Cardano.CLI.EraBased.Commands.Governance.Committee import qualified Cardano.CLI.EraBased.Commands.Governance.Committee as Cmd -import qualified Cardano.CLI.EraBased.Run.Key as Key import Cardano.CLI.Read (readVerificationKeySource) +import qualified Cardano.CLI.Run.Key as Key import Cardano.CLI.Types.Errors.GovernanceCommitteeError import Cardano.CLI.Types.Key.VerificationKey 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 84499fc860..0a055a4b30 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs @@ -20,8 +20,8 @@ import qualified Cardano.Api.Ledger as L import Cardano.CLI.EraBased.Commands.Governance.DRep (DRepHashGoal (..)) import qualified Cardano.CLI.EraBased.Commands.Governance.DRep as Cmd -import qualified Cardano.CLI.EraBased.Run.Key as Key import Cardano.CLI.Run.Hash (allSchemas, getByteStringFromURL, httpsAndIpfsSchemas) +import qualified Cardano.CLI.Run.Key as Key import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.CmdError import Cardano.CLI.Types.Errors.GovernanceCmdError diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs index 40173e210e..6676dcf67a 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs @@ -25,8 +25,8 @@ import qualified Cardano.Api.Ledger as L import Cardano.Api.Shelley import Cardano.CLI.EraBased.Commands.StakeAddress -import qualified Cardano.CLI.EraBased.Run.Key as Key import Cardano.CLI.Read +import qualified Cardano.CLI.Run.Key as Key import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.StakeAddressCmdError import Cardano.CLI.Types.Errors.StakeAddressRegistrationError diff --git a/cardano-cli/src/Cardano/CLI/Run.hs b/cardano-cli/src/Cardano/CLI/Run.hs index 8fb988925c..f944681660 100644 --- a/cardano-cli/src/Cardano/CLI/Run.hs +++ b/cardano-cli/src/Cardano/CLI/Run.hs @@ -65,6 +65,7 @@ runClientCommand = \case firstExceptT ByronClientError $ runByronClientCommand cmds HashCmds cmds -> firstExceptT HashCmdError $ runHashCmds cmds + KeyCommands _cmds -> undefined LegacyCmds cmds -> firstExceptT (CmdError (renderLegacyCommand cmds)) $ runLegacyCmds cmds CliPingCommand cmds -> diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs b/cardano-cli/src/Cardano/CLI/Run/Key.hs similarity index 99% rename from cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs rename to cardano-cli/src/Cardano/CLI/Run/Key.hs index 32b2689217..5fe8336002 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs +++ b/cardano-cli/src/Cardano/CLI/Run/Key.hs @@ -6,7 +6,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} -module Cardano.CLI.EraBased.Run.Key +module Cardano.CLI.Run.Key ( runKeyCmds , runConvertByronGenesisVKeyCmd , runConvertByronKeyCmd @@ -38,7 +38,7 @@ import Cardano.Api.Crypto.Ed25519Bip32 (xPrvFromBytes) import qualified Cardano.Api.Ledger as L import qualified Cardano.CLI.Byron.Key as Byron -import qualified Cardano.CLI.EraBased.Commands.Key as Cmd +import qualified Cardano.CLI.Commands.Key as Cmd import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.CardanoAddressSigningKeyConversionError import Cardano.CLI.Types.Errors.ItnKeyConversionError diff --git a/cardano-cli/test/cardano-cli-test/Test/Cli/ITN.hs b/cardano-cli/test/cardano-cli-test/Test/Cli/ITN.hs index 9d953b33f3..2c4c3868a0 100644 --- a/cardano-cli/test/cardano-cli-test/Test/Cli/ITN.hs +++ b/cardano-cli/test/cardano-cli-test/Test/Cli/ITN.hs @@ -8,7 +8,7 @@ module Test.Cli.ITN ) where -import Cardano.CLI.EraBased.Run.Key (decodeBech32) +import Cardano.CLI.Run.Key (decodeBech32) import qualified Codec.Binary.Bech32 as Bech32 import Control.Monad (void)