module Cardano.Tools.DBSynthesizer.Types (module Cardano.Tools.DBSynthesizer.Types) where

import           Cardano.Ledger.Crypto (StandardCrypto)
import           Cardano.Node.Types (ProtocolFilepaths)
import           Data.Aeson as Aeson (Value)
import           Data.Word (Word64)
import           Ouroboros.Consensus.Block.Abstract (SlotNo)
import           Ouroboros.Consensus.Shelley.Node (ShelleyGenesis)


data NodeConfigStub = NodeConfigStub {
    NodeConfigStub -> Value
ncsNodeConfig         :: !Aeson.Value
  , NodeConfigStub -> FilePath
ncsAlonzoGenesisFile  :: !FilePath
  , NodeConfigStub -> FilePath
ncsShelleyGenesisFile :: !FilePath
  , NodeConfigStub -> FilePath
ncsByronGenesisFile   :: !FilePath
  , NodeConfigStub -> FilePath
ncsConwayGenesisFile  :: !FilePath
  }
  deriving Int -> NodeConfigStub -> ShowS
[NodeConfigStub] -> ShowS
NodeConfigStub -> FilePath
(Int -> NodeConfigStub -> ShowS)
-> (NodeConfigStub -> FilePath)
-> ([NodeConfigStub] -> ShowS)
-> Show NodeConfigStub
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeConfigStub -> ShowS
showsPrec :: Int -> NodeConfigStub -> ShowS
$cshow :: NodeConfigStub -> FilePath
show :: NodeConfigStub -> FilePath
$cshowList :: [NodeConfigStub] -> ShowS
showList :: [NodeConfigStub] -> ShowS
Show

data NodeFilePaths = NodeFilePaths {
    NodeFilePaths -> FilePath
nfpConfig  :: !FilePath
  , NodeFilePaths -> FilePath
nfpChainDB :: !FilePath
  }
  deriving Int -> NodeFilePaths -> ShowS
[NodeFilePaths] -> ShowS
NodeFilePaths -> FilePath
(Int -> NodeFilePaths -> ShowS)
-> (NodeFilePaths -> FilePath)
-> ([NodeFilePaths] -> ShowS)
-> Show NodeFilePaths
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeFilePaths -> ShowS
showsPrec :: Int -> NodeFilePaths -> ShowS
$cshow :: NodeFilePaths -> FilePath
show :: NodeFilePaths -> FilePath
$cshowList :: [NodeFilePaths] -> ShowS
showList :: [NodeFilePaths] -> ShowS
Show

data NodeCredentials = NodeCredentials {
    NodeCredentials -> Maybe FilePath
credCertFile :: !(Maybe FilePath)
  , NodeCredentials -> Maybe FilePath
credVRFFile  :: !(Maybe FilePath)
  , NodeCredentials -> Maybe FilePath
credKESFile  :: !(Maybe FilePath)
  , NodeCredentials -> Maybe FilePath
credBulkFile :: !(Maybe FilePath)
  }
  deriving Int -> NodeCredentials -> ShowS
[NodeCredentials] -> ShowS
NodeCredentials -> FilePath
(Int -> NodeCredentials -> ShowS)
-> (NodeCredentials -> FilePath)
-> ([NodeCredentials] -> ShowS)
-> Show NodeCredentials
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeCredentials -> ShowS
showsPrec :: Int -> NodeCredentials -> ShowS
$cshow :: NodeCredentials -> FilePath
show :: NodeCredentials -> FilePath
$cshowList :: [NodeCredentials] -> ShowS
showList :: [NodeCredentials] -> ShowS
Show

data ForgeLimit =
    ForgeLimitBlock   !Word64
  | ForgeLimitSlot    !SlotNo
  | ForgeLimitEpoch   !Word64
  deriving (ForgeLimit -> ForgeLimit -> Bool
(ForgeLimit -> ForgeLimit -> Bool)
-> (ForgeLimit -> ForgeLimit -> Bool) -> Eq ForgeLimit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ForgeLimit -> ForgeLimit -> Bool
== :: ForgeLimit -> ForgeLimit -> Bool
$c/= :: ForgeLimit -> ForgeLimit -> Bool
/= :: ForgeLimit -> ForgeLimit -> Bool
Eq, Int -> ForgeLimit -> ShowS
[ForgeLimit] -> ShowS
ForgeLimit -> FilePath
(Int -> ForgeLimit -> ShowS)
-> (ForgeLimit -> FilePath)
-> ([ForgeLimit] -> ShowS)
-> Show ForgeLimit
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ForgeLimit -> ShowS
showsPrec :: Int -> ForgeLimit -> ShowS
$cshow :: ForgeLimit -> FilePath
show :: ForgeLimit -> FilePath
$cshowList :: [ForgeLimit] -> ShowS
showList :: [ForgeLimit] -> ShowS
Show)

newtype ForgeResult = ForgeResult {ForgeResult -> Int
resultForged :: Int}
  deriving (ForgeResult -> ForgeResult -> Bool
(ForgeResult -> ForgeResult -> Bool)
-> (ForgeResult -> ForgeResult -> Bool) -> Eq ForgeResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ForgeResult -> ForgeResult -> Bool
== :: ForgeResult -> ForgeResult -> Bool
$c/= :: ForgeResult -> ForgeResult -> Bool
/= :: ForgeResult -> ForgeResult -> Bool
Eq, Int -> ForgeResult -> ShowS
[ForgeResult] -> ShowS
ForgeResult -> FilePath
(Int -> ForgeResult -> ShowS)
-> (ForgeResult -> FilePath)
-> ([ForgeResult] -> ShowS)
-> Show ForgeResult
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ForgeResult -> ShowS
showsPrec :: Int -> ForgeResult -> ShowS
$cshow :: ForgeResult -> FilePath
show :: ForgeResult -> FilePath
$cshowList :: [ForgeResult] -> ShowS
showList :: [ForgeResult] -> ShowS
Show)

data DBSynthesizerOpenMode =
      OpenCreate
    | OpenCreateForce
    | OpenAppend
    deriving (DBSynthesizerOpenMode -> DBSynthesizerOpenMode -> Bool
(DBSynthesizerOpenMode -> DBSynthesizerOpenMode -> Bool)
-> (DBSynthesizerOpenMode -> DBSynthesizerOpenMode -> Bool)
-> Eq DBSynthesizerOpenMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DBSynthesizerOpenMode -> DBSynthesizerOpenMode -> Bool
== :: DBSynthesizerOpenMode -> DBSynthesizerOpenMode -> Bool
$c/= :: DBSynthesizerOpenMode -> DBSynthesizerOpenMode -> Bool
/= :: DBSynthesizerOpenMode -> DBSynthesizerOpenMode -> Bool
Eq, Int -> DBSynthesizerOpenMode -> ShowS
[DBSynthesizerOpenMode] -> ShowS
DBSynthesizerOpenMode -> FilePath
(Int -> DBSynthesizerOpenMode -> ShowS)
-> (DBSynthesizerOpenMode -> FilePath)
-> ([DBSynthesizerOpenMode] -> ShowS)
-> Show DBSynthesizerOpenMode
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DBSynthesizerOpenMode -> ShowS
showsPrec :: Int -> DBSynthesizerOpenMode -> ShowS
$cshow :: DBSynthesizerOpenMode -> FilePath
show :: DBSynthesizerOpenMode -> FilePath
$cshowList :: [DBSynthesizerOpenMode] -> ShowS
showList :: [DBSynthesizerOpenMode] -> ShowS
Show)

data DBSynthesizerOptions = DBSynthesizerOptions {
    DBSynthesizerOptions -> ForgeLimit
synthLimit    :: !ForgeLimit
  , DBSynthesizerOptions -> DBSynthesizerOpenMode
synthOpenMode :: !DBSynthesizerOpenMode
  }
  deriving Int -> DBSynthesizerOptions -> ShowS
[DBSynthesizerOptions] -> ShowS
DBSynthesizerOptions -> FilePath
(Int -> DBSynthesizerOptions -> ShowS)
-> (DBSynthesizerOptions -> FilePath)
-> ([DBSynthesizerOptions] -> ShowS)
-> Show DBSynthesizerOptions
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DBSynthesizerOptions -> ShowS
showsPrec :: Int -> DBSynthesizerOptions -> ShowS
$cshow :: DBSynthesizerOptions -> FilePath
show :: DBSynthesizerOptions -> FilePath
$cshowList :: [DBSynthesizerOptions] -> ShowS
showList :: [DBSynthesizerOptions] -> ShowS
Show

data DBSynthesizerConfig = DBSynthesizerConfig {
    DBSynthesizerConfig -> NodeConfigStub
confConfigStub          :: NodeConfigStub
  , DBSynthesizerConfig -> DBSynthesizerOptions
confOptions             :: DBSynthesizerOptions
  , DBSynthesizerConfig -> ProtocolFilepaths
confProtocolCredentials :: ProtocolFilepaths
  , DBSynthesizerConfig -> ShelleyGenesis StandardCrypto
confShelleyGenesis      :: ShelleyGenesis StandardCrypto
  , DBSynthesizerConfig -> FilePath
confDbDir               :: FilePath
  }
  deriving Int -> DBSynthesizerConfig -> ShowS
[DBSynthesizerConfig] -> ShowS
DBSynthesizerConfig -> FilePath
(Int -> DBSynthesizerConfig -> ShowS)
-> (DBSynthesizerConfig -> FilePath)
-> ([DBSynthesizerConfig] -> ShowS)
-> Show DBSynthesizerConfig
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DBSynthesizerConfig -> ShowS
showsPrec :: Int -> DBSynthesizerConfig -> ShowS
$cshow :: DBSynthesizerConfig -> FilePath
show :: DBSynthesizerConfig -> FilePath
$cshowList :: [DBSynthesizerConfig] -> ShowS
showList :: [DBSynthesizerConfig] -> ShowS
Show