{- This file was auto-generated from types/transaction.proto by the proto-lens-protoc program. -}
{-# 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.Types.Transaction (
        RawTransaction(), TypedMessage()
    ) 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
{- | Fields :
     
         * 'Proto.Types.Transaction_Fields.data'' @:: Lens' RawTransaction TypedMessage@
         * 'Proto.Types.Transaction_Fields.maybe'data'' @:: Lens' RawTransaction (Prelude.Maybe TypedMessage)@
         * 'Proto.Types.Transaction_Fields.gas' @:: Lens' RawTransaction Data.Int.Int64@
         * 'Proto.Types.Transaction_Fields.signature' @:: Lens' RawTransaction Data.ByteString.ByteString@
         * 'Proto.Types.Transaction_Fields.route' @:: Lens' RawTransaction Data.Text.Text@
         * 'Proto.Types.Transaction_Fields.nonce' @:: Lens' RawTransaction Data.Word.Word64@ -}
data RawTransaction
  = RawTransaction'_constructor {RawTransaction -> Maybe TypedMessage
_RawTransaction'data' :: !(Prelude.Maybe TypedMessage),
                                 RawTransaction -> Int64
_RawTransaction'gas :: !Data.Int.Int64,
                                 RawTransaction -> ByteString
_RawTransaction'signature :: !Data.ByteString.ByteString,
                                 RawTransaction -> Text
_RawTransaction'route :: !Data.Text.Text,
                                 RawTransaction -> Word64
_RawTransaction'nonce :: !Data.Word.Word64,
                                 RawTransaction -> FieldSet
_RawTransaction'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving (RawTransaction -> RawTransaction -> Bool
(RawTransaction -> RawTransaction -> Bool)
-> (RawTransaction -> RawTransaction -> Bool) -> Eq RawTransaction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RawTransaction -> RawTransaction -> Bool
$c/= :: RawTransaction -> RawTransaction -> Bool
== :: RawTransaction -> RawTransaction -> Bool
$c== :: RawTransaction -> RawTransaction -> Bool
Prelude.Eq, Eq RawTransaction
Eq RawTransaction =>
(RawTransaction -> RawTransaction -> Ordering)
-> (RawTransaction -> RawTransaction -> Bool)
-> (RawTransaction -> RawTransaction -> Bool)
-> (RawTransaction -> RawTransaction -> Bool)
-> (RawTransaction -> RawTransaction -> Bool)
-> (RawTransaction -> RawTransaction -> RawTransaction)
-> (RawTransaction -> RawTransaction -> RawTransaction)
-> Ord RawTransaction
RawTransaction -> RawTransaction -> Bool
RawTransaction -> RawTransaction -> Ordering
RawTransaction -> RawTransaction -> RawTransaction
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 :: RawTransaction -> RawTransaction -> RawTransaction
$cmin :: RawTransaction -> RawTransaction -> RawTransaction
max :: RawTransaction -> RawTransaction -> RawTransaction
$cmax :: RawTransaction -> RawTransaction -> RawTransaction
>= :: RawTransaction -> RawTransaction -> Bool
$c>= :: RawTransaction -> RawTransaction -> Bool
> :: RawTransaction -> RawTransaction -> Bool
$c> :: RawTransaction -> RawTransaction -> Bool
<= :: RawTransaction -> RawTransaction -> Bool
$c<= :: RawTransaction -> RawTransaction -> Bool
< :: RawTransaction -> RawTransaction -> Bool
$c< :: RawTransaction -> RawTransaction -> Bool
compare :: RawTransaction -> RawTransaction -> Ordering
$ccompare :: RawTransaction -> RawTransaction -> Ordering
$cp1Ord :: Eq RawTransaction
Prelude.Ord)
instance Prelude.Show RawTransaction where
  showsPrec :: Int -> RawTransaction -> ShowS
showsPrec _ __x :: RawTransaction
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (RawTransaction -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort RawTransaction
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField RawTransaction "data'" TypedMessage where
  fieldOf :: Proxy# "data'"
-> (TypedMessage -> f TypedMessage)
-> RawTransaction
-> f RawTransaction
fieldOf _
    = ((Maybe TypedMessage -> f (Maybe TypedMessage))
 -> RawTransaction -> f RawTransaction)
-> ((TypedMessage -> f TypedMessage)
    -> Maybe TypedMessage -> f (Maybe TypedMessage))
-> (TypedMessage -> f TypedMessage)
-> RawTransaction
-> f RawTransaction
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((RawTransaction -> Maybe TypedMessage)
-> (RawTransaction -> Maybe TypedMessage -> RawTransaction)
-> Lens
     RawTransaction
     RawTransaction
     (Maybe TypedMessage)
     (Maybe TypedMessage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           RawTransaction -> Maybe TypedMessage
_RawTransaction'data'
           (\ x__ :: RawTransaction
x__ y__ :: Maybe TypedMessage
y__ -> RawTransaction
x__ {_RawTransaction'data' :: Maybe TypedMessage
_RawTransaction'data' = Maybe TypedMessage
y__}))
        (TypedMessage -> Lens' (Maybe TypedMessage) TypedMessage
forall b. b -> Lens' (Maybe b) b
Data.ProtoLens.maybeLens TypedMessage
forall msg. Message msg => msg
Data.ProtoLens.defMessage)
instance Data.ProtoLens.Field.HasField RawTransaction "maybe'data'" (Prelude.Maybe TypedMessage) where
  fieldOf :: Proxy# "maybe'data'"
-> (Maybe TypedMessage -> f (Maybe TypedMessage))
-> RawTransaction
-> f RawTransaction
fieldOf _
    = ((Maybe TypedMessage -> f (Maybe TypedMessage))
 -> RawTransaction -> f RawTransaction)
-> ((Maybe TypedMessage -> f (Maybe TypedMessage))
    -> Maybe TypedMessage -> f (Maybe TypedMessage))
-> (Maybe TypedMessage -> f (Maybe TypedMessage))
-> RawTransaction
-> f RawTransaction
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((RawTransaction -> Maybe TypedMessage)
-> (RawTransaction -> Maybe TypedMessage -> RawTransaction)
-> Lens
     RawTransaction
     RawTransaction
     (Maybe TypedMessage)
     (Maybe TypedMessage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           RawTransaction -> Maybe TypedMessage
_RawTransaction'data'
           (\ x__ :: RawTransaction
x__ y__ :: Maybe TypedMessage
y__ -> RawTransaction
x__ {_RawTransaction'data' :: Maybe TypedMessage
_RawTransaction'data' = Maybe TypedMessage
y__}))
        (Maybe TypedMessage -> f (Maybe TypedMessage))
-> Maybe TypedMessage -> f (Maybe TypedMessage)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField RawTransaction "gas" Data.Int.Int64 where
  fieldOf :: Proxy# "gas"
-> (Int64 -> f Int64) -> RawTransaction -> f RawTransaction
fieldOf _
    = ((Int64 -> f Int64) -> RawTransaction -> f RawTransaction)
-> ((Int64 -> f Int64) -> Int64 -> f Int64)
-> (Int64 -> f Int64)
-> RawTransaction
-> f RawTransaction
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((RawTransaction -> Int64)
-> (RawTransaction -> Int64 -> RawTransaction)
-> Lens RawTransaction RawTransaction Int64 Int64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           RawTransaction -> Int64
_RawTransaction'gas (\ x__ :: RawTransaction
x__ y__ :: Int64
y__ -> RawTransaction
x__ {_RawTransaction'gas :: Int64
_RawTransaction'gas = Int64
y__}))
        (Int64 -> f Int64) -> Int64 -> f Int64
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField RawTransaction "signature" Data.ByteString.ByteString where
  fieldOf :: Proxy# "signature"
-> (ByteString -> f ByteString)
-> RawTransaction
-> f RawTransaction
fieldOf _
    = ((ByteString -> f ByteString)
 -> RawTransaction -> f RawTransaction)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> RawTransaction
-> f RawTransaction
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((RawTransaction -> ByteString)
-> (RawTransaction -> ByteString -> RawTransaction)
-> Lens RawTransaction RawTransaction ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           RawTransaction -> ByteString
_RawTransaction'signature
           (\ x__ :: RawTransaction
x__ y__ :: ByteString
y__ -> RawTransaction
x__ {_RawTransaction'signature :: ByteString
_RawTransaction'signature = ByteString
y__}))
        (ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField RawTransaction "route" Data.Text.Text where
  fieldOf :: Proxy# "route"
-> (Text -> f Text) -> RawTransaction -> f RawTransaction
fieldOf _
    = ((Text -> f Text) -> RawTransaction -> f RawTransaction)
-> ((Text -> f Text) -> Text -> f Text)
-> (Text -> f Text)
-> RawTransaction
-> f RawTransaction
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((RawTransaction -> Text)
-> (RawTransaction -> Text -> RawTransaction)
-> Lens RawTransaction RawTransaction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           RawTransaction -> Text
_RawTransaction'route
           (\ x__ :: RawTransaction
x__ y__ :: Text
y__ -> RawTransaction
x__ {_RawTransaction'route :: Text
_RawTransaction'route = Text
y__}))
        (Text -> f Text) -> Text -> f Text
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField RawTransaction "nonce" Data.Word.Word64 where
  fieldOf :: Proxy# "nonce"
-> (Word64 -> f Word64) -> RawTransaction -> f RawTransaction
fieldOf _
    = ((Word64 -> f Word64) -> RawTransaction -> f RawTransaction)
-> ((Word64 -> f Word64) -> Word64 -> f Word64)
-> (Word64 -> f Word64)
-> RawTransaction
-> f RawTransaction
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((RawTransaction -> Word64)
-> (RawTransaction -> Word64 -> RawTransaction)
-> Lens RawTransaction RawTransaction Word64 Word64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           RawTransaction -> Word64
_RawTransaction'nonce
           (\ x__ :: RawTransaction
x__ y__ :: Word64
y__ -> RawTransaction
x__ {_RawTransaction'nonce :: Word64
_RawTransaction'nonce = Word64
y__}))
        (Word64 -> f Word64) -> Word64 -> f Word64
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message RawTransaction where
  messageName :: Proxy RawTransaction -> Text
messageName _ = String -> Text
Data.Text.pack "Transaction.RawTransaction"
  fieldsByTag :: Map Tag (FieldDescriptor RawTransaction)
fieldsByTag
    = let
        data'__field_descriptor :: FieldDescriptor RawTransaction
data'__field_descriptor
          = String
-> FieldTypeDescriptor TypedMessage
-> FieldAccessor RawTransaction TypedMessage
-> FieldDescriptor RawTransaction
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "data"
              (MessageOrGroup -> FieldTypeDescriptor TypedMessage
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
                 Data.ProtoLens.FieldTypeDescriptor TypedMessage)
              (Lens
  RawTransaction
  RawTransaction
  (Maybe TypedMessage)
  (Maybe TypedMessage)
-> FieldAccessor RawTransaction TypedMessage
forall msg value.
Lens' msg (Maybe value) -> FieldAccessor msg value
Data.ProtoLens.OptionalField
                 (forall s a (f :: * -> *).
(HasField s "maybe'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 @"maybe'data'")) ::
              Data.ProtoLens.FieldDescriptor RawTransaction
        gas__field_descriptor :: FieldDescriptor RawTransaction
gas__field_descriptor
          = String
-> FieldTypeDescriptor Int64
-> FieldAccessor RawTransaction Int64
-> FieldDescriptor RawTransaction
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "gas"
              (ScalarField Int64 -> FieldTypeDescriptor Int64
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField Int64
Data.ProtoLens.Int64Field ::
                 Data.ProtoLens.FieldTypeDescriptor Data.Int.Int64)
              (WireDefault Int64
-> Lens RawTransaction RawTransaction Int64 Int64
-> FieldAccessor RawTransaction Int64
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault Int64
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "gas" 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 @"gas")) ::
              Data.ProtoLens.FieldDescriptor RawTransaction
        signature__field_descriptor :: FieldDescriptor RawTransaction
signature__field_descriptor
          = String
-> FieldTypeDescriptor ByteString
-> FieldAccessor RawTransaction ByteString
-> FieldDescriptor RawTransaction
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "signature"
              (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 RawTransaction RawTransaction ByteString ByteString
-> FieldAccessor RawTransaction 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 "signature" 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 @"signature")) ::
              Data.ProtoLens.FieldDescriptor RawTransaction
        route__field_descriptor :: FieldDescriptor RawTransaction
route__field_descriptor
          = String
-> FieldTypeDescriptor Text
-> FieldAccessor RawTransaction Text
-> FieldDescriptor RawTransaction
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "route"
              (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 RawTransaction RawTransaction Text Text
-> FieldAccessor RawTransaction 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 "route" 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 @"route")) ::
              Data.ProtoLens.FieldDescriptor RawTransaction
        nonce__field_descriptor :: FieldDescriptor RawTransaction
nonce__field_descriptor
          = String
-> FieldTypeDescriptor Word64
-> FieldAccessor RawTransaction Word64
-> FieldDescriptor RawTransaction
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "nonce"
              (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 RawTransaction RawTransaction Word64 Word64
-> FieldAccessor RawTransaction 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 "nonce" 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 @"nonce")) ::
              Data.ProtoLens.FieldDescriptor RawTransaction
      in
        [(Tag, FieldDescriptor RawTransaction)]
-> Map Tag (FieldDescriptor RawTransaction)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor RawTransaction
data'__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor RawTransaction
gas__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 3, FieldDescriptor RawTransaction
signature__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 4, FieldDescriptor RawTransaction
route__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 5, FieldDescriptor RawTransaction
nonce__field_descriptor)]
  unknownFields :: LensLike' f RawTransaction FieldSet
unknownFields
    = (RawTransaction -> FieldSet)
-> (RawTransaction -> FieldSet -> RawTransaction)
-> Lens' RawTransaction FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        RawTransaction -> FieldSet
_RawTransaction'_unknownFields
        (\ x__ :: RawTransaction
x__ y__ :: FieldSet
y__ -> RawTransaction
x__ {_RawTransaction'_unknownFields :: FieldSet
_RawTransaction'_unknownFields = FieldSet
y__})
  defMessage :: RawTransaction
defMessage
    = $WRawTransaction'_constructor :: Maybe TypedMessage
-> Int64
-> ByteString
-> Text
-> Word64
-> FieldSet
-> RawTransaction
RawTransaction'_constructor
        {_RawTransaction'data' :: Maybe TypedMessage
_RawTransaction'data' = Maybe TypedMessage
forall a. Maybe a
Prelude.Nothing,
         _RawTransaction'gas :: Int64
_RawTransaction'gas = Int64
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _RawTransaction'signature :: ByteString
_RawTransaction'signature = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _RawTransaction'route :: Text
_RawTransaction'route = Text
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _RawTransaction'nonce :: Word64
_RawTransaction'nonce = Word64
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _RawTransaction'_unknownFields :: FieldSet
_RawTransaction'_unknownFields = []}
  parseMessage :: Parser RawTransaction
parseMessage
    = let
        loop ::
          RawTransaction
          -> Data.ProtoLens.Encoding.Bytes.Parser RawTransaction
        loop :: RawTransaction -> Parser RawTransaction
loop x :: RawTransaction
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]))))
                      RawTransaction -> Parser RawTransaction
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter RawTransaction RawTransaction FieldSet FieldSet
-> (FieldSet -> FieldSet) -> RawTransaction -> RawTransaction
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 RawTransaction RawTransaction FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) RawTransaction
x)
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        10
                          -> do TypedMessage
y <- Parser TypedMessage -> String -> Parser TypedMessage
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser TypedMessage -> Parser TypedMessage
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 TypedMessage
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
                                       "data"
                                RawTransaction -> Parser RawTransaction
loop (Setter RawTransaction RawTransaction TypedMessage TypedMessage
-> TypedMessage -> RawTransaction -> RawTransaction
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'") TypedMessage
y RawTransaction
x)
                        16
                          -> do Int64
y <- Parser Int64 -> String -> Parser Int64
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       ((Word64 -> Int64) -> Parser Word64 -> Parser Int64
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap
                                          Word64 -> Int64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral
                                          Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt)
                                       "gas"
                                RawTransaction -> Parser RawTransaction
loop (Setter RawTransaction RawTransaction Int64 Int64
-> Int64 -> RawTransaction -> RawTransaction
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "gas" 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 @"gas") Int64
y RawTransaction
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))
                                       "signature"
                                RawTransaction -> Parser RawTransaction
loop
                                  (Setter RawTransaction RawTransaction ByteString ByteString
-> ByteString -> RawTransaction -> RawTransaction
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "signature" 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 @"signature") ByteString
y RawTransaction
x)
                        34
                          -> 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))
                                       "route"
                                RawTransaction -> Parser RawTransaction
loop (Setter RawTransaction RawTransaction Text Text
-> Text -> RawTransaction -> RawTransaction
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "route" 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 @"route") Text
y RawTransaction
x)
                        40
                          -> 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 "nonce"
                                RawTransaction -> Parser RawTransaction
loop (Setter RawTransaction RawTransaction Word64 Word64
-> Word64 -> RawTransaction -> RawTransaction
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "nonce" 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 @"nonce") Word64
y RawTransaction
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                RawTransaction -> Parser RawTransaction
loop
                                  (Setter RawTransaction RawTransaction FieldSet FieldSet
-> (FieldSet -> FieldSet) -> RawTransaction -> RawTransaction
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 RawTransaction RawTransaction FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) RawTransaction
x)
      in
        Parser RawTransaction -> String -> Parser RawTransaction
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do RawTransaction -> Parser RawTransaction
loop RawTransaction
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "RawTransaction"
  buildMessage :: RawTransaction -> Builder
buildMessage
    = \ _x :: RawTransaction
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (case
                  FoldLike
  (Maybe TypedMessage)
  RawTransaction
  RawTransaction
  (Maybe TypedMessage)
  (Maybe TypedMessage)
-> RawTransaction -> Maybe TypedMessage
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "maybe'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 @"maybe'data'") RawTransaction
_x
              of
                Prelude.Nothing -> Builder
forall a. Monoid a => a
Data.Monoid.mempty
                (Prelude.Just _v :: TypedMessage
_v)
                  -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                       (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 10)
                       ((ByteString -> Builder)
-> (TypedMessage -> ByteString) -> TypedMessage -> 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))
                          TypedMessage -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
                          TypedMessage
_v))
             (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                (let _v :: Int64
_v = FoldLike Int64 RawTransaction RawTransaction Int64 Int64
-> RawTransaction -> Int64
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "gas" 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 @"gas") RawTransaction
_x
                 in
                   if Int64 -> Int64 -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) Int64
_v Int64
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 16)
                         ((Word64 -> Builder) -> (Int64 -> Word64) -> Int64 -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                            Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt Int64 -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Int64
_v))
                (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                   (let
                      _v :: ByteString
_v = FoldLike
  ByteString RawTransaction RawTransaction ByteString ByteString
-> RawTransaction -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "signature" 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 @"signature") RawTransaction
_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))
                   (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                      (let
                         _v :: Text
_v = FoldLike Text RawTransaction RawTransaction Text Text
-> RawTransaction -> Text
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "route" 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 @"route") RawTransaction
_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 34)
                               ((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 RawTransaction RawTransaction Word64 Word64
-> RawTransaction -> Word64
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "nonce" 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 @"nonce") RawTransaction
_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 40)
                                  (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt Word64
_v))
                         (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                            (FoldLike FieldSet RawTransaction RawTransaction FieldSet FieldSet
-> RawTransaction -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet RawTransaction RawTransaction FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields RawTransaction
_x))))))
instance Control.DeepSeq.NFData RawTransaction where
  rnf :: RawTransaction -> ()
rnf
    = \ x__ :: RawTransaction
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (RawTransaction -> FieldSet
_RawTransaction'_unknownFields RawTransaction
x__)
             (Maybe TypedMessage -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (RawTransaction -> Maybe TypedMessage
_RawTransaction'data' RawTransaction
x__)
                (Int64 -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                   (RawTransaction -> Int64
_RawTransaction'gas RawTransaction
x__)
                   (ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                      (RawTransaction -> ByteString
_RawTransaction'signature RawTransaction
x__)
                      (Text -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                         (RawTransaction -> Text
_RawTransaction'route RawTransaction
x__)
                         (Word64 -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (RawTransaction -> Word64
_RawTransaction'nonce RawTransaction
x__) ())))))
{- | Fields :
     
         * 'Proto.Types.Transaction_Fields.type'' @:: Lens' TypedMessage Data.Text.Text@
         * 'Proto.Types.Transaction_Fields.data'' @:: Lens' TypedMessage Data.ByteString.ByteString@ -}
data TypedMessage
  = TypedMessage'_constructor {TypedMessage -> Text
_TypedMessage'type' :: !Data.Text.Text,
                               TypedMessage -> ByteString
_TypedMessage'data' :: !Data.ByteString.ByteString,
                               TypedMessage -> FieldSet
_TypedMessage'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving (TypedMessage -> TypedMessage -> Bool
(TypedMessage -> TypedMessage -> Bool)
-> (TypedMessage -> TypedMessage -> Bool) -> Eq TypedMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypedMessage -> TypedMessage -> Bool
$c/= :: TypedMessage -> TypedMessage -> Bool
== :: TypedMessage -> TypedMessage -> Bool
$c== :: TypedMessage -> TypedMessage -> Bool
Prelude.Eq, Eq TypedMessage
Eq TypedMessage =>
(TypedMessage -> TypedMessage -> Ordering)
-> (TypedMessage -> TypedMessage -> Bool)
-> (TypedMessage -> TypedMessage -> Bool)
-> (TypedMessage -> TypedMessage -> Bool)
-> (TypedMessage -> TypedMessage -> Bool)
-> (TypedMessage -> TypedMessage -> TypedMessage)
-> (TypedMessage -> TypedMessage -> TypedMessage)
-> Ord TypedMessage
TypedMessage -> TypedMessage -> Bool
TypedMessage -> TypedMessage -> Ordering
TypedMessage -> TypedMessage -> TypedMessage
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 :: TypedMessage -> TypedMessage -> TypedMessage
$cmin :: TypedMessage -> TypedMessage -> TypedMessage
max :: TypedMessage -> TypedMessage -> TypedMessage
$cmax :: TypedMessage -> TypedMessage -> TypedMessage
>= :: TypedMessage -> TypedMessage -> Bool
$c>= :: TypedMessage -> TypedMessage -> Bool
> :: TypedMessage -> TypedMessage -> Bool
$c> :: TypedMessage -> TypedMessage -> Bool
<= :: TypedMessage -> TypedMessage -> Bool
$c<= :: TypedMessage -> TypedMessage -> Bool
< :: TypedMessage -> TypedMessage -> Bool
$c< :: TypedMessage -> TypedMessage -> Bool
compare :: TypedMessage -> TypedMessage -> Ordering
$ccompare :: TypedMessage -> TypedMessage -> Ordering
$cp1Ord :: Eq TypedMessage
Prelude.Ord)
instance Prelude.Show TypedMessage where
  showsPrec :: Int -> TypedMessage -> ShowS
showsPrec _ __x :: TypedMessage
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (TypedMessage -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort TypedMessage
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField TypedMessage "type'" Data.Text.Text where
  fieldOf :: Proxy# "type'"
-> (Text -> f Text) -> TypedMessage -> f TypedMessage
fieldOf _
    = ((Text -> f Text) -> TypedMessage -> f TypedMessage)
-> ((Text -> f Text) -> Text -> f Text)
-> (Text -> f Text)
-> TypedMessage
-> f TypedMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TypedMessage -> Text)
-> (TypedMessage -> Text -> TypedMessage)
-> Lens TypedMessage TypedMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TypedMessage -> Text
_TypedMessage'type' (\ x__ :: TypedMessage
x__ y__ :: Text
y__ -> TypedMessage
x__ {_TypedMessage'type' :: Text
_TypedMessage'type' = Text
y__}))
        (Text -> f Text) -> Text -> f Text
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField TypedMessage "data'" Data.ByteString.ByteString where
  fieldOf :: Proxy# "data'"
-> (ByteString -> f ByteString) -> TypedMessage -> f TypedMessage
fieldOf _
    = ((ByteString -> f ByteString) -> TypedMessage -> f TypedMessage)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> TypedMessage
-> f TypedMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TypedMessage -> ByteString)
-> (TypedMessage -> ByteString -> TypedMessage)
-> Lens TypedMessage TypedMessage ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TypedMessage -> ByteString
_TypedMessage'data' (\ x__ :: TypedMessage
x__ y__ :: ByteString
y__ -> TypedMessage
x__ {_TypedMessage'data' :: ByteString
_TypedMessage'data' = ByteString
y__}))
        (ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message TypedMessage where
  messageName :: Proxy TypedMessage -> Text
messageName _ = String -> Text
Data.Text.pack "Transaction.TypedMessage"
  fieldsByTag :: Map Tag (FieldDescriptor TypedMessage)
fieldsByTag
    = let
        type'__field_descriptor :: FieldDescriptor TypedMessage
type'__field_descriptor
          = String
-> FieldTypeDescriptor Text
-> FieldAccessor TypedMessage Text
-> FieldDescriptor TypedMessage
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 TypedMessage TypedMessage Text Text
-> FieldAccessor TypedMessage 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 TypedMessage
        data'__field_descriptor :: FieldDescriptor TypedMessage
data'__field_descriptor
          = String
-> FieldTypeDescriptor ByteString
-> FieldAccessor TypedMessage ByteString
-> FieldDescriptor TypedMessage
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 TypedMessage TypedMessage ByteString ByteString
-> FieldAccessor TypedMessage 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 TypedMessage
      in
        [(Tag, FieldDescriptor TypedMessage)]
-> Map Tag (FieldDescriptor TypedMessage)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor TypedMessage
type'__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor TypedMessage
data'__field_descriptor)]
  unknownFields :: LensLike' f TypedMessage FieldSet
unknownFields
    = (TypedMessage -> FieldSet)
-> (TypedMessage -> FieldSet -> TypedMessage)
-> Lens' TypedMessage FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        TypedMessage -> FieldSet
_TypedMessage'_unknownFields
        (\ x__ :: TypedMessage
x__ y__ :: FieldSet
y__ -> TypedMessage
x__ {_TypedMessage'_unknownFields :: FieldSet
_TypedMessage'_unknownFields = FieldSet
y__})
  defMessage :: TypedMessage
defMessage
    = $WTypedMessage'_constructor :: Text -> ByteString -> FieldSet -> TypedMessage
TypedMessage'_constructor
        {_TypedMessage'type' :: Text
_TypedMessage'type' = Text
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _TypedMessage'data' :: ByteString
_TypedMessage'data' = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _TypedMessage'_unknownFields :: FieldSet
_TypedMessage'_unknownFields = []}
  parseMessage :: Parser TypedMessage
parseMessage
    = let
        loop ::
          TypedMessage -> Data.ProtoLens.Encoding.Bytes.Parser TypedMessage
        loop :: TypedMessage -> Parser TypedMessage
loop x :: TypedMessage
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]))))
                      TypedMessage -> Parser TypedMessage
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter TypedMessage TypedMessage FieldSet FieldSet
-> (FieldSet -> FieldSet) -> TypedMessage -> TypedMessage
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 TypedMessage TypedMessage FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) TypedMessage
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"
                                TypedMessage -> Parser TypedMessage
loop (Setter TypedMessage TypedMessage Text Text
-> Text -> TypedMessage -> TypedMessage
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 TypedMessage
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))
                                       "data"
                                TypedMessage -> Parser TypedMessage
loop (Setter TypedMessage TypedMessage ByteString ByteString
-> ByteString -> TypedMessage -> TypedMessage
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 TypedMessage
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                TypedMessage -> Parser TypedMessage
loop
                                  (Setter TypedMessage TypedMessage FieldSet FieldSet
-> (FieldSet -> FieldSet) -> TypedMessage -> TypedMessage
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 TypedMessage TypedMessage FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) TypedMessage
x)
      in
        Parser TypedMessage -> String -> Parser TypedMessage
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do TypedMessage -> Parser TypedMessage
loop TypedMessage
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "TypedMessage"
  buildMessage :: TypedMessage -> Builder
buildMessage
    = \ _x :: TypedMessage
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (let
                _v :: Text
_v = FoldLike Text TypedMessage TypedMessage Text Text
-> TypedMessage -> 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'") TypedMessage
_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 TypedMessage TypedMessage ByteString ByteString
-> TypedMessage -> 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'") TypedMessage
_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))
                (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                   (FoldLike FieldSet TypedMessage TypedMessage FieldSet FieldSet
-> TypedMessage -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet TypedMessage TypedMessage FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields TypedMessage
_x)))
instance Control.DeepSeq.NFData TypedMessage where
  rnf :: TypedMessage -> ()
rnf
    = \ x__ :: TypedMessage
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (TypedMessage -> FieldSet
_TypedMessage'_unknownFields TypedMessage
x__)
             (Text -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (TypedMessage -> Text
_TypedMessage'type' TypedMessage
x__)
                (ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (TypedMessage -> ByteString
_TypedMessage'data' TypedMessage
x__) ()))