module Cardano.Tools.DBTruncater.Types
  ( DBTruncaterConfig (..)
  , TruncateAfter (..)
  ) where

import Ouroboros.Consensus.Block.Abstract

data DBTruncaterConfig = DBTruncaterConfig
  { DBTruncaterConfig -> FilePath
dbDir :: FilePath
  , DBTruncaterConfig -> TruncateAfter
truncateAfter :: TruncateAfter
  , DBTruncaterConfig -> Bool
verbose :: Bool
  }

-- | Where to truncate the ImmutableDB.
data TruncateAfter
  = -- | Truncate after the given slot number, deleting all blocks with a higher
    -- slot number.
    TruncateAfterSlot SlotNo
  | -- | Truncate after the given block number (such that the new tip has this
    -- block number).
    TruncateAfterBlock BlockNo
  deriving (Int -> TruncateAfter -> ShowS
[TruncateAfter] -> ShowS
TruncateAfter -> FilePath
(Int -> TruncateAfter -> ShowS)
-> (TruncateAfter -> FilePath)
-> ([TruncateAfter] -> ShowS)
-> Show TruncateAfter
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TruncateAfter -> ShowS
showsPrec :: Int -> TruncateAfter -> ShowS
$cshow :: TruncateAfter -> FilePath
show :: TruncateAfter -> FilePath
$cshowList :: [TruncateAfter] -> ShowS
showList :: [TruncateAfter] -> ShowS
Show, TruncateAfter -> TruncateAfter -> Bool
(TruncateAfter -> TruncateAfter -> Bool)
-> (TruncateAfter -> TruncateAfter -> Bool) -> Eq TruncateAfter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TruncateAfter -> TruncateAfter -> Bool
== :: TruncateAfter -> TruncateAfter -> Bool
$c/= :: TruncateAfter -> TruncateAfter -> Bool
/= :: TruncateAfter -> TruncateAfter -> Bool
Eq)