module Ouroboros.Consensus.Ledger.Query.Version (
QueryVersion (..)
, nodeToClientVersionToQueryVersion
) where
import Ouroboros.Network.NodeToClient.Version
data QueryVersion
= QueryVersion1
| QueryVersion2
deriving (QueryVersion -> QueryVersion -> Bool
(QueryVersion -> QueryVersion -> Bool)
-> (QueryVersion -> QueryVersion -> Bool) -> Eq QueryVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryVersion -> QueryVersion -> Bool
== :: QueryVersion -> QueryVersion -> Bool
$c/= :: QueryVersion -> QueryVersion -> Bool
/= :: QueryVersion -> QueryVersion -> Bool
Eq, Eq QueryVersion
Eq QueryVersion =>
(QueryVersion -> QueryVersion -> Ordering)
-> (QueryVersion -> QueryVersion -> Bool)
-> (QueryVersion -> QueryVersion -> Bool)
-> (QueryVersion -> QueryVersion -> Bool)
-> (QueryVersion -> QueryVersion -> Bool)
-> (QueryVersion -> QueryVersion -> QueryVersion)
-> (QueryVersion -> QueryVersion -> QueryVersion)
-> Ord QueryVersion
QueryVersion -> QueryVersion -> Bool
QueryVersion -> QueryVersion -> Ordering
QueryVersion -> QueryVersion -> QueryVersion
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: QueryVersion -> QueryVersion -> Ordering
compare :: QueryVersion -> QueryVersion -> Ordering
$c< :: QueryVersion -> QueryVersion -> Bool
< :: QueryVersion -> QueryVersion -> Bool
$c<= :: QueryVersion -> QueryVersion -> Bool
<= :: QueryVersion -> QueryVersion -> Bool
$c> :: QueryVersion -> QueryVersion -> Bool
> :: QueryVersion -> QueryVersion -> Bool
$c>= :: QueryVersion -> QueryVersion -> Bool
>= :: QueryVersion -> QueryVersion -> Bool
$cmax :: QueryVersion -> QueryVersion -> QueryVersion
max :: QueryVersion -> QueryVersion -> QueryVersion
$cmin :: QueryVersion -> QueryVersion -> QueryVersion
min :: QueryVersion -> QueryVersion -> QueryVersion
Ord, Int -> QueryVersion
QueryVersion -> Int
QueryVersion -> [QueryVersion]
QueryVersion -> QueryVersion
QueryVersion -> QueryVersion -> [QueryVersion]
QueryVersion -> QueryVersion -> QueryVersion -> [QueryVersion]
(QueryVersion -> QueryVersion)
-> (QueryVersion -> QueryVersion)
-> (Int -> QueryVersion)
-> (QueryVersion -> Int)
-> (QueryVersion -> [QueryVersion])
-> (QueryVersion -> QueryVersion -> [QueryVersion])
-> (QueryVersion -> QueryVersion -> [QueryVersion])
-> (QueryVersion -> QueryVersion -> QueryVersion -> [QueryVersion])
-> Enum QueryVersion
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: QueryVersion -> QueryVersion
succ :: QueryVersion -> QueryVersion
$cpred :: QueryVersion -> QueryVersion
pred :: QueryVersion -> QueryVersion
$ctoEnum :: Int -> QueryVersion
toEnum :: Int -> QueryVersion
$cfromEnum :: QueryVersion -> Int
fromEnum :: QueryVersion -> Int
$cenumFrom :: QueryVersion -> [QueryVersion]
enumFrom :: QueryVersion -> [QueryVersion]
$cenumFromThen :: QueryVersion -> QueryVersion -> [QueryVersion]
enumFromThen :: QueryVersion -> QueryVersion -> [QueryVersion]
$cenumFromTo :: QueryVersion -> QueryVersion -> [QueryVersion]
enumFromTo :: QueryVersion -> QueryVersion -> [QueryVersion]
$cenumFromThenTo :: QueryVersion -> QueryVersion -> QueryVersion -> [QueryVersion]
enumFromThenTo :: QueryVersion -> QueryVersion -> QueryVersion -> [QueryVersion]
Enum, QueryVersion
QueryVersion -> QueryVersion -> Bounded QueryVersion
forall a. a -> a -> Bounded a
$cminBound :: QueryVersion
minBound :: QueryVersion
$cmaxBound :: QueryVersion
maxBound :: QueryVersion
Bounded, Int -> QueryVersion -> ShowS
[QueryVersion] -> ShowS
QueryVersion -> String
(Int -> QueryVersion -> ShowS)
-> (QueryVersion -> String)
-> ([QueryVersion] -> ShowS)
-> Show QueryVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryVersion -> ShowS
showsPrec :: Int -> QueryVersion -> ShowS
$cshow :: QueryVersion -> String
show :: QueryVersion -> String
$cshowList :: [QueryVersion] -> ShowS
showList :: [QueryVersion] -> ShowS
Show)
nodeToClientVersionToQueryVersion :: NodeToClientVersion -> QueryVersion
nodeToClientVersionToQueryVersion :: NodeToClientVersion -> QueryVersion
nodeToClientVersionToQueryVersion NodeToClientVersion
x = case NodeToClientVersion
x of
NodeToClientVersion
NodeToClientV_9 -> QueryVersion
QueryVersion1
NodeToClientVersion
NodeToClientV_10 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_11 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_12 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_13 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_14 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_15 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_16 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_17 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_18 -> QueryVersion
QueryVersion2
NodeToClientVersion
NodeToClientV_19 -> QueryVersion
QueryVersion2