File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ use anyhow:: Context ;
1
2
use async_trait:: async_trait;
2
3
use slog_scope:: { debug, warn} ;
3
4
use std:: sync:: Arc ;
@@ -457,6 +458,7 @@ impl MultiSigner for MultiSignerImpl {
457
458
458
459
protocol_multi_signer
459
460
. verify_single_signature ( message, single_signature)
461
+ . with_context ( || "Multi Signer can not verify multi-signature" )
460
462
. map_err ( |error| ProtocolError :: Core ( error. to_string ( ) ) )
461
463
}
462
464
Original file line number Diff line number Diff line change
1
+ use anyhow:: Context ;
1
2
use hex:: ToHex ;
2
3
use slog_scope:: { info, trace, warn} ;
3
4
use std:: path:: PathBuf ;
@@ -102,8 +103,20 @@ impl SingleSigner for MithrilSingleSigner {
102
103
info ! ( "Signing protocol message" ; "protocol_message" => #?protocol_message, "signed message" => protocol_message. compute_hash( ) . encode_hex:: <String >( ) ) ;
103
104
let signatures = builder
104
105
. restore_signer_from_initializer ( self . party_id . clone ( ) , protocol_initializer. clone ( ) )
106
+ . with_context ( || {
107
+ format ! (
108
+ "Mithril Single Signer can not restore signer with party_id: '{}'" ,
109
+ self . party_id. clone( )
110
+ )
111
+ } )
105
112
. map_err ( |e| SingleSignerError :: ProtocolSignerCreationFailure ( e. to_string ( ) ) ) ?
106
113
. sign ( protocol_message)
114
+ . with_context ( || {
115
+ format ! (
116
+ "Mithril Single Signer can not sign protocol_message: '{:?}'" ,
117
+ protocol_message
118
+ )
119
+ } )
107
120
. map_err ( SingleSignerError :: SignatureFailed ) ?;
108
121
109
122
match & signatures {
You can’t perform that action at this time.
0 commit comments