@@ -14,7 +14,7 @@ use solana_clap_utils::{
14
14
is_amount, is_amount_or_all, is_parsable, is_url_or_moniker, is_valid_pubkey,
15
15
is_valid_signer, normalize_to_url_if_moniker,
16
16
} ,
17
- keypair:: { pubkey_from_path , signer_from_path, DefaultSigner } ,
17
+ keypair:: { signer_from_path, DefaultSigner , SignerFromPathConfig } ,
18
18
nonce:: * ,
19
19
offline:: { self , * } ,
20
20
ArgConstant ,
@@ -1915,32 +1915,19 @@ fn main() {
1915
1915
arg_name : default_signer_arg_name,
1916
1916
} ;
1917
1917
1918
- // Owner doesn't sign when using a mulitisig...
1919
- let owner = if matches. is_present ( MULTISIG_SIGNER_ARG . name )
1920
- || sub_command == "accounts" // when calling the `accounts` command...
1921
- || sub_command == "address" // when calling the `address` command...
1922
- || ( sub_command == "create-account" // or when creating an associated token account.
1923
- && !matches. is_present ( "account_keypair" ) )
1924
- {
1925
- let owner_val = matches
1926
- . value_of ( "owner" )
1927
- . unwrap_or ( & cli_config. keypair_path ) ;
1928
- pubkey_from_path ( & matches, owner_val, "owner" , & mut wallet_manager) . unwrap_or_else (
1929
- |e| {
1930
- eprintln ! ( "error: {}" , e) ;
1931
- exit ( 1 ) ;
1932
- } ,
1933
- )
1934
- } else {
1935
- bulk_signers. push ( None ) ;
1936
- default_signer
1937
- . signer_from_path ( & matches, & mut wallet_manager)
1918
+ let ( owner, signer) = {
1919
+ let config = SignerFromPathConfig {
1920
+ allow_null_signer : true ,
1921
+ } ;
1922
+ let owner = default_signer
1923
+ . signer_from_path_with_config ( & matches, & mut wallet_manager, & config)
1938
1924
. unwrap_or_else ( |e| {
1939
1925
eprintln ! ( "error: {}" , e) ;
1940
1926
exit ( 1 ) ;
1941
- } )
1942
- . pubkey ( )
1927
+ } ) ;
1928
+ ( owner . pubkey ( ) , Some ( owner ) )
1943
1929
} ;
1930
+ bulk_signers. push ( signer) ;
1944
1931
1945
1932
let ( signer, fee_payer) = signer_from_path (
1946
1933
& matches,
@@ -2306,13 +2293,14 @@ fn main() {
2306
2293
) ?;
2307
2294
}
2308
2295
2296
+ let signers = signer_info. signers_for_message ( & message) ;
2309
2297
let mut transaction = Transaction :: new_unsigned ( message) ;
2310
2298
2311
2299
if config. sign_only {
2312
- transaction. try_partial_sign ( & signer_info . signers , recent_blockhash) ?;
2300
+ transaction. try_partial_sign ( & signers, recent_blockhash) ?;
2313
2301
println ! ( "{}" , return_signers( & transaction, & OutputFormat :: Display ) ?) ;
2314
2302
} else {
2315
- transaction. try_sign ( & signer_info . signers , recent_blockhash) ?;
2303
+ transaction. try_sign ( & signers, recent_blockhash) ?;
2316
2304
let signature = if no_wait {
2317
2305
config. rpc_client . send_transaction ( & transaction) ?
2318
2306
} else {
0 commit comments