Skip to content

Commit

Permalink
Remove unused function guardIsRecentEra. (#4375)
Browse files Browse the repository at this point in the history
This PR simply removes an unused function `guardIsRecentEra`.
  • Loading branch information
jonathanknowles authored Dec 22, 2023
2 parents 1426823 + df4ec20 commit 005856a
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions lib/wallet/bench/restore-bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ import Cardano.Wallet.Primitive.Ledger.Read.Block
( fromCardanoBlock
)
import Cardano.Wallet.Primitive.Ledger.Shelley
( AnyCardanoEra (..)
, CardanoBlock
( CardanoBlock
, NodeToClientVersionData
, StandardCrypto
, emptyGenesis
Expand Down Expand Up @@ -240,9 +239,6 @@ import Cardano.Wallet.Unsafe
import Control.Arrow
( first
)
import Control.Exception
( throwIO
)
import Control.Monad
( unless
, void
Expand Down Expand Up @@ -325,9 +321,6 @@ import GHC.TypeLits
, Nat
, natVal
)
import Internal.Cardano.Write.Tx
( AnyRecentEra (..)
)
import Numeric
( fromRat
, showFFloat
Expand Down Expand Up @@ -369,7 +362,6 @@ import qualified Cardano.Wallet as W
import qualified Cardano.Wallet.Address.Derivation.Byron as Byron
import qualified Cardano.Wallet.Address.Derivation.Shelley as Shelley
import qualified Cardano.Wallet.DB.Sqlite.Migration.Old as Sqlite
import qualified Cardano.Wallet.Primitive.Ledger.Shelley as Cardano
import qualified Cardano.Wallet.Primitive.Types as W
import qualified Cardano.Wallet.Primitive.Types.Checkpoints.Policy as CP
import qualified Cardano.Wallet.Primitive.Types.TokenBundle as TokenBundle
Expand Down Expand Up @@ -1134,19 +1126,6 @@ showPercentFromPermyriad =
sTol :: SyncTolerance
sTol = mkSyncTolerance 3600

guardIsRecentEra :: AnyCardanoEra -> IO AnyRecentEra
guardIsRecentEra (Cardano.AnyCardanoEra era) = case era of
Cardano.ConwayEra -> pure $ Write.AnyRecentEra Write.RecentEraConway
Cardano.BabbageEra -> pure $ Write.AnyRecentEra Write.RecentEraBabbage
Cardano.AlonzoEra -> invalidEra
Cardano.MaryEra -> invalidEra
Cardano.AllegraEra -> invalidEra
Cardano.ShelleyEra -> invalidEra
Cardano.ByronEra -> invalidEra
where
invalidEra = throwIO $ W.ExceptionWriteTxEra $ W.ErrNodeNotYetInRecentEra $
Cardano.AnyCardanoEra era

withNonEmptyUTxO :: Wallet s -> Set Tx -> e -> IO a -> IO (Either e a)
withNonEmptyUTxO wallet pendingTxs failure action
| emptyUTxO = pure (Left failure)
Expand Down

0 comments on commit 005856a

Please sign in to comment.