@@ -27,16 +27,17 @@ import Network.TypedProtocol.Codec.CBOR
27
27
import Ouroboros.Network.Protocol.Limits
28
28
import Ouroboros.Network.Protocol.ObjectDiffusion.Type
29
29
import Text.Printf
30
+ import Network.TypedProtocol (Agency )
30
31
31
32
-- | Byte Limits.
32
33
byteLimitsObjectDiffusion ::
33
- forall bytes objectId object .
34
+ forall bytes ( initAgency :: Agency ) objectId object .
34
35
(bytes -> Word ) ->
35
- ProtocolSizeLimits (ObjectDiffusion objectId object ) bytes
36
+ ProtocolSizeLimits (ObjectDiffusion initAgency objectId object ) bytes
36
37
byteLimitsObjectDiffusion = ProtocolSizeLimits stateToLimit
37
38
where
38
39
stateToLimit ::
39
- forall (st :: ObjectDiffusion objectId object ).
40
+ forall (st :: ObjectDiffusion initAgency objectId object ).
40
41
(ActiveState st ) =>
41
42
StateToken st ->
42
43
Word
@@ -62,11 +63,11 @@ byteLimitsObjectDiffusion = ProtocolSizeLimits stateToLimit
62
63
-- +---------------------------------+---------------+
63
64
-- | `StObjects` | `shortWait` |
64
65
-- +---------------------------------+---------------+
65
- timeLimitsObjectDiffusion :: forall (objectId :: Type ) (object :: Type ). ProtocolTimeLimits (ObjectDiffusion objectId object )
66
+ timeLimitsObjectDiffusion :: forall (initAgency :: Agency ) ( objectId :: Type ) (object :: Type ). ProtocolTimeLimits (ObjectDiffusion initAgency objectId object )
66
67
timeLimitsObjectDiffusion = ProtocolTimeLimits stateToLimit
67
68
where
68
69
stateToLimit ::
69
- forall (st :: ObjectDiffusion objectId object ).
70
+ forall (st :: ObjectDiffusion initAgency objectId object ).
70
71
(ActiveState st ) =>
71
72
StateToken st ->
72
73
Maybe DiffTime
@@ -78,7 +79,7 @@ timeLimitsObjectDiffusion = ProtocolTimeLimits stateToLimit
78
79
stateToLimit a@ SingDone = notActiveState a
79
80
80
81
codecObjectDiffusion ::
81
- forall (objectId :: Type ) (object :: Type ) m .
82
+ forall (initAgency :: Agency ) ( objectId :: Type ) (object :: Type ) m .
82
83
(MonadST m ) =>
83
84
-- | encode 'objectId'
84
85
(objectId -> CBOR. Encoding ) ->
@@ -88,14 +89,14 @@ codecObjectDiffusion ::
88
89
(object -> CBOR. Encoding ) ->
89
90
-- | decode object
90
91
(forall s . CBOR. Decoder s object ) ->
91
- Codec (ObjectDiffusion objectId object ) CBOR. DeserialiseFailure m ByteString
92
+ Codec (ObjectDiffusion initAgency objectId object ) CBOR. DeserialiseFailure m ByteString
92
93
codecObjectDiffusion encodeObjectId decodeObjectId encodeObject decodeObject =
93
94
mkCodecCborLazyBS
94
95
(encodeObjectDiffusion encodeObjectId encodeObject)
95
96
decode
96
97
where
97
98
decode ::
98
- forall (st :: ObjectDiffusion objectId object ).
99
+ forall (st :: ObjectDiffusion initAgency objectId object ).
99
100
(ActiveState st ) =>
100
101
StateToken st ->
101
102
forall s . CBOR. Decoder s (SomeMessage st )
@@ -105,18 +106,18 @@ codecObjectDiffusion encodeObjectId decodeObjectId encodeObject decodeObject =
105
106
decodeObjectDiffusion decodeObjectId decodeObject stok len key
106
107
107
108
encodeObjectDiffusion ::
108
- forall (objectId :: Type ) (object :: Type ) (st :: ObjectDiffusion objectId object ) (st' :: ObjectDiffusion objectId object ).
109
+ forall (initAgency :: Agency ) ( objectId :: Type ) (object :: Type ) (st :: ObjectDiffusion initAgency objectId object ) (st' :: ObjectDiffusion initAgency objectId object ).
109
110
-- | encode 'objectId'
110
111
(objectId -> CBOR. Encoding ) ->
111
112
-- | encode 'object'
112
113
(object -> CBOR. Encoding ) ->
113
- Message (ObjectDiffusion objectId object ) st st' ->
114
+ Message (ObjectDiffusion initAgency objectId object ) st st' ->
114
115
CBOR. Encoding
115
116
encodeObjectDiffusion encodeObjectId encodeObject = encode
116
117
where
117
118
encode ::
118
119
forall st0 st1 .
119
- Message (ObjectDiffusion objectId object ) st0 st1 ->
120
+ Message (ObjectDiffusion initAgency objectId object ) st0 st1 ->
120
121
CBOR. Encoding
121
122
encode MsgInit =
122
123
CBOR. encodeListLen 1
@@ -164,7 +165,7 @@ encodeObjectDiffusion encodeObjectId encodeObject = encode
164
165
<> CBOR. encodeWord 4
165
166
166
167
decodeObjectDiffusion ::
167
- forall (objectId :: Type ) (object :: Type ) (st :: ObjectDiffusion objectId object ) s .
168
+ forall (initAgency :: Agency ) ( objectId :: Type ) (object :: Type ) (st :: ObjectDiffusion initAgency objectId object ) s .
168
169
(ActiveState st ) =>
169
170
-- | decode 'objectId'
170
171
(forall s' . CBOR. Decoder s' objectId ) ->
@@ -177,7 +178,7 @@ decodeObjectDiffusion ::
177
178
decodeObjectDiffusion decodeObjectId decodeObject = decode
178
179
where
179
180
decode ::
180
- forall (st' :: ObjectDiffusion objectId object ).
181
+ forall (st' :: ObjectDiffusion initAgency objectId object ).
181
182
(ActiveState st' ) =>
182
183
StateToken st' ->
183
184
Int ->
@@ -243,26 +244,26 @@ decodeObjectDiffusion decodeObjectId decodeObject = decode
243
244
fail (printf " codecObjectDiffusion (%s) unexpected key (%d, %d)" (show stok) key len)
244
245
245
246
codecObjectDiffusionId ::
246
- forall objectId object m .
247
+ forall ( initAgency :: Agency ) objectId object m .
247
248
(Monad m ) =>
248
- Codec (ObjectDiffusion objectId object ) CodecFailure m (AnyMessage (ObjectDiffusion objectId object ))
249
+ Codec (ObjectDiffusion initAgency objectId object ) CodecFailure m (AnyMessage (ObjectDiffusion initAgency objectId object ))
249
250
codecObjectDiffusionId = Codec {encode, decode}
250
251
where
251
252
encode ::
252
253
forall st st' .
253
254
(ActiveState st ) =>
254
255
(StateTokenI st ) =>
255
- Message (ObjectDiffusion objectId object ) st st' ->
256
- AnyMessage (ObjectDiffusion objectId object )
256
+ Message (ObjectDiffusion initAgency objectId object ) st st' ->
257
+ AnyMessage (ObjectDiffusion initAgency objectId object )
257
258
encode = AnyMessage
258
259
259
260
decode ::
260
- forall (st :: ObjectDiffusion objectId object ).
261
+ forall (st :: ObjectDiffusion initAgency objectId object ).
261
262
(ActiveState st ) =>
262
263
StateToken st ->
263
264
m
264
265
( DecodeStep
265
- (AnyMessage (ObjectDiffusion objectId object ))
266
+ (AnyMessage (ObjectDiffusion initAgency objectId object ))
266
267
CodecFailure
267
268
m
268
269
(SomeMessage st )
0 commit comments