From 8ec3ccc0cd346334227aececea29397cc4cc0af6 Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Fri, 6 Sep 2024 16:11:18 +0200 Subject: [PATCH] Remove deprecation message when invoking a command in deprecated era --- cardano-cli/src/Cardano/CLI/EraBased/Run.hs | 11 +++++------ .../files/golden/help/allegra_transaction_view.cli | 1 - .../files/golden/help/alonzo_transaction_view.cli | 1 - .../files/golden/help/babbage_transaction_view.cli | 1 - .../files/golden/help/latest_transaction_view.cli | 1 - .../files/golden/help/mary_transaction_view.cli | 1 - .../files/golden/help/shelley_transaction_view.cli | 1 - 7 files changed, 5 insertions(+), 12 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run.hs index de62b06ef..f046a7d8a 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run.hs @@ -21,10 +21,8 @@ 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 (printWarning) import Cardano.CLI.Types.Errors.CmdError -import Control.Monad import Data.Function ((&)) runAnyEraCommand @@ -33,10 +31,11 @@ runAnyEraCommand -> ExceptT CmdError IO () runAnyEraCommand = \case AnyEraCommandOf sbe cmd -> do - let selectedEraNum = fromEnum $ AnyShelleyBasedEra sbe - currentEraNum = fromEnum $ AnyShelleyBasedEra ShelleyBasedEraConway - when (selectedEraNum < currentEraNum) $ - printWarning "Selected era is deprecated and will be removed in the future." + -- FIXME: Uncomment this after CLI release + -- let selectedEraNum = fromEnum $ AnyShelleyBasedEra sbe + -- currentEraNum = fromEnum $ AnyShelleyBasedEra ShelleyBasedEraConway + -- when (selectedEraNum < currentEraNum) $ + -- printWarning "Selected era is deprecated and will be removed in the future." shelleyBasedEraConstraints sbe $ runCmds cmd runCmds diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_view.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_view.cli index 1085feec6..9f804c4d6 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_view.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_view.cli @@ -1,2 +1 @@ -WARNING: Selected era is deprecated and will be removed in the future. Command "era transaction view" has been removed. Please use "debug transaction view" instead. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_view.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_view.cli index 1085feec6..9f804c4d6 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_view.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_view.cli @@ -1,2 +1 @@ -WARNING: Selected era is deprecated and will be removed in the future. Command "era transaction view" has been removed. Please use "debug transaction view" instead. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_view.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_view.cli index 1085feec6..9f804c4d6 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_view.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_view.cli @@ -1,2 +1 @@ -WARNING: Selected era is deprecated and will be removed in the future. Command "era transaction view" has been removed. Please use "debug transaction view" instead. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_view.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_view.cli index 1085feec6..9f804c4d6 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_view.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_view.cli @@ -1,2 +1 @@ -WARNING: Selected era is deprecated and will be removed in the future. Command "era transaction view" has been removed. Please use "debug transaction view" instead. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_view.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_view.cli index 1085feec6..9f804c4d6 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_view.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_view.cli @@ -1,2 +1 @@ -WARNING: Selected era is deprecated and will be removed in the future. Command "era transaction view" has been removed. Please use "debug transaction view" instead. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_view.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_view.cli index 1085feec6..9f804c4d6 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_view.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_view.cli @@ -1,2 +1 @@ -WARNING: Selected era is deprecated and will be removed in the future. Command "era transaction view" has been removed. Please use "debug transaction view" instead.