@@ -8,9 +8,10 @@ use crate::{
8
8
StdResult ,
9
9
} ;
10
10
use serde:: { Deserialize , Serialize } ;
11
+ use std:: fmt:: { Debug , Formatter } ;
11
12
12
13
/// Signer with Stake Message
13
- #[ derive( Clone , Debug , PartialEq , Eq , Default , Serialize , Deserialize ) ]
14
+ #[ derive( Clone , PartialEq , Eq , Default , Serialize , Deserialize ) ]
14
15
pub struct SignerWithStakeMessagePart {
15
16
/// The unique identifier of the signer
16
17
// TODO: Should be removed once the signer certification is fully deployed
@@ -108,8 +109,35 @@ impl From<SignerWithStake> for SignerWithStakeMessagePart {
108
109
}
109
110
}
110
111
112
+ impl Debug for SignerMessagePart {
113
+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
114
+ let should_be_exhaustive = f. alternate ( ) ;
115
+ let mut debug = f. debug_struct ( "Signer" ) ;
116
+ debug. field ( "party_id" , & self . party_id ) ;
117
+
118
+ match should_be_exhaustive {
119
+ true => debug
120
+ . field (
121
+ "verification_key" ,
122
+ & format_args ! ( "{:?}" , self . verification_key) ,
123
+ )
124
+ . field (
125
+ "verification_key_signature" ,
126
+ & format_args ! ( "{:?}" , self . verification_key_signature) ,
127
+ )
128
+ . field (
129
+ "operational_certificate" ,
130
+ & format_args ! ( "{:?}" , self . operational_certificate) ,
131
+ )
132
+ . field ( "kes_period" , & format_args ! ( "{:?}" , self . kes_period) )
133
+ . finish ( ) ,
134
+ false => debug. finish_non_exhaustive ( ) ,
135
+ }
136
+ }
137
+ }
138
+
111
139
/// Signer Message
112
- #[ derive( Clone , Debug , PartialEq , Eq , Default , Serialize , Deserialize ) ]
140
+ #[ derive( Clone , PartialEq , Eq , Default , Serialize , Deserialize ) ]
113
141
pub struct SignerMessagePart {
114
142
/// The unique identifier of the signer
115
143
// TODO: Should be removed once the signer certification is fully deployed
@@ -153,3 +181,32 @@ impl SignerMessagePart {
153
181
}
154
182
}
155
183
}
184
+
185
+ impl Debug for SignerWithStakeMessagePart {
186
+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
187
+ let should_be_exhaustive = f. alternate ( ) ;
188
+ let mut debug = f. debug_struct ( "Signer" ) ;
189
+ debug
190
+ . field ( "party_id" , & self . party_id )
191
+ . field ( "stake" , & self . stake ) ;
192
+
193
+ match should_be_exhaustive {
194
+ true => debug
195
+ . field (
196
+ "verification_key" ,
197
+ & format_args ! ( "{:?}" , self . verification_key) ,
198
+ )
199
+ . field (
200
+ "verification_key_signature" ,
201
+ & format_args ! ( "{:?}" , self . verification_key_signature) ,
202
+ )
203
+ . field (
204
+ "operational_certificate" ,
205
+ & format_args ! ( "{:?}" , self . operational_certificate) ,
206
+ )
207
+ . field ( "kes_period" , & format_args ! ( "{:?}" , self . kes_period) )
208
+ . finish ( ) ,
209
+ false => debug. finish_non_exhaustive ( ) ,
210
+ }
211
+ }
212
+ }
0 commit comments