{-# 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.Modules.Bank (
Burn(), Transfer()
) 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
data Burn
= Burn'_constructor {Burn -> ByteString
_Burn'address :: !Data.ByteString.ByteString,
Burn -> Text
_Burn'cid :: !Data.Text.Text,
Burn -> Word64
_Burn'amount :: !Data.Word.Word64,
Burn -> FieldSet
_Burn'_unknownFields :: !Data.ProtoLens.FieldSet}
deriving (Burn -> Burn -> Bool
(Burn -> Burn -> Bool) -> (Burn -> Burn -> Bool) -> Eq Burn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Burn -> Burn -> Bool
$c/= :: Burn -> Burn -> Bool
== :: Burn -> Burn -> Bool
$c== :: Burn -> Burn -> Bool
Prelude.Eq, Eq Burn
Eq Burn =>
(Burn -> Burn -> Ordering)
-> (Burn -> Burn -> Bool)
-> (Burn -> Burn -> Bool)
-> (Burn -> Burn -> Bool)
-> (Burn -> Burn -> Bool)
-> (Burn -> Burn -> Burn)
-> (Burn -> Burn -> Burn)
-> Ord Burn
Burn -> Burn -> Bool
Burn -> Burn -> Ordering
Burn -> Burn -> Burn
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 :: Burn -> Burn -> Burn
$cmin :: Burn -> Burn -> Burn
max :: Burn -> Burn -> Burn
$cmax :: Burn -> Burn -> Burn
>= :: Burn -> Burn -> Bool
$c>= :: Burn -> Burn -> Bool
> :: Burn -> Burn -> Bool
$c> :: Burn -> Burn -> Bool
<= :: Burn -> Burn -> Bool
$c<= :: Burn -> Burn -> Bool
< :: Burn -> Burn -> Bool
$c< :: Burn -> Burn -> Bool
compare :: Burn -> Burn -> Ordering
$ccompare :: Burn -> Burn -> Ordering
$cp1Ord :: Eq Burn
Prelude.Ord)
instance Prelude.Show Burn where
showsPrec :: Int -> Burn -> ShowS
showsPrec _ __x :: Burn
__x __s :: String
__s
= Char -> ShowS
Prelude.showChar
'{'
(String -> ShowS
Prelude.showString
(Burn -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort Burn
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField Burn "address" Data.ByteString.ByteString where
fieldOf :: Proxy# "address" -> (ByteString -> f ByteString) -> Burn -> f Burn
fieldOf _
= ((ByteString -> f ByteString) -> Burn -> f Burn)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> Burn
-> f Burn
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Burn -> ByteString)
-> (Burn -> ByteString -> Burn)
-> Lens Burn Burn ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Burn -> ByteString
_Burn'address (\ x__ :: Burn
x__ y__ :: ByteString
y__ -> Burn
x__ {_Burn'address :: ByteString
_Burn'address = ByteString
y__}))
(ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField Burn "cid" Data.Text.Text where
fieldOf :: Proxy# "cid" -> (Text -> f Text) -> Burn -> f Burn
fieldOf _
= ((Text -> f Text) -> Burn -> f Burn)
-> ((Text -> f Text) -> Text -> f Text)
-> (Text -> f Text)
-> Burn
-> f Burn
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Burn -> Text)
-> (Burn -> Text -> Burn) -> Lens Burn Burn Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Burn -> Text
_Burn'cid (\ x__ :: Burn
x__ y__ :: Text
y__ -> Burn
x__ {_Burn'cid :: Text
_Burn'cid = Text
y__}))
(Text -> f Text) -> Text -> f Text
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField Burn "amount" Data.Word.Word64 where
fieldOf :: Proxy# "amount" -> (Word64 -> f Word64) -> Burn -> f Burn
fieldOf _
= ((Word64 -> f Word64) -> Burn -> f Burn)
-> ((Word64 -> f Word64) -> Word64 -> f Word64)
-> (Word64 -> f Word64)
-> Burn
-> f Burn
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Burn -> Word64)
-> (Burn -> Word64 -> Burn) -> Lens Burn Burn Word64 Word64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Burn -> Word64
_Burn'amount (\ x__ :: Burn
x__ y__ :: Word64
y__ -> Burn
x__ {_Burn'amount :: Word64
_Burn'amount = Word64
y__}))
(Word64 -> f Word64) -> Word64 -> f Word64
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message Burn where
messageName :: Proxy Burn -> Text
messageName _ = String -> Text
Data.Text.pack "Bank.Burn"
fieldsByTag :: Map Tag (FieldDescriptor Burn)
fieldsByTag
= let
address__field_descriptor :: FieldDescriptor Burn
address__field_descriptor
= String
-> FieldTypeDescriptor ByteString
-> FieldAccessor Burn ByteString
-> FieldDescriptor Burn
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"address"
(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 Burn Burn ByteString ByteString
-> FieldAccessor Burn 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 "address" 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 @"address")) ::
Data.ProtoLens.FieldDescriptor Burn
cid__field_descriptor :: FieldDescriptor Burn
cid__field_descriptor
= String
-> FieldTypeDescriptor Text
-> FieldAccessor Burn Text
-> FieldDescriptor Burn
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"cid"
(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 Burn Burn Text Text -> FieldAccessor Burn 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 "cid" 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 @"cid")) ::
Data.ProtoLens.FieldDescriptor Burn
amount__field_descriptor :: FieldDescriptor Burn
amount__field_descriptor
= String
-> FieldTypeDescriptor Word64
-> FieldAccessor Burn Word64
-> FieldDescriptor Burn
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"amount"
(ScalarField Word64 -> FieldTypeDescriptor Word64
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField Word64
Data.ProtoLens.UInt64Field ::
Data.ProtoLens.FieldTypeDescriptor Data.Word.Word64)
(WireDefault Word64
-> Lens Burn Burn Word64 Word64 -> FieldAccessor Burn Word64
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
WireDefault Word64
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "amount" 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 @"amount")) ::
Data.ProtoLens.FieldDescriptor Burn
in
[(Tag, FieldDescriptor Burn)] -> Map Tag (FieldDescriptor Burn)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
[(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor Burn
address__field_descriptor),
(Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor Burn
cid__field_descriptor),
(Int -> Tag
Data.ProtoLens.Tag 3, FieldDescriptor Burn
amount__field_descriptor)]
unknownFields :: LensLike' f Burn FieldSet
unknownFields
= (Burn -> FieldSet)
-> (Burn -> FieldSet -> Burn) -> Lens' Burn FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Burn -> FieldSet
_Burn'_unknownFields
(\ x__ :: Burn
x__ y__ :: FieldSet
y__ -> Burn
x__ {_Burn'_unknownFields :: FieldSet
_Burn'_unknownFields = FieldSet
y__})
defMessage :: Burn
defMessage
= $WBurn'_constructor :: ByteString -> Text -> Word64 -> FieldSet -> Burn
Burn'_constructor
{_Burn'address :: ByteString
_Burn'address = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_Burn'cid :: Text
_Burn'cid = Text
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_Burn'amount :: Word64
_Burn'amount = Word64
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_Burn'_unknownFields :: FieldSet
_Burn'_unknownFields = []}
parseMessage :: Parser Burn
parseMessage
= let
loop :: Burn -> Data.ProtoLens.Encoding.Bytes.Parser Burn
loop :: Burn -> Parser Burn
loop x :: Burn
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]))))
Burn -> Parser Burn
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
(Setter Burn Burn FieldSet FieldSet
-> (FieldSet -> FieldSet) -> Burn -> Burn
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 Burn Burn FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) Burn
x)
else
do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
case Word64
tag of
10
-> 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))
"address"
Burn -> Parser Burn
loop (Setter Burn Burn ByteString ByteString
-> ByteString -> Burn -> Burn
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "address" 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 @"address") ByteString
y Burn
x)
18
-> 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))
"cid"
Burn -> Parser Burn
loop (Setter Burn Burn Text Text -> Text -> Burn -> Burn
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "cid" 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 @"cid") Text
y Burn
x)
24
-> do Word64
y <- Parser Word64 -> String -> Parser Word64
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt "amount"
Burn -> Parser Burn
loop (Setter Burn Burn Word64 Word64 -> Word64 -> Burn -> Burn
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "amount" 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 @"amount") Word64
y Burn
x)
wire :: Word64
wire
-> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
Word64
wire
Burn -> Parser Burn
loop
(Setter Burn Burn FieldSet FieldSet
-> (FieldSet -> FieldSet) -> Burn -> Burn
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 Burn Burn FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) Burn
x)
in
Parser Burn -> String -> Parser Burn
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
(do Burn -> Parser Burn
loop Burn
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "Burn"
buildMessage :: Burn -> Builder
buildMessage
= \ _x :: Burn
_x
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(let
_v :: ByteString
_v = FoldLike ByteString Burn Burn ByteString ByteString
-> Burn -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "address" 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 @"address") Burn
_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 10)
((\ 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 :: Text
_v = FoldLike Text Burn Burn Text Text -> Burn -> Text
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "cid" 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 @"cid") Burn
_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 18)
((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 :: Word64
_v = FoldLike Word64 Burn Burn Word64 Word64 -> Burn -> Word64
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "amount" 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 @"amount") Burn
_x
in
if Word64 -> Word64 -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) Word64
_v Word64
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 24)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt Word64
_v))
(FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
(FoldLike FieldSet Burn Burn FieldSet FieldSet -> Burn -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet Burn Burn FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields Burn
_x))))
instance Control.DeepSeq.NFData Burn where
rnf :: Burn -> ()
rnf
= \ x__ :: Burn
x__
-> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(Burn -> FieldSet
_Burn'_unknownFields Burn
x__)
(ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(Burn -> ByteString
_Burn'address Burn
x__)
(Text -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(Burn -> Text
_Burn'cid Burn
x__) (Word64 -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (Burn -> Word64
_Burn'amount Burn
x__) ())))
data Transfer
= Transfer'_constructor {Transfer -> ByteString
_Transfer'to :: !Data.ByteString.ByteString,
Transfer -> ByteString
_Transfer'from :: !Data.ByteString.ByteString,
Transfer -> Text
_Transfer'cid :: !Data.Text.Text,
Transfer -> Word64
_Transfer'amount :: !Data.Word.Word64,
Transfer -> FieldSet
_Transfer'_unknownFields :: !Data.ProtoLens.FieldSet}
deriving (Transfer -> Transfer -> Bool
(Transfer -> Transfer -> Bool)
-> (Transfer -> Transfer -> Bool) -> Eq Transfer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Transfer -> Transfer -> Bool
$c/= :: Transfer -> Transfer -> Bool
== :: Transfer -> Transfer -> Bool
$c== :: Transfer -> Transfer -> Bool
Prelude.Eq, Eq Transfer
Eq Transfer =>
(Transfer -> Transfer -> Ordering)
-> (Transfer -> Transfer -> Bool)
-> (Transfer -> Transfer -> Bool)
-> (Transfer -> Transfer -> Bool)
-> (Transfer -> Transfer -> Bool)
-> (Transfer -> Transfer -> Transfer)
-> (Transfer -> Transfer -> Transfer)
-> Ord Transfer
Transfer -> Transfer -> Bool
Transfer -> Transfer -> Ordering
Transfer -> Transfer -> Transfer
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 :: Transfer -> Transfer -> Transfer
$cmin :: Transfer -> Transfer -> Transfer
max :: Transfer -> Transfer -> Transfer
$cmax :: Transfer -> Transfer -> Transfer
>= :: Transfer -> Transfer -> Bool
$c>= :: Transfer -> Transfer -> Bool
> :: Transfer -> Transfer -> Bool
$c> :: Transfer -> Transfer -> Bool
<= :: Transfer -> Transfer -> Bool
$c<= :: Transfer -> Transfer -> Bool
< :: Transfer -> Transfer -> Bool
$c< :: Transfer -> Transfer -> Bool
compare :: Transfer -> Transfer -> Ordering
$ccompare :: Transfer -> Transfer -> Ordering
$cp1Ord :: Eq Transfer
Prelude.Ord)
instance Prelude.Show Transfer where
showsPrec :: Int -> Transfer -> ShowS
showsPrec _ __x :: Transfer
__x __s :: String
__s
= Char -> ShowS
Prelude.showChar
'{'
(String -> ShowS
Prelude.showString
(Transfer -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort Transfer
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField Transfer "to" Data.ByteString.ByteString where
fieldOf :: Proxy# "to"
-> (ByteString -> f ByteString) -> Transfer -> f Transfer
fieldOf _
= ((ByteString -> f ByteString) -> Transfer -> f Transfer)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> Transfer
-> f Transfer
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Transfer -> ByteString)
-> (Transfer -> ByteString -> Transfer)
-> Lens Transfer Transfer ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Transfer -> ByteString
_Transfer'to (\ x__ :: Transfer
x__ y__ :: ByteString
y__ -> Transfer
x__ {_Transfer'to :: ByteString
_Transfer'to = ByteString
y__}))
(ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField Transfer "from" Data.ByteString.ByteString where
fieldOf :: Proxy# "from"
-> (ByteString -> f ByteString) -> Transfer -> f Transfer
fieldOf _
= ((ByteString -> f ByteString) -> Transfer -> f Transfer)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> Transfer
-> f Transfer
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Transfer -> ByteString)
-> (Transfer -> ByteString -> Transfer)
-> Lens Transfer Transfer ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Transfer -> ByteString
_Transfer'from (\ x__ :: Transfer
x__ y__ :: ByteString
y__ -> Transfer
x__ {_Transfer'from :: ByteString
_Transfer'from = ByteString
y__}))
(ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField Transfer "cid" Data.Text.Text where
fieldOf :: Proxy# "cid" -> (Text -> f Text) -> Transfer -> f Transfer
fieldOf _
= ((Text -> f Text) -> Transfer -> f Transfer)
-> ((Text -> f Text) -> Text -> f Text)
-> (Text -> f Text)
-> Transfer
-> f Transfer
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Transfer -> Text)
-> (Transfer -> Text -> Transfer)
-> Lens Transfer Transfer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Transfer -> Text
_Transfer'cid (\ x__ :: Transfer
x__ y__ :: Text
y__ -> Transfer
x__ {_Transfer'cid :: Text
_Transfer'cid = Text
y__}))
(Text -> f Text) -> Text -> f Text
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField Transfer "amount" Data.Word.Word64 where
fieldOf :: Proxy# "amount" -> (Word64 -> f Word64) -> Transfer -> f Transfer
fieldOf _
= ((Word64 -> f Word64) -> Transfer -> f Transfer)
-> ((Word64 -> f Word64) -> Word64 -> f Word64)
-> (Word64 -> f Word64)
-> Transfer
-> f Transfer
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
((Transfer -> Word64)
-> (Transfer -> Word64 -> Transfer)
-> Lens Transfer Transfer Word64 Word64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Transfer -> Word64
_Transfer'amount (\ x__ :: Transfer
x__ y__ :: Word64
y__ -> Transfer
x__ {_Transfer'amount :: Word64
_Transfer'amount = Word64
y__}))
(Word64 -> f Word64) -> Word64 -> f Word64
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message Transfer where
messageName :: Proxy Transfer -> Text
messageName _ = String -> Text
Data.Text.pack "Bank.Transfer"
fieldsByTag :: Map Tag (FieldDescriptor Transfer)
fieldsByTag
= let
to__field_descriptor :: FieldDescriptor Transfer
to__field_descriptor
= String
-> FieldTypeDescriptor ByteString
-> FieldAccessor Transfer ByteString
-> FieldDescriptor Transfer
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"to"
(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 Transfer Transfer ByteString ByteString
-> FieldAccessor Transfer 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 "to" 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 @"to")) ::
Data.ProtoLens.FieldDescriptor Transfer
from__field_descriptor :: FieldDescriptor Transfer
from__field_descriptor
= String
-> FieldTypeDescriptor ByteString
-> FieldAccessor Transfer ByteString
-> FieldDescriptor Transfer
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"from"
(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 Transfer Transfer ByteString ByteString
-> FieldAccessor Transfer 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 "from" 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 @"from")) ::
Data.ProtoLens.FieldDescriptor Transfer
cid__field_descriptor :: FieldDescriptor Transfer
cid__field_descriptor
= String
-> FieldTypeDescriptor Text
-> FieldAccessor Transfer Text
-> FieldDescriptor Transfer
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"cid"
(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 Transfer Transfer Text Text -> FieldAccessor Transfer 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 "cid" 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 @"cid")) ::
Data.ProtoLens.FieldDescriptor Transfer
amount__field_descriptor :: FieldDescriptor Transfer
amount__field_descriptor
= String
-> FieldTypeDescriptor Word64
-> FieldAccessor Transfer Word64
-> FieldDescriptor Transfer
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
"amount"
(ScalarField Word64 -> FieldTypeDescriptor Word64
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField Word64
Data.ProtoLens.UInt64Field ::
Data.ProtoLens.FieldTypeDescriptor Data.Word.Word64)
(WireDefault Word64
-> Lens Transfer Transfer Word64 Word64
-> FieldAccessor Transfer Word64
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
WireDefault Word64
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "amount" 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 @"amount")) ::
Data.ProtoLens.FieldDescriptor Transfer
in
[(Tag, FieldDescriptor Transfer)]
-> Map Tag (FieldDescriptor Transfer)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
[(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor Transfer
to__field_descriptor),
(Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor Transfer
from__field_descriptor),
(Int -> Tag
Data.ProtoLens.Tag 3, FieldDescriptor Transfer
cid__field_descriptor),
(Int -> Tag
Data.ProtoLens.Tag 4, FieldDescriptor Transfer
amount__field_descriptor)]
unknownFields :: LensLike' f Transfer FieldSet
unknownFields
= (Transfer -> FieldSet)
-> (Transfer -> FieldSet -> Transfer) -> Lens' Transfer FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
Transfer -> FieldSet
_Transfer'_unknownFields
(\ x__ :: Transfer
x__ y__ :: FieldSet
y__ -> Transfer
x__ {_Transfer'_unknownFields :: FieldSet
_Transfer'_unknownFields = FieldSet
y__})
defMessage :: Transfer
defMessage
= $WTransfer'_constructor :: ByteString -> ByteString -> Text -> Word64 -> FieldSet -> Transfer
Transfer'_constructor
{_Transfer'to :: ByteString
_Transfer'to = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_Transfer'from :: ByteString
_Transfer'from = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_Transfer'cid :: Text
_Transfer'cid = Text
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_Transfer'amount :: Word64
_Transfer'amount = Word64
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
_Transfer'_unknownFields :: FieldSet
_Transfer'_unknownFields = []}
parseMessage :: Parser Transfer
parseMessage
= let
loop :: Transfer -> Data.ProtoLens.Encoding.Bytes.Parser Transfer
loop :: Transfer -> Parser Transfer
loop x :: Transfer
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]))))
Transfer -> Parser Transfer
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
(Setter Transfer Transfer FieldSet FieldSet
-> (FieldSet -> FieldSet) -> Transfer -> Transfer
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 Transfer Transfer FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) Transfer
x)
else
do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
case Word64
tag of
10
-> 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))
"to"
Transfer -> Parser Transfer
loop (Setter Transfer Transfer ByteString ByteString
-> ByteString -> Transfer -> Transfer
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "to" 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 @"to") ByteString
y Transfer
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))
"from"
Transfer -> Parser Transfer
loop (Setter Transfer Transfer ByteString ByteString
-> ByteString -> Transfer -> Transfer
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "from" 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 @"from") ByteString
y Transfer
x)
26
-> 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))
"cid"
Transfer -> Parser Transfer
loop (Setter Transfer Transfer Text Text -> Text -> Transfer -> Transfer
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "cid" 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 @"cid") Text
y Transfer
x)
32
-> do Word64
y <- Parser Word64 -> String -> Parser Word64
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt "amount"
Transfer -> Parser Transfer
loop (Setter Transfer Transfer Word64 Word64
-> Word64 -> Transfer -> Transfer
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "amount" 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 @"amount") Word64
y Transfer
x)
wire :: Word64
wire
-> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
Word64
wire
Transfer -> Parser Transfer
loop
(Setter Transfer Transfer FieldSet FieldSet
-> (FieldSet -> FieldSet) -> Transfer -> Transfer
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 Transfer Transfer FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) Transfer
x)
in
Parser Transfer -> String -> Parser Transfer
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
(do Transfer -> Parser Transfer
loop Transfer
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "Transfer"
buildMessage :: Transfer -> Builder
buildMessage
= \ _x :: Transfer
_x
-> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
(let _v :: ByteString
_v = FoldLike ByteString Transfer Transfer ByteString ByteString
-> Transfer -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "to" 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 @"to") Transfer
_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 10)
((\ 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 Transfer Transfer ByteString ByteString
-> Transfer -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "from" 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 @"from") Transfer
_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 :: Text
_v = FoldLike Text Transfer Transfer Text Text -> Transfer -> Text
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "cid" 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 @"cid") Transfer
_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 26)
((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 :: Word64
_v = FoldLike Word64 Transfer Transfer Word64 Word64
-> Transfer -> Word64
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "amount" 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 @"amount") Transfer
_x
in
if Word64 -> Word64 -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) Word64
_v Word64
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 32)
(Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt Word64
_v))
(FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
(FoldLike FieldSet Transfer Transfer FieldSet FieldSet
-> Transfer -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet Transfer Transfer FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields Transfer
_x)))))
instance Control.DeepSeq.NFData Transfer where
rnf :: Transfer -> ()
rnf
= \ x__ :: Transfer
x__
-> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(Transfer -> FieldSet
_Transfer'_unknownFields Transfer
x__)
(ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(Transfer -> ByteString
_Transfer'to Transfer
x__)
(ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(Transfer -> ByteString
_Transfer'from Transfer
x__)
(Text -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
(Transfer -> Text
_Transfer'cid Transfer
x__)
(Word64 -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (Transfer -> Word64
_Transfer'amount Transfer
x__) ()))))