@@ -151,35 +151,7 @@ impl Signer for GcpSigner {
151
151
& self ,
152
152
message : & [ u8 ] ,
153
153
) -> Result < solana_sdk:: signature:: Signature , SignerError > {
154
- let ( client, key_name, message) =
155
- ( self . client . clone ( ) , self . key_name . clone ( ) , message. to_vec ( ) ) ;
156
-
157
- // match runtime
158
- let signature_result = if let Ok ( handle) = tokio:: runtime:: Handle :: try_current ( ) {
159
- match handle. runtime_flavor ( ) {
160
- tokio:: runtime:: RuntimeFlavor :: CurrentThread => std:: thread:: spawn ( move || {
161
- let rt = tokio:: runtime:: Runtime :: new ( ) . unwrap ( ) ;
162
- rt. block_on ( request_sign_data ( & client, & key_name, & message) )
163
- } )
164
- . join ( )
165
- . unwrap ( ) ,
166
- tokio:: runtime:: RuntimeFlavor :: MultiThread => tokio:: task:: block_in_place ( || {
167
- handle. block_on ( request_sign_data ( & client, & key_name, & message) )
168
- } ) ,
169
- _ => std:: thread:: spawn ( move || {
170
- tokio:: runtime:: Runtime :: new ( )
171
- . unwrap ( )
172
- . block_on ( request_sign_data ( & client, & key_name, & message) )
173
- } )
174
- . join ( )
175
- . unwrap ( ) ,
176
- }
177
- } else {
178
- let rt = tokio:: runtime:: Runtime :: new ( ) . unwrap ( ) ;
179
- rt. block_on ( request_sign_data ( & client, & key_name, & message) )
180
- } ;
181
-
182
- signature_result
154
+ futures:: executor:: block_on ( request_sign_data ( & self . client , & self . key_name , message) )
183
155
. and_then ( decode_signature)
184
156
. map_err ( Into :: into)
185
157
}
0 commit comments