@@ -108,22 +108,27 @@ impl CertifierService for MithrilCertifierService {
108108 ) -> StdResult < SignatureRegistrationStatus > {
109109 debug ! (
110110 self . logger,
111- ">> register_single_signature(signed_entity_type: {signed_entity_type:?}, single_signatures : {signature:?}"
111+ ">> register_single_signature(signed_entity_type: {signed_entity_type:?}, single_signature : {signature:?}"
112112 ) ;
113- trace ! ( self . logger, ">> register_single_signature" ; "complete_single_signatures " => #?signature) ;
113+ trace ! ( self . logger, ">> register_single_signature" ; "complete_single_signature " => #?signature) ;
114114
115115 let open_message = self
116116 . get_open_message_record ( signed_entity_type)
117- . await . with_context ( || format ! ( "CertifierService can not get open message record for signed_entity_type: '{signed_entity_type}'" ) ) ?
117+ . await
118+ . with_context ( || format ! ( "CertifierService can not get open message record for signed_entity_type: '{signed_entity_type}'" ) ) ?
118119 . ok_or_else ( || {
119- warn ! ( self . logger, "register_single_signature: OpenMessage not found for type {signed_entity_type:?}." ) ;
120+ warn ! (
121+ self . logger, "register_single_signature: OpenMessage not found for type {signed_entity_type:?}" ;
122+ "party_id" => & signature. party_id
123+ ) ;
120124 CertifierServiceError :: NotFound ( signed_entity_type. clone ( ) )
121125 } ) ?;
122126
123127 if open_message. is_certified {
124128 warn ! (
125129 self . logger,
126- "register_single_signature: open message {signed_entity_type:?} is already certified, cannot register single signature."
130+ "register_single_signature: open message {signed_entity_type:?} is already certified, cannot register single signature." ;
131+ "party_id" => & signature. party_id
127132 ) ;
128133
129134 return Err ( CertifierServiceError :: AlreadyCertified ( signed_entity_type. clone ( ) ) . into ( ) ) ;
@@ -132,7 +137,8 @@ impl CertifierService for MithrilCertifierService {
132137 if open_message. is_expired {
133138 warn ! (
134139 self . logger,
135- "register_single_signature: open message {signed_entity_type:?} has expired, cannot register single signature."
140+ "register_single_signature: open message {signed_entity_type:?} has expired, cannot register single signature." ;
141+ "party_id" => & signature. party_id
136142 ) ;
137143
138144 return Err ( CertifierServiceError :: Expired ( signed_entity_type. clone ( ) ) . into ( ) ) ;
@@ -142,13 +148,18 @@ impl CertifierService for MithrilCertifierService {
142148 . verify_single_signature ( & open_message. protocol_message . to_message ( ) , signature)
143149 . await
144150 . map_err ( |err| {
145- CertifierServiceError :: InvalidSingleSignature ( signed_entity_type. clone ( ) , err)
151+ CertifierServiceError :: InvalidSingleSignature (
152+ signed_entity_type. clone ( ) ,
153+ signature. party_id . clone ( ) ,
154+ err,
155+ )
146156 } ) ?;
147157
148158 let single_signature = self
149159 . single_signature_repository
150160 . create_single_signature ( signature, & open_message. clone ( ) . into ( ) )
151- . await . with_context ( || format ! ( "Certifier can not create the single signature from single_signature: '{signature:?}', open_message: '{open_message:?}'" ) ) ?;
161+ . await
162+ . with_context ( || format ! ( "Certifier can not create the single signature from single_signature: '{signature:?}', open_message: '{open_message:?}'" ) ) ?;
152163 info ! (
153164 self . logger,
154165 "register_single_signature: created pool '{}' single signature for {signed_entity_type:?}." ,
@@ -826,7 +837,7 @@ mod tests {
826837 if let Some ( err) = error. downcast_ref :: < CertifierServiceError > ( ) {
827838 assert ! ( matches!(
828839 err,
829- CertifierServiceError :: AlreadyCertified ( signed_entity) if signed_entity == & signed_entity_type
840+ CertifierServiceError :: AlreadyCertified ( signed_entity, .. ) if signed_entity == & signed_entity_type
830841 ) , ) ;
831842 } else {
832843 panic ! ( "Unexpected error {error:?}" ) ;
0 commit comments