{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
module Proto.Tendermint.Tendermint.Crypto.Merkle.Merkle (
Proof(), ProofOp()
) where
import qualified Data.ProtoLens.Runtime.Control.DeepSeq as Control.DeepSeq
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Prism as Data.ProtoLens.Prism
import qualified Data.ProtoLens.Runtime.Prelude as Prelude
import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int
import qualified Data.ProtoLens.Runtime.Data.Monoid as Data.Monoid
import qualified Data.ProtoLens.Runtime.Data.Word as Data.Word
import qualified Data.ProtoLens.Runtime.Data.ProtoLens as Data.ProtoLens
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Bytes as Data.ProtoLens.Encoding.Bytes
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Growing as Data.ProtoLens.Encoding.Growing
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Parser.Unsafe as Data.ProtoLens.Encoding.Parser.Unsafe
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Wire as Data.ProtoLens.Encoding.Wire
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Field as Data.ProtoLens.Field
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Message.Enum as Data.ProtoLens.Message.Enum
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Service.Types as Data.ProtoLens.Service.Types
import qualified Data.ProtoLens.Runtime.Lens.Family2 as Lens.Family2
import qualified Data.ProtoLens.Runtime.Lens.Family2.Unchecked as Lens.Family2.Unchecked
import qualified Data.ProtoLens.Runtime.Data.Text as Data.Text
import qualified Data.ProtoLens.Runtime.Data.Map as Data.Map
import qualified Data.ProtoLens.Runtime.Data.ByteString as Data.ByteString
import qualified Data.ProtoLens.Runtime.Data.ByteString.Char8 as Data.ByteString.Char8
import qualified Data.ProtoLens.Runtime.Data.Text.Encoding as Data.Text.Encoding
import qualified Data.ProtoLens.Runtime.Data.Vector as Data.Vector
import qualified Data.ProtoLens.Runtime.Data.Vector.Generic as Data.Vector.Generic
import qualified Data.ProtoLens.Runtime.Data.Vector.Unboxed as Data.Vector.Unboxed
import qualified Data.ProtoLens.Runtime.Text.Read as Text.Read
import qualified Proto.Gogo.Protobuf.Gogoproto.Gogo
data Proof
= Proof'_constructor {Proof -> Vector ProofOp
_Proof'ops :: !(Data.Vector.Vector ProofOp),
Proof -> FieldSet
_Proof'_unknownFields :: !Data.ProtoLens.FieldSet}
deriving (Proof -> Proof -> Bool
(Proof -> Proof -> Bool) -> (Proof -> Proof -> Bool) -> Eq Proof
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Proof -> Proof -> Bool
$c/= :: Proof -> Proof -> Bool
== :: Proof -> Proof -> Bool
$c== :: Proof -> Proof -> Bool
Prelude.Eq, Eq Proof
Eq Proof =>
(Proof -> Proof -> Ordering)
-> (Proof -> Proof -> Bool)
-> (Proof -> Proof -> Bool)
-> (Proof -> Proof -> Bool)
-> (Proof -> Proof -> Bool)
-> (Proof -> Proof -> Proof)
-> (Proof -> Proof -> Proof)
-> Ord Proof
Proof -> Proof -> Bool
Proof -> Proof -> Ordering
Proof -> Proof -> Proof
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
min :: Proof -> Proof -> Proof
$cmin :: Proof -> Proof -> Proof
max :: Proof -> Proof -> Proof
$cmax :: Proof -> Proof -> Proof
>= :: Proof -> Proof -> Bool
$c>= :: Proof -> Proof -> Bool
> :: Proof -> Proof -> Bool
$c> :: Proof -> Proof -> Bool
<= :: Proof -> Proof -> Bool
$c<= :: Proof -> Proof -> Bool
< :: Proof -> Proof -> Bool
$c< :: Proof -> Proof -> Bool
compare :: Proof -> Proof -> Ordering
$ccompare :: Proof -> Proof -> Ordering
$cp1Ord :: Eq Proof
Prelude.Ord)
instance Prelude.Show Proof where
showsPrec :: Int -> Proof -> ShowS
showsPrec _ __x :: Proof
__x __s :: String
__s
= Char -> ShowS
Prelude.showChar
'{'
(String -> ShowS
Prelude.showString
(Proof -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort Proof
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField Proof "ops" [ProofOp] where
fieldOf :: Proxy# "ops" -> ([ProofOp] -> f [ProofOp]) -> Proof -> f Proof
fieldOf _
= ((Vector ProofOp -> f (Vector ProofOp)) -> Proof -> f Proof)
-> (([ProofOp] -> f [ProofOp])
-> Vector ProofOp -> f (Vector ProofOp))
-> ([ProofOp] -> f [ProofOp])
-> Proof
-> f Proof
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Proof -> Vector ProofOp)
-> (Proof -> Vector ProofOp -> Proof)
-> Lens Proof Proof (Vector ProofOp) (Vector ProofOp)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Proof -> Vector ProofOp
_Proof'ops (\ x__ :: Proof
x__ y__ :: Vector ProofOp
y__ -> Proof
x__ {_Proof'ops :: Vector ProofOp
_Proof'ops = Vector ProofOp
y__}))
((Vector ProofOp -> [ProofOp])
-> (Vector ProofOp -> [ProofOp] -> Vector ProofOp)
-> Lens (Vector ProofOp) (Vector ProofOp) [ProofOp] [ProofOp]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Vector ProofOp -> [ProofOp]
forall (v :: * -> *) a. Vector v a => v a -> [a]
Data.Vector.Generic.toList
(\ _ y__ :: [ProofOp]
y__ -> [ProofOp] -> Vector ProofOp
forall (v :: * -> *) a. Vector v a => [a] -> v a
Data.Vector.Generic.fromList [ProofOp]
y__))
instance Data.ProtoLens.Field.HasField Proof "vec'ops" (Data.Vector.Vector ProofOp) where
fieldOf :: Proxy# "vec'ops"
-> (Vector ProofOp -> f (Vector ProofOp)) -> Proof -> f Proof
fieldOf _
= ((Vector ProofOp -> f (Vector ProofOp)) -> Proof -> f Proof)
-> ((Vector ProofOp -> f (Vector ProofOp))
-> Vector ProofOp -> f (Vector ProofOp))
-> (Vector ProofOp -> f (Vector ProofOp))
-> Proof
-> f Proof
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Proof -> Vector ProofOp)
-> (Proof -> Vector ProofOp -> Proof)
-> Lens Proof Proof (Vector ProofOp) (Vector ProofOp)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Proof -> Vector ProofOp
_Proof'ops (\ x__ :: Proof
x__ y__ :: Vector ProofOp
y__ -> Proof
x__ {_Proof'ops :: Vector ProofOp
_Proof'ops = Vector ProofOp
y__}))
(Vector ProofOp -> f (Vector ProofOp))
-> Vector ProofOp -> f (Vector ProofOp)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message Proof where
messageName :: Proxy Proof -> Text
messageName _ = String -> Text
Data.Text.pack "merkle.Proof"
fieldsByTag :: Map Tag (FieldDescriptor Proof)
fieldsByTag
= let
ops__field_descriptor :: FieldDescriptor Proof
ops__field_descriptor
= String
-> FieldTypeDescriptor ProofOp
-> FieldAccessor Proof ProofOp
-> FieldDescriptor Proof
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"ops"
(MessageOrGroup -> FieldTypeDescriptor ProofOp
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
Data.ProtoLens.FieldTypeDescriptor ProofOp)
(Packing -> Lens' Proof [ProofOp] -> FieldAccessor Proof ProofOp
forall msg value.
Packing -> Lens' msg [value] -> FieldAccessor msg value
Data.ProtoLens.RepeatedField
Packing
Data.ProtoLens.Unpacked (forall s a (f :: * -> *).
(HasField s "ops" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"ops")) ::
Data.ProtoLens.FieldDescriptor Proof
in
[(Tag, FieldDescriptor Proof)] -> Map Tag (FieldDescriptor Proof)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor Proof
ops__field_descriptor)]
unknownFields :: LensLike' f Proof FieldSet
unknownFields
= (Proof -> FieldSet)
-> (Proof -> FieldSet -> Proof) -> Lens' Proof FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Proof -> FieldSet
_Proof'_unknownFields
(\ x__ :: Proof
x__ y__ :: FieldSet
y__ -> Proof
x__ {_Proof'_unknownFields :: FieldSet
_Proof'_unknownFields = FieldSet
y__})
defMessage :: Proof
defMessage
= $WProof'_constructor :: Vector ProofOp -> FieldSet -> Proof
Proof'_constructor
{_Proof'ops :: Vector ProofOp
_Proof'ops = Vector ProofOp
forall (v :: * -> *) a. Vector v a => v a
Data.Vector.Generic.empty,
_Proof'_unknownFields :: FieldSet
_Proof'_unknownFields = []}
parseMessage :: Parser Proof
parseMessage
= let
loop ::
Proof
-> Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector Data.ProtoLens.Encoding.Growing.RealWorld ProofOp
-> Data.ProtoLens.Encoding.Bytes.Parser Proof
loop :: Proof -> Growing Vector RealWorld ProofOp -> Parser Proof
loop x :: Proof
x mutable'ops :: Growing Vector RealWorld ProofOp
mutable'ops
= do Bool
end <- Parser Bool
Data.ProtoLens.Encoding.Bytes.atEnd
if Bool
end then
do Vector ProofOp
frozen'ops <- IO (Vector ProofOp) -> Parser (Vector ProofOp)
forall a. IO a -> Parser a
Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO
(Growing Vector (PrimState IO) ProofOp -> IO (Vector ProofOp)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Growing v (PrimState m) a -> m (v a)
Data.ProtoLens.Encoding.Growing.unsafeFreeze Growing Vector RealWorld ProofOp
Growing Vector (PrimState IO) ProofOp
mutable'ops)
(let missing :: [a]
missing = []
in
if [Any] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
Prelude.null [Any]
forall a. [a]
missing then
() -> Parser ()
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return ()
else
String -> Parser ()
forall (m :: * -> *) a. MonadFail m => String -> m a
Prelude.fail
(String -> ShowS
forall a. [a] -> [a] -> [a]
(Prelude.++)
"Missing required fields: "
([String] -> String
forall a. Show a => a -> String
Prelude.show ([String]
forall a. [a]
missing :: [Prelude.String]))))
Proof -> Parser Proof
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
(Setter Proof Proof FieldSet FieldSet
-> (FieldSet -> FieldSet) -> Proof -> Proof
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
forall msg. Message msg => Lens' msg FieldSet
Setter Proof Proof FieldSet FieldSet
Data.ProtoLens.unknownFields
(\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t)
(Setter Proof Proof (Vector ProofOp) (Vector ProofOp)
-> Vector ProofOp -> Proof -> Proof
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set
(forall s a (f :: * -> *).
(HasField s "vec'ops" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"vec'ops") Vector ProofOp
frozen'ops Proof
x))
else
do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
case Word64
tag of
10
-> do !ProofOp
y <- Parser ProofOp -> String -> Parser ProofOp
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
(do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
Int -> Parser ProofOp -> Parser ProofOp
forall a. Int -> Parser a -> Parser a
Data.ProtoLens.Encoding.Bytes.isolate
(Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len)
Parser ProofOp
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
"ops"
Growing Vector RealWorld ProofOp
v <- IO (Growing Vector RealWorld ProofOp)
-> Parser (Growing Vector RealWorld ProofOp)
forall a. IO a -> Parser a
Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO
(Growing Vector (PrimState IO) ProofOp
-> ProofOp -> IO (Growing Vector (PrimState IO) ProofOp)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Growing v (PrimState m) a -> a -> m (Growing v (PrimState m) a)
Data.ProtoLens.Encoding.Growing.append Growing Vector RealWorld ProofOp
Growing Vector (PrimState IO) ProofOp
mutable'ops ProofOp
y)
Proof -> Growing Vector RealWorld ProofOp -> Parser Proof
loop Proof
x Growing Vector RealWorld ProofOp
v
wire :: Word64
wire
-> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
Word64
wire
Proof -> Growing Vector RealWorld ProofOp -> Parser Proof
loop
(Setter Proof Proof FieldSet FieldSet
-> (FieldSet -> FieldSet) -> Proof -> Proof
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
forall msg. Message msg => Lens' msg FieldSet
Setter Proof Proof FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) Proof
x)
Growing Vector RealWorld ProofOp
mutable'ops
in
Parser Proof -> String -> Parser Proof
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
(do Growing Vector RealWorld ProofOp
mutable'ops <- IO (Growing Vector RealWorld ProofOp)
-> Parser (Growing Vector RealWorld ProofOp)
forall a. IO a -> Parser a
Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO
IO (Growing Vector RealWorld ProofOp)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
m (Growing v (PrimState m) a)
Data.ProtoLens.Encoding.Growing.new
Proof -> Growing Vector RealWorld ProofOp -> Parser Proof
loop Proof
forall msg. Message msg => msg
Data.ProtoLens.defMessage Growing Vector RealWorld ProofOp
mutable'ops)
"Proof"
buildMessage :: Proof -> Builder
buildMessage
= \ _x :: Proof
_x
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
((ProofOp -> Builder) -> Vector ProofOp -> Builder
forall (v :: * -> *) a.
Vector v a =>
(a -> Builder) -> v a -> Builder
Data.ProtoLens.Encoding.Bytes.foldMapBuilder
(\ _v :: ProofOp
_v
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 10)
((ByteString -> Builder)
-> (ProofOp -> ByteString) -> ProofOp -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
(\ bs :: ByteString
bs
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
(Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
(ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
ProofOp -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
ProofOp
_v))
(FoldLike
(Vector ProofOp) Proof Proof (Vector ProofOp) (Vector ProofOp)
-> Proof -> Vector ProofOp
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "vec'ops" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"vec'ops") Proof
_x))
(FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
(FoldLike FieldSet Proof Proof FieldSet FieldSet
-> Proof -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet Proof Proof FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields Proof
_x))
instance Control.DeepSeq.NFData Proof where
rnf :: Proof -> ()
rnf
= \ x__ :: Proof
x__
-> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(Proof -> FieldSet
_Proof'_unknownFields Proof
x__)
(Vector ProofOp -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (Proof -> Vector ProofOp
_Proof'ops Proof
x__) ())
data ProofOp
= ProofOp'_constructor {ProofOp -> Text
_ProofOp'type' :: !Data.Text.Text,
ProofOp -> ByteString
_ProofOp'key :: !Data.ByteString.ByteString,
ProofOp -> ByteString
_ProofOp'data' :: !Data.ByteString.ByteString,
ProofOp -> FieldSet
_ProofOp'_unknownFields :: !Data.ProtoLens.FieldSet}
deriving (ProofOp -> ProofOp -> Bool
(ProofOp -> ProofOp -> Bool)
-> (ProofOp -> ProofOp -> Bool) -> Eq ProofOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProofOp -> ProofOp -> Bool
$c/= :: ProofOp -> ProofOp -> Bool
== :: ProofOp -> ProofOp -> Bool
$c== :: ProofOp -> ProofOp -> Bool
Prelude.Eq, Eq ProofOp
Eq ProofOp =>
(ProofOp -> ProofOp -> Ordering)
-> (ProofOp -> ProofOp -> Bool)
-> (ProofOp -> ProofOp -> Bool)
-> (ProofOp -> ProofOp -> Bool)
-> (ProofOp -> ProofOp -> Bool)
-> (ProofOp -> ProofOp -> ProofOp)
-> (ProofOp -> ProofOp -> ProofOp)
-> Ord ProofOp
ProofOp -> ProofOp -> Bool
ProofOp -> ProofOp -> Ordering
ProofOp -> ProofOp -> ProofOp
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
min :: ProofOp -> ProofOp -> ProofOp
$cmin :: ProofOp -> ProofOp -> ProofOp
max :: ProofOp -> ProofOp -> ProofOp
$cmax :: ProofOp -> ProofOp -> ProofOp
>= :: ProofOp -> ProofOp -> Bool
$c>= :: ProofOp -> ProofOp -> Bool
> :: ProofOp -> ProofOp -> Bool
$c> :: ProofOp -> ProofOp -> Bool
<= :: ProofOp -> ProofOp -> Bool
$c<= :: ProofOp -> ProofOp -> Bool
< :: ProofOp -> ProofOp -> Bool
$c< :: ProofOp -> ProofOp -> Bool
compare :: ProofOp -> ProofOp -> Ordering
$ccompare :: ProofOp -> ProofOp -> Ordering
$cp1Ord :: Eq ProofOp
Prelude.Ord)
instance Prelude.Show ProofOp where
showsPrec :: Int -> ProofOp -> ShowS
showsPrec _ __x :: ProofOp
__x __s :: String
__s
= Char -> ShowS
Prelude.showChar
'{'
(String -> ShowS
Prelude.showString
(ProofOp -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort ProofOp
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField ProofOp "type'" Data.Text.Text where
fieldOf :: Proxy# "type'" -> (Text -> f Text) -> ProofOp -> f ProofOp
fieldOf _
= ((Text -> f Text) -> ProofOp -> f ProofOp)
-> ((Text -> f Text) -> Text -> f Text)
-> (Text -> f Text)
-> ProofOp
-> f ProofOp
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((ProofOp -> Text)
-> (ProofOp -> Text -> ProofOp) -> Lens ProofOp ProofOp Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
ProofOp -> Text
_ProofOp'type' (\ x__ :: ProofOp
x__ y__ :: Text
y__ -> ProofOp
x__ {_ProofOp'type' :: Text
_ProofOp'type' = Text
y__}))
(Text -> f Text) -> Text -> f Text
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField ProofOp "key" Data.ByteString.ByteString where
fieldOf :: Proxy# "key"
-> (ByteString -> f ByteString) -> ProofOp -> f ProofOp
fieldOf _
= ((ByteString -> f ByteString) -> ProofOp -> f ProofOp)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> ProofOp
-> f ProofOp
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((ProofOp -> ByteString)
-> (ProofOp -> ByteString -> ProofOp)
-> Lens ProofOp ProofOp ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
ProofOp -> ByteString
_ProofOp'key (\ x__ :: ProofOp
x__ y__ :: ByteString
y__ -> ProofOp
x__ {_ProofOp'key :: ByteString
_ProofOp'key = ByteString
y__}))
(ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField ProofOp "data'" Data.ByteString.ByteString where
fieldOf :: Proxy# "data'"
-> (ByteString -> f ByteString) -> ProofOp -> f ProofOp
fieldOf _
= ((ByteString -> f ByteString) -> ProofOp -> f ProofOp)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> ProofOp
-> f ProofOp
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((ProofOp -> ByteString)
-> (ProofOp -> ByteString -> ProofOp)
-> Lens ProofOp ProofOp ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
ProofOp -> ByteString
_ProofOp'data' (\ x__ :: ProofOp
x__ y__ :: ByteString
y__ -> ProofOp
x__ {_ProofOp'data' :: ByteString
_ProofOp'data' = ByteString
y__}))
(ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message ProofOp where
messageName :: Proxy ProofOp -> Text
messageName _ = String -> Text
Data.Text.pack "merkle.ProofOp"
fieldsByTag :: Map Tag (FieldDescriptor ProofOp)
fieldsByTag
= let
type'__field_descriptor :: FieldDescriptor ProofOp
type'__field_descriptor
= String
-> FieldTypeDescriptor Text
-> FieldAccessor ProofOp Text
-> FieldDescriptor ProofOp
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"type"
(ScalarField Text -> FieldTypeDescriptor Text
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField Text
Data.ProtoLens.StringField ::
Data.ProtoLens.FieldTypeDescriptor Data.Text.Text)
(WireDefault Text
-> Lens ProofOp ProofOp Text Text -> FieldAccessor ProofOp Text
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
WireDefault Text
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "type'" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"type'")) ::
Data.ProtoLens.FieldDescriptor ProofOp
key__field_descriptor :: FieldDescriptor ProofOp
key__field_descriptor
= String
-> FieldTypeDescriptor ByteString
-> FieldAccessor ProofOp ByteString
-> FieldDescriptor ProofOp
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"key"
(ScalarField ByteString -> FieldTypeDescriptor ByteString
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField ByteString
Data.ProtoLens.BytesField ::
Data.ProtoLens.FieldTypeDescriptor Data.ByteString.ByteString)
(WireDefault ByteString
-> Lens ProofOp ProofOp ByteString ByteString
-> FieldAccessor ProofOp ByteString
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
WireDefault ByteString
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key")) ::
Data.ProtoLens.FieldDescriptor ProofOp
data'__field_descriptor :: FieldDescriptor ProofOp
data'__field_descriptor
= String
-> FieldTypeDescriptor ByteString
-> FieldAccessor ProofOp ByteString
-> FieldDescriptor ProofOp
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"data"
(ScalarField ByteString -> FieldTypeDescriptor ByteString
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField ByteString
Data.ProtoLens.BytesField ::
Data.ProtoLens.FieldTypeDescriptor Data.ByteString.ByteString)
(WireDefault ByteString
-> Lens ProofOp ProofOp ByteString ByteString
-> FieldAccessor ProofOp ByteString
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
WireDefault ByteString
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "data'" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"data'")) ::
Data.ProtoLens.FieldDescriptor ProofOp
in
[(Tag, FieldDescriptor ProofOp)]
-> Map Tag (FieldDescriptor ProofOp)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
[(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor ProofOp
type'__field_descriptor),
(Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor ProofOp
key__field_descriptor),
(Int -> Tag
Data.ProtoLens.Tag 3, FieldDescriptor ProofOp
data'__field_descriptor)]
unknownFields :: LensLike' f ProofOp FieldSet
unknownFields
= (ProofOp -> FieldSet)
-> (ProofOp -> FieldSet -> ProofOp) -> Lens' ProofOp FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
ProofOp -> FieldSet
_ProofOp'_unknownFields
(\ x__ :: ProofOp
x__ y__ :: FieldSet
y__ -> ProofOp
x__ {_ProofOp'_unknownFields :: FieldSet
_ProofOp'_unknownFields = FieldSet
y__})
defMessage :: ProofOp
defMessage
= $WProofOp'_constructor :: Text -> ByteString -> ByteString -> FieldSet -> ProofOp
ProofOp'_constructor
{_ProofOp'type' :: Text
_ProofOp'type' = Text
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_ProofOp'key :: ByteString
_ProofOp'key = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_ProofOp'data' :: ByteString
_ProofOp'data' = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_ProofOp'_unknownFields :: FieldSet
_ProofOp'_unknownFields = []}
parseMessage :: Parser ProofOp
parseMessage
= let
loop :: ProofOp -> Data.ProtoLens.Encoding.Bytes.Parser ProofOp
loop :: ProofOp -> Parser ProofOp
loop x :: ProofOp
x
= do Bool
end <- Parser Bool
Data.ProtoLens.Encoding.Bytes.atEnd
if Bool
end then
do (let missing :: [a]
missing = []
in
if [Any] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
Prelude.null [Any]
forall a. [a]
missing then
() -> Parser ()
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return ()
else
String -> Parser ()
forall (m :: * -> *) a. MonadFail m => String -> m a
Prelude.fail
(String -> ShowS
forall a. [a] -> [a] -> [a]
(Prelude.++)
"Missing required fields: "
([String] -> String
forall a. Show a => a -> String
Prelude.show ([String]
forall a. [a]
missing :: [Prelude.String]))))
ProofOp -> Parser ProofOp
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
(Setter ProofOp ProofOp FieldSet FieldSet
-> (FieldSet -> FieldSet) -> ProofOp -> ProofOp
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
forall msg. Message msg => Lens' msg FieldSet
Setter ProofOp ProofOp FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) ProofOp
x)
else
do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
case Word64
tag of
10
-> do Text
y <- Parser Text -> String -> Parser Text
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
(do ByteString
value <- do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
Int -> Parser ByteString
Data.ProtoLens.Encoding.Bytes.getBytes
(Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len)
Either String Text -> Parser Text
forall a. Either String a -> Parser a
Data.ProtoLens.Encoding.Bytes.runEither
(case ByteString -> Either UnicodeException Text
Data.Text.Encoding.decodeUtf8' ByteString
value of
(Prelude.Left err :: UnicodeException
err)
-> String -> Either String Text
forall a b. a -> Either a b
Prelude.Left (UnicodeException -> String
forall a. Show a => a -> String
Prelude.show UnicodeException
err)
(Prelude.Right r :: Text
r) -> Text -> Either String Text
forall a b. b -> Either a b
Prelude.Right Text
r))
"type"
ProofOp -> Parser ProofOp
loop (Setter ProofOp ProofOp Text Text -> Text -> ProofOp -> ProofOp
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "type'" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"type'") Text
y ProofOp
x)
18
-> do ByteString
y <- Parser ByteString -> String -> Parser ByteString
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
(do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
Int -> Parser ByteString
Data.ProtoLens.Encoding.Bytes.getBytes
(Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len))
"key"
ProofOp -> Parser ProofOp
loop (Setter ProofOp ProofOp ByteString ByteString
-> ByteString -> ProofOp -> ProofOp
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key") ByteString
y ProofOp
x)
26
-> do ByteString
y <- Parser ByteString -> String -> Parser ByteString
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
(do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
Int -> Parser ByteString
Data.ProtoLens.Encoding.Bytes.getBytes
(Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len))
"data"
ProofOp -> Parser ProofOp
loop (Setter ProofOp ProofOp ByteString ByteString
-> ByteString -> ProofOp -> ProofOp
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "data'" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"data'") ByteString
y ProofOp
x)
wire :: Word64
wire
-> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
Word64
wire
ProofOp -> Parser ProofOp
loop
(Setter ProofOp ProofOp FieldSet FieldSet
-> (FieldSet -> FieldSet) -> ProofOp -> ProofOp
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
forall msg. Message msg => Lens' msg FieldSet
Setter ProofOp ProofOp FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) ProofOp
x)
in
Parser ProofOp -> String -> Parser ProofOp
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
(do ProofOp -> Parser ProofOp
loop ProofOp
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "ProofOp"
buildMessage :: ProofOp -> Builder
buildMessage
= \ _x :: ProofOp
_x
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(let
_v :: Text
_v = FoldLike Text ProofOp ProofOp Text Text -> ProofOp -> Text
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "type'" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"type'") ProofOp
_x
in
if Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) Text
_v Text
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault then
Builder
forall a. Monoid a => a
Data.Monoid.mempty
else
Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 10)
((ByteString -> Builder) -> (Text -> ByteString) -> Text -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
(\ bs :: ByteString
bs
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
(Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
(ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
Text -> ByteString
Data.Text.Encoding.encodeUtf8
Text
_v))
(Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(let _v :: ByteString
_v = FoldLike ByteString ProofOp ProofOp ByteString ByteString
-> ProofOp -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key") ProofOp
_x
in
if ByteString -> ByteString -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) ByteString
_v ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault then
Builder
forall a. Monoid a => a
Data.Monoid.mempty
else
Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 18)
((\ bs :: ByteString
bs
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
(Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
(ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
ByteString
_v))
(Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(let
_v :: ByteString
_v = FoldLike ByteString ProofOp ProofOp ByteString ByteString
-> ProofOp -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "data'" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"data'") ProofOp
_x
in
if ByteString -> ByteString -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) ByteString
_v ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault then
Builder
forall a. Monoid a => a
Data.Monoid.mempty
else
Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 26)
((\ bs :: ByteString
bs
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
(Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
(ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
ByteString
_v))
(FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
(FoldLike FieldSet ProofOp ProofOp FieldSet FieldSet
-> ProofOp -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet ProofOp ProofOp FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields ProofOp
_x))))
instance Control.DeepSeq.NFData ProofOp where
rnf :: ProofOp -> ()
rnf
= \ x__ :: ProofOp
x__
-> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(ProofOp -> FieldSet
_ProofOp'_unknownFields ProofOp
x__)
(Text -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(ProofOp -> Text
_ProofOp'type' ProofOp
x__)
(ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(ProofOp -> ByteString
_ProofOp'key ProofOp
x__)
(ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (ProofOp -> ByteString
_ProofOp'data' ProofOp
x__) ())))