diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs index f5f20d2d70..6f83f18f35 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs @@ -8,7 +8,6 @@ module Cardano.CLI.EraBased.Commands.Query , QueryCommitteeMembersStateCmdArgs (..) , QueryLeadershipScheduleCmdArgs (..) , QueryProtocolParametersCmdArgs (..) - , QueryConstitutionHashCmdArgs (..) , QueryTipCmdArgs (..) , QueryStakePoolsCmdArgs (..) , QueryStakeDistributionCmdArgs (..) @@ -46,7 +45,6 @@ import GHC.Generics data QueryCmds era = QueryLeadershipScheduleCmd !QueryLeadershipScheduleCmdArgs | QueryProtocolParametersCmd !QueryProtocolParametersCmdArgs - | QueryConstitutionHashCmd !QueryConstitutionHashCmdArgs | QueryTipCmd !QueryTipCmdArgs | QueryStakePoolsCmd !QueryStakePoolsCmdArgs | QueryStakeDistributionCmd !QueryStakeDistributionCmdArgs @@ -91,15 +89,6 @@ data QueryProtocolParametersCmdArgs = QueryProtocolParametersCmdArgs } deriving (Generic, Show) -data QueryConstitutionHashCmdArgs = QueryConstitutionHashCmdArgs - { nodeSocketPath :: !SocketPath - , consensusModeParams :: !ConsensusModeParams - , networkId :: !NetworkId - , target :: !(Consensus.Target ChainPoint) - , mOutFile :: !(Maybe (File () Out)) - } - deriving (Generic, Show) - data QueryTipCmdArgs = QueryTipCmdArgs { nodeSocketPath :: !SocketPath , consensusModeParams :: !ConsensusModeParams @@ -301,8 +290,6 @@ renderQueryCmds = \case "query leadership-schedule" QueryProtocolParametersCmd{} -> "query protocol-parameters " - QueryConstitutionHashCmd{} -> - "query constitution-hash " QueryTipCmd{} -> "query tip" QueryStakePoolsCmd{} -> diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs index b928d4e548..3b60bf9088 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs @@ -15,7 +15,6 @@ module Cardano.CLI.EraBased.Run.Query ( runQueryCmds - , runQueryConstitutionHashCmd , runQueryKesPeriodInfoCmd , runQueryLeadershipScheduleCmd , runQueryLedgerStateCmd @@ -105,7 +104,6 @@ runQueryCmds :: Cmd.QueryCmds era -> ExceptT QueryCmdError IO () runQueryCmds = \case Cmd.QueryLeadershipScheduleCmd args -> runQueryLeadershipScheduleCmd args Cmd.QueryProtocolParametersCmd args -> runQueryProtocolParametersCmd args - Cmd.QueryConstitutionHashCmd args -> runQueryConstitutionHashCmd args Cmd.QueryTipCmd args -> runQueryTipCmd args Cmd.QueryStakePoolsCmd args -> runQueryStakePoolsCmd args Cmd.QueryStakeDistributionCmd args -> runQueryStakeDistributionCmd args @@ -127,42 +125,6 @@ runQueryCmds = \case Cmd.QueryCommitteeMembersStateCmd args -> runQueryCommitteeMembersState args Cmd.QueryTreasuryValueCmd args -> runQueryTreasuryValue args -runQueryConstitutionHashCmd - :: () - => Cmd.QueryConstitutionHashCmdArgs - -> ExceptT QueryCmdError IO () -runQueryConstitutionHashCmd - Cmd.QueryConstitutionHashCmdArgs - { Cmd.nodeSocketPath - , Cmd.consensusModeParams - , Cmd.networkId - , Cmd.target - , Cmd.mOutFile - } = do - let localNodeConnInfo = LocalNodeConnectInfo consensusModeParams networkId nodeSocketPath - - result <- liftIO $ executeLocalStateQueryExpr localNodeConnInfo target $ runExceptT $ do - AnyCardanoEra era <- lift queryCurrentEra & onLeft (left . QueryCmdUnsupportedNtcVersion) - - sbe <- - requireShelleyBasedEra era - & onNothing (left QueryCmdByronEra) - - lift (shelleyBasedEraConstraints sbe (queryConstitutionHash sbe)) - & onLeft (left . QueryCmdUnsupportedNtcVersion) - & onLeft (left . QueryCmdEraMismatch) - - writeConstitutionHash mOutFile =<< except (join (first QueryCmdAcquireFailure result)) - where - writeConstitutionHash - :: Maybe (File () Out) - -> L.SafeHash L.StandardCrypto L.AnchorData - -> ExceptT QueryCmdError IO () - writeConstitutionHash mOutFile' cHash = - firstExceptT QueryCmdWriteFileError . newExceptT $ - writeLazyByteStringOutput mOutFile' $ - encodePretty cHash - runQueryProtocolParametersCmd :: () => Cmd.QueryProtocolParametersCmdArgs diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Commands/Query.hs b/cardano-cli/src/Cardano/CLI/Legacy/Commands/Query.hs index 437f8155d7..94895e55e8 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Commands/Query.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Commands/Query.hs @@ -7,7 +7,6 @@ module Cardano.CLI.Legacy.Commands.Query ( LegacyQueryCmds (..) , LegacyQueryLeadershipScheduleCmdArgs (..) , LegacyQueryProtocolParametersCmdArgs (..) - , LegacyQueryConstitutionHashCmdArgs (..) , LegacyQueryTipCmdArgs (..) , LegacyQueryStakePoolsCmdArgs (..) , LegacyQueryStakeDistributionCmdArgs (..) @@ -71,14 +70,6 @@ data LegacyQueryProtocolParametersCmdArgs = LegacyQueryProtocolParametersCmdArgs } deriving (Generic, Show) -data LegacyQueryConstitutionHashCmdArgs = LegacyQueryConstitutionHashCmdArgs - { nodeSocketPath :: !SocketPath - , consensusModeParams :: !ConsensusModeParams - , networkId :: !NetworkId - , mOutFile :: !(Maybe (File () Out)) - } - deriving (Generic, Show) - data LegacyQueryTipCmdArgs = LegacyQueryTipCmdArgs { nodeSocketPath :: !SocketPath , consensusModeParams :: !ConsensusModeParams