{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}

module Cardano.CLI.Types.Governance where

import           Cardano.Api
import           Cardano.Api.Shelley

import           Cardano.CLI.Types.Key (DRepHashSource, VerificationKeyOrHashOrFile,
                   VerificationKeyOrHashOrFileOrScriptHash)

data ConwayVote

type VoteFile = File ConwayVote

-- Vote type -- TODO: Conway era - remove me
data VType
  = VCC -- committee
  | VDR -- drep
  | VSP -- spo
  deriving Int -> VType -> ShowS
[VType] -> ShowS
VType -> String
(Int -> VType -> ShowS)
-> (VType -> String) -> ([VType] -> ShowS) -> Show VType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VType -> ShowS
showsPrec :: Int -> VType -> ShowS
$cshow :: VType -> String
show :: VType -> String
$cshowList :: [VType] -> ShowS
showList :: [VType] -> ShowS
Show

-- | Possible credentials for creating a vote
data AnyVotingStakeVerificationKeyOrHashOrFile
  = AnyDRepVerificationKeyOrHashOrFileOrScriptHash (VerificationKeyOrHashOrFileOrScriptHash DRepKey)
  | AnyStakePoolVerificationKeyOrHashOrFile (VerificationKeyOrHashOrFile StakePoolKey)
  | AnyCommitteeHotVerificationKeyOrHashOrFileOrScriptHash
      (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)

data VoteDelegationTarget
  = VoteDelegationTargetOfDRep DRepHashSource
  | VoteDelegationTargetOfAbstain
  | VoteDelegationTargetOfNoConfidence
  deriving (VoteDelegationTarget -> VoteDelegationTarget -> Bool
(VoteDelegationTarget -> VoteDelegationTarget -> Bool)
-> (VoteDelegationTarget -> VoteDelegationTarget -> Bool)
-> Eq VoteDelegationTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VoteDelegationTarget -> VoteDelegationTarget -> Bool
== :: VoteDelegationTarget -> VoteDelegationTarget -> Bool
$c/= :: VoteDelegationTarget -> VoteDelegationTarget -> Bool
/= :: VoteDelegationTarget -> VoteDelegationTarget -> Bool
Eq, Int -> VoteDelegationTarget -> ShowS
[VoteDelegationTarget] -> ShowS
VoteDelegationTarget -> String
(Int -> VoteDelegationTarget -> ShowS)
-> (VoteDelegationTarget -> String)
-> ([VoteDelegationTarget] -> ShowS)
-> Show VoteDelegationTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VoteDelegationTarget -> ShowS
showsPrec :: Int -> VoteDelegationTarget -> ShowS
$cshow :: VoteDelegationTarget -> String
show :: VoteDelegationTarget -> String
$cshowList :: [VoteDelegationTarget] -> ShowS
showList :: [VoteDelegationTarget] -> ShowS
Show)