Skip to content

Commit

Permalink
Merge pull request #887 from IntersectMBO/mgalazyn/feature/remove-in-…
Browse files Browse the repository at this point in the history
…command-deprecation-notice

Remove deprecation message when invoking a command in deprecated era
  • Loading branch information
carbolymer committed Sep 6, 2024
2 parents e90cf44 + 8ec3ccc commit 537a838
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 12 deletions.
11 changes: 5 additions & 6 deletions cardano-cli/src/Cardano/CLI/EraBased/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 537a838

Please sign in to comment.