@@ -38,7 +38,7 @@ pub(crate) struct Config<'a> {
38
38
pub ( crate ) output_format : OutputFormat ,
39
39
pub ( crate ) fee_payer : Option < Arc < dyn Signer > > ,
40
40
pub ( crate ) nonce_account : Option < Pubkey > ,
41
- pub ( crate ) nonce_authority : Option < Pubkey > ,
41
+ pub ( crate ) nonce_authority : Option < Arc < dyn Signer > > ,
42
42
pub ( crate ) sign_only : bool ,
43
43
pub ( crate ) dump_transaction_message : bool ,
44
44
pub ( crate ) multisigner_pubkeys : Vec < & ' a Pubkey > ,
@@ -98,6 +98,26 @@ impl<'a> Config<'a> {
98
98
. await
99
99
}
100
100
101
+ fn extract_multisig_signers (
102
+ matches : & ArgMatches < ' _ > ,
103
+ wallet_manager : & mut Option < Arc < RemoteWalletManager > > ,
104
+ bulk_signers : & mut Vec < Arc < dyn Signer > > ,
105
+ multisigner_ids : & ' a mut Vec < Pubkey > ,
106
+ ) -> Vec < & ' a Pubkey > {
107
+ let multisig_signers = signers_of ( matches, MULTISIG_SIGNER_ARG . name , wallet_manager)
108
+ . unwrap_or_else ( |e| {
109
+ eprintln ! ( "error: {}" , e) ;
110
+ exit ( 1 ) ;
111
+ } ) ;
112
+ if let Some ( mut multisig_signers) = multisig_signers {
113
+ multisig_signers. sort_by ( |( _, lp) , ( _, rp) | lp. cmp ( rp) ) ;
114
+ let ( signers, pubkeys) : ( Vec < _ > , Vec < _ > ) = multisig_signers. into_iter ( ) . unzip ( ) ;
115
+ bulk_signers. extend ( signers) ;
116
+ multisigner_ids. extend ( pubkeys) ;
117
+ }
118
+ multisigner_ids. iter ( ) . collect :: < Vec < _ > > ( )
119
+ }
120
+
101
121
pub ( crate ) async fn new_with_clients_and_ws_url (
102
122
matches : & ArgMatches < ' _ > ,
103
123
wallet_manager : & mut Option < Arc < RemoteWalletManager > > ,
@@ -117,18 +137,8 @@ impl<'a> Config<'a> {
117
137
} else {
118
138
solana_cli_config:: Config :: default ( )
119
139
} ;
120
- let multisig_signers = signers_of ( matches, MULTISIG_SIGNER_ARG . name , wallet_manager)
121
- . unwrap_or_else ( |e| {
122
- eprintln ! ( "error: {}" , e) ;
123
- exit ( 1 ) ;
124
- } ) ;
125
- if let Some ( mut multisig_signers) = multisig_signers {
126
- multisig_signers. sort_by ( |( _, lp) , ( _, rp) | lp. cmp ( rp) ) ;
127
- let ( signers, pubkeys) : ( Vec < _ > , Vec < _ > ) = multisig_signers. into_iter ( ) . unzip ( ) ;
128
- bulk_signers. extend ( signers) ;
129
- multisigner_ids. extend ( pubkeys) ;
130
- }
131
- let multisigner_pubkeys = multisigner_ids. iter ( ) . collect :: < Vec < _ > > ( ) ;
140
+ let multisigner_pubkeys =
141
+ Self :: extract_multisig_signers ( matches, wallet_manager, bulk_signers, multisigner_ids) ;
132
142
133
143
let config = SignerFromPathConfig {
134
144
allow_null_signer : !multisigner_pubkeys. is_empty ( ) ,
@@ -195,7 +205,7 @@ impl<'a> Config<'a> {
195
205
exit ( 1 ) ;
196
206
} ) ;
197
207
let nonce_authority = if nonce_account. is_some ( ) {
198
- let ( signer , nonce_authority ) = signer_from_path (
208
+ let ( nonce_authority , _ ) = signer_from_path (
199
209
matches,
200
210
matches
201
211
. value_of ( NONCE_AUTHORITY_ARG . name )
@@ -212,9 +222,6 @@ impl<'a> Config<'a> {
212
222
eprintln ! ( "error: {}" , e) ;
213
223
exit ( 1 ) ;
214
224
} ) ;
215
- if !bulk_signers. contains ( & signer) {
216
- bulk_signers. push ( signer) ;
217
- }
218
225
219
226
Some ( nonce_authority)
220
227
} else {
0 commit comments