@@ -25,7 +25,20 @@ pub const CONSENSUS_HEIGHTS_ATTRIBUTE_KEY: &str = "consensus_heights";
25
25
/// The content of the `key` field for the header in update client event.
26
26
pub const HEADER_ATTRIBUTE_KEY : & str = "header" ;
27
27
28
- #[ derive( Debug , From ) ]
28
+ #[ cfg_attr(
29
+ feature = "parity-scale-codec" ,
30
+ derive(
31
+ parity_scale_codec:: Encode ,
32
+ parity_scale_codec:: Decode ,
33
+ scale_info:: TypeInfo
34
+ )
35
+ ) ]
36
+ #[ cfg_attr(
37
+ feature = "borsh" ,
38
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
39
+ ) ]
40
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
41
+ #[ derive( Clone , Debug , From , PartialEq , Eq ) ]
29
42
struct ClientIdAttribute {
30
43
client_id : ClientId ,
31
44
}
@@ -36,7 +49,20 @@ impl From<ClientIdAttribute> for abci::EventAttribute {
36
49
}
37
50
}
38
51
39
- #[ derive( Debug , From ) ]
52
+ #[ cfg_attr(
53
+ feature = "parity-scale-codec" ,
54
+ derive(
55
+ parity_scale_codec:: Encode ,
56
+ parity_scale_codec:: Decode ,
57
+ scale_info:: TypeInfo
58
+ )
59
+ ) ]
60
+ #[ cfg_attr(
61
+ feature = "borsh" ,
62
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
63
+ ) ]
64
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
65
+ #[ derive( Clone , Debug , From , PartialEq , Eq ) ]
40
66
struct ClientTypeAttribute {
41
67
client_type : ClientType ,
42
68
}
@@ -47,7 +73,20 @@ impl From<ClientTypeAttribute> for abci::EventAttribute {
47
73
}
48
74
}
49
75
50
- #[ derive( Debug , From ) ]
76
+ #[ cfg_attr(
77
+ feature = "parity-scale-codec" ,
78
+ derive(
79
+ parity_scale_codec:: Encode ,
80
+ parity_scale_codec:: Decode ,
81
+ scale_info:: TypeInfo
82
+ )
83
+ ) ]
84
+ #[ cfg_attr(
85
+ feature = "borsh" ,
86
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
87
+ ) ]
88
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
89
+ #[ derive( Clone , Debug , From , PartialEq , Eq ) ]
51
90
struct ConsensusHeightAttribute {
52
91
consensus_height : Height ,
53
92
}
@@ -58,7 +97,20 @@ impl From<ConsensusHeightAttribute> for abci::EventAttribute {
58
97
}
59
98
}
60
99
61
- #[ derive( Debug , From ) ]
100
+ #[ cfg_attr(
101
+ feature = "parity-scale-codec" ,
102
+ derive(
103
+ parity_scale_codec:: Encode ,
104
+ parity_scale_codec:: Decode ,
105
+ scale_info:: TypeInfo
106
+ )
107
+ ) ]
108
+ #[ cfg_attr(
109
+ feature = "borsh" ,
110
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
111
+ ) ]
112
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
113
+ #[ derive( Clone , Debug , From , PartialEq , Eq ) ]
62
114
struct ConsensusHeightsAttribute {
63
115
consensus_heights : Vec < Height > ,
64
116
}
@@ -74,7 +126,20 @@ impl From<ConsensusHeightsAttribute> for abci::EventAttribute {
74
126
}
75
127
}
76
128
77
- #[ derive( Debug , From ) ]
129
+ #[ cfg_attr(
130
+ feature = "parity-scale-codec" ,
131
+ derive(
132
+ parity_scale_codec:: Encode ,
133
+ parity_scale_codec:: Decode ,
134
+ scale_info:: TypeInfo
135
+ )
136
+ ) ]
137
+ #[ cfg_attr(
138
+ feature = "borsh" ,
139
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
140
+ ) ]
141
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
142
+ #[ derive( Clone , Debug , From , PartialEq , Eq ) ]
78
143
struct HeaderAttribute {
79
144
header : Any ,
80
145
}
@@ -90,7 +155,20 @@ impl From<HeaderAttribute> for abci::EventAttribute {
90
155
}
91
156
92
157
/// CreateClient event signals the creation of a new on-chain client (IBC client).
93
- #[ derive( Debug ) ]
158
+ #[ cfg_attr(
159
+ feature = "parity-scale-codec" ,
160
+ derive(
161
+ parity_scale_codec:: Encode ,
162
+ parity_scale_codec:: Decode ,
163
+ scale_info:: TypeInfo
164
+ )
165
+ ) ]
166
+ #[ cfg_attr(
167
+ feature = "borsh" ,
168
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
169
+ ) ]
170
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
171
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
94
172
pub struct CreateClient {
95
173
client_id : ClientIdAttribute ,
96
174
client_type : ClientTypeAttribute ,
@@ -133,7 +211,20 @@ impl From<CreateClient> for abci::Event {
133
211
}
134
212
135
213
/// UpdateClient event signals a recent update of an on-chain client (IBC Client).
136
- #[ derive( Debug ) ]
214
+ #[ cfg_attr(
215
+ feature = "parity-scale-codec" ,
216
+ derive(
217
+ parity_scale_codec:: Encode ,
218
+ parity_scale_codec:: Decode ,
219
+ scale_info:: TypeInfo
220
+ )
221
+ ) ]
222
+ #[ cfg_attr(
223
+ feature = "borsh" ,
224
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
225
+ ) ]
226
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
227
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
137
228
pub struct UpdateClient {
138
229
client_id : ClientIdAttribute ,
139
230
client_type : ClientTypeAttribute ,
@@ -199,7 +290,20 @@ impl From<UpdateClient> for abci::Event {
199
290
200
291
/// ClientMisbehaviour event signals the update of an on-chain client (IBC Client) with evidence of
201
292
/// misbehaviour.
202
- #[ derive( Debug ) ]
293
+ #[ cfg_attr(
294
+ feature = "parity-scale-codec" ,
295
+ derive(
296
+ parity_scale_codec:: Encode ,
297
+ parity_scale_codec:: Decode ,
298
+ scale_info:: TypeInfo
299
+ )
300
+ ) ]
301
+ #[ cfg_attr(
302
+ feature = "borsh" ,
303
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
304
+ ) ]
305
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
306
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
203
307
pub struct ClientMisbehaviour {
204
308
client_id : ClientIdAttribute ,
205
309
client_type : ClientTypeAttribute ,
@@ -232,7 +336,20 @@ impl From<ClientMisbehaviour> for abci::Event {
232
336
}
233
337
234
338
/// Signals a recent upgrade of an on-chain client (IBC Client).
235
- #[ derive( Debug ) ]
339
+ #[ cfg_attr(
340
+ feature = "parity-scale-codec" ,
341
+ derive(
342
+ parity_scale_codec:: Encode ,
343
+ parity_scale_codec:: Decode ,
344
+ scale_info:: TypeInfo
345
+ )
346
+ ) ]
347
+ #[ cfg_attr(
348
+ feature = "borsh" ,
349
+ derive( borsh:: BorshSerialize , borsh:: BorshDeserialize )
350
+ ) ]
351
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
352
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
236
353
pub struct UpgradeClient {
237
354
client_id : ClientIdAttribute ,
238
355
client_type : ClientTypeAttribute ,
0 commit comments