Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused function guardIsRecentEra. #4375

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading