Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Commit ed3a029

Browse files
airvinnwaywood
andcommitted
Updated proto files from fabric
Co-authored-by: Nick Waywood <n.waywood@gmail.com> Signed-off-by: Allison Irvin <allison.irvin2@gmail.com>
1 parent 04ac4a8 commit ed3a029

25 files changed

+4422
-1190
lines changed

protos-hs/Common/Common.hs

Lines changed: 1398 additions & 0 deletions
Large diffs are not rendered by default.

protos-hs/Common/Policies.hs

Lines changed: 75 additions & 74 deletions
Large diffs are not rendered by default.

protos-hs/Google/Protobuf/Timestamp.hs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
1010

1111
-- | Generated by Haskell protocol buffer compiler. DO NOT EDIT!
12+
1213
module Google.Protobuf.Timestamp where
1314
import qualified Prelude as Hs
1415
import qualified Proto3.Suite.Class as HsProtobuf
@@ -34,16 +35,16 @@ import qualified Data.Word as Hs (Word16, Word32, Word64)
3435
import qualified GHC.Enum as Hs
3536
import qualified GHC.Generics as Hs
3637
import qualified Unsafe.Coerce as Hs
37-
38+
3839
data Timestamp = Timestamp{timestampSeconds :: Hs.Int64,
3940
timestampNanos :: Hs.Int32}
4041
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData)
41-
42+
4243
instance HsProtobuf.Named Timestamp where
4344
nameOf _ = (Hs.fromString "Timestamp")
44-
45+
4546
instance HsProtobuf.HasDefault Timestamp
46-
47+
4748
instance HsProtobuf.Message Timestamp where
4849
encodeMessage _
4950
Timestamp{timestampSeconds = timestampSeconds,
@@ -71,26 +72,26 @@ instance HsProtobuf.Message Timestamp where
7172
(HsProtobuf.Single "nanos")
7273
[]
7374
"")]
74-
75+
7576
instance HsJSONPB.ToJSONPB Timestamp where
7677
toJSONPB (Timestamp f1 f2)
7778
= (HsJSONPB.object ["seconds" .= f1, "nanos" .= f2])
7879
toEncodingPB (Timestamp f1 f2)
7980
= (HsJSONPB.pairs ["seconds" .= f1, "nanos" .= f2])
80-
81+
8182
instance HsJSONPB.FromJSONPB Timestamp where
8283
parseJSONPB
8384
= (HsJSONPB.withObject "Timestamp"
8485
(\ obj ->
8586
(Hs.pure Timestamp) <*> obj .: "seconds" <*> obj .: "nanos"))
86-
87+
8788
instance HsJSONPB.ToJSON Timestamp where
8889
toJSON = HsJSONPB.toAesonValue
8990
toEncoding = HsJSONPB.toAesonEncoding
90-
91+
9192
instance HsJSONPB.FromJSON Timestamp where
9293
parseJSON = HsJSONPB.parseJSONPB
93-
94+
9495
instance HsJSONPB.ToSchema Timestamp where
9596
declareNamedSchema _
9697
= do let declare_seconds = HsJSONPB.declareSchemaRef
@@ -109,4 +110,4 @@ instance HsJSONPB.ToSchema Timestamp where
109110
HsJSONPB._schemaProperties =
110111
HsJSONPB.insOrdFromList
111112
[("seconds", timestampSeconds),
112-
("nanos", timestampNanos)]}})
113+
("nanos", timestampNanos)]}})

protos-hs/Ledger/Queryresult/KvQueryResult.hs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
1010

1111
-- | Generated by Haskell protocol buffer compiler. DO NOT EDIT!
12+
1213
module Ledger.Queryresult.KvQueryResult where
1314
import qualified Prelude as Hs
1415
import qualified Proto3.Suite.Class as HsProtobuf
@@ -35,16 +36,16 @@ import qualified GHC.Enum as Hs
3536
import qualified GHC.Generics as Hs
3637
import qualified Unsafe.Coerce as Hs
3738
import qualified Google.Protobuf.Timestamp
38-
39+
3940
data KV = KV{kvNamespace :: Hs.Text, kvKey :: Hs.Text,
4041
kvValue :: Hs.ByteString}
4142
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData)
42-
43+
4344
instance HsProtobuf.Named KV where
4445
nameOf _ = (Hs.fromString "KV")
45-
46+
4647
instance HsProtobuf.HasDefault KV
47-
48+
4849
instance HsProtobuf.Message KV where
4950
encodeMessage _
5051
KV{kvNamespace = kvNamespace, kvKey = kvKey, kvValue = kvValue}
@@ -80,27 +81,27 @@ instance HsProtobuf.Message KV where
8081
(HsProtobuf.Single "value")
8182
[]
8283
"")]
83-
84+
8485
instance HsJSONPB.ToJSONPB KV where
8586
toJSONPB (KV f1 f2 f3)
8687
= (HsJSONPB.object ["namespace" .= f1, "key" .= f2, "value" .= f3])
8788
toEncodingPB (KV f1 f2 f3)
8889
= (HsJSONPB.pairs ["namespace" .= f1, "key" .= f2, "value" .= f3])
89-
90+
9091
instance HsJSONPB.FromJSONPB KV where
9192
parseJSONPB
9293
= (HsJSONPB.withObject "KV"
9394
(\ obj ->
9495
(Hs.pure KV) <*> obj .: "namespace" <*> obj .: "key" <*>
9596
obj .: "value"))
96-
97+
9798
instance HsJSONPB.ToJSON KV where
9899
toJSON = HsJSONPB.toAesonValue
99100
toEncoding = HsJSONPB.toAesonEncoding
100-
101+
101102
instance HsJSONPB.FromJSON KV where
102103
parseJSON = HsJSONPB.parseJSONPB
103-
104+
104105
instance HsJSONPB.ToSchema KV where
105106
declareNamedSchema _
106107
= do let declare_namespace = HsJSONPB.declareSchemaRef
@@ -122,20 +123,20 @@ instance HsJSONPB.ToSchema KV where
122123
HsJSONPB.insOrdFromList
123124
[("namespace", kvNamespace), ("key", kvKey),
124125
("value", kvValue)]}})
125-
126+
126127
data KeyModification = KeyModification{keyModificationTxId ::
127128
Hs.Text,
128129
keyModificationValue :: Hs.ByteString,
129130
keyModificationTimestamp ::
130131
Hs.Maybe Google.Protobuf.Timestamp.Timestamp,
131132
keyModificationIsDelete :: Hs.Bool}
132133
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData)
133-
134+
134135
instance HsProtobuf.Named KeyModification where
135136
nameOf _ = (Hs.fromString "KeyModification")
136-
137+
137138
instance HsProtobuf.HasDefault KeyModification
138-
139+
139140
instance HsProtobuf.Message KeyModification where
140141
encodeMessage _
141142
KeyModification{keyModificationTxId = keyModificationTxId,
@@ -193,7 +194,7 @@ instance HsProtobuf.Message KeyModification where
193194
(HsProtobuf.Single "is_delete")
194195
[]
195196
"")]
196-
197+
197198
instance HsJSONPB.ToJSONPB KeyModification where
198199
toJSONPB (KeyModification f1 f2 f3 f4)
199200
= (HsJSONPB.object
@@ -203,22 +204,22 @@ instance HsJSONPB.ToJSONPB KeyModification where
203204
= (HsJSONPB.pairs
204205
["tx_id" .= f1, "value" .= f2, "timestamp" .= f3,
205206
"is_delete" .= f4])
206-
207+
207208
instance HsJSONPB.FromJSONPB KeyModification where
208209
parseJSONPB
209210
= (HsJSONPB.withObject "KeyModification"
210211
(\ obj ->
211212
(Hs.pure KeyModification) <*> obj .: "tx_id" <*> obj .: "value" <*>
212213
obj .: "timestamp"
213214
<*> obj .: "is_delete"))
214-
215+
215216
instance HsJSONPB.ToJSON KeyModification where
216217
toJSON = HsJSONPB.toAesonValue
217218
toEncoding = HsJSONPB.toAesonEncoding
218-
219+
219220
instance HsJSONPB.FromJSON KeyModification where
220221
parseJSON = HsJSONPB.parseJSONPB
221-
222+
222223
instance HsJSONPB.ToSchema KeyModification where
223224
declareNamedSchema _
224225
= do let declare_tx_id = HsJSONPB.declareSchemaRef
@@ -245,4 +246,4 @@ instance HsJSONPB.ToSchema KeyModification where
245246
[("tx_id", keyModificationTxId),
246247
("value", keyModificationValue),
247248
("timestamp", keyModificationTimestamp),
248-
("is_delete", keyModificationIsDelete)]}})
249+
("is_delete", keyModificationIsDelete)]}})

0 commit comments

Comments
 (0)