Skip to content

Commit

Permalink
Move era agnostic key based commands out of the EraBased folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Oct 8, 2024
1 parent 9863389 commit 4219cb1
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion cardano-cli/src/Cardano/CLI/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE LambdaCase #-}

module Cardano.CLI.EraBased.Commands.Key
module Cardano.CLI.Commands.Key
( KeyCmds (..)
, KeyVerificationKeyCmdArgs (..)
, KeyNonExtendedKeyCmdArgs (..)
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/Options/Key.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/Run/Address.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 (..),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cardano-cli/src/Cardano/CLI/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Cardano.CLI.EraBased.Run.Key
module Cardano.CLI.Run.Key
( runKeyCmds
, runConvertByronGenesisVKeyCmd
, runConvertByronKeyCmd
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/test/cardano-cli-test/Test/Cli/ITN.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4219cb1

Please sign in to comment.