@@ -35,7 +35,7 @@ use solana_sdk::{
35
35
program_pack:: Pack ,
36
36
pubkey:: Pubkey ,
37
37
signature:: { Keypair , Signer } ,
38
- system_instruction , system_program,
38
+ system_program,
39
39
transaction:: Transaction ,
40
40
} ;
41
41
use spl_associated_token_account:: {
@@ -47,7 +47,7 @@ use spl_token_2022::{
47
47
mint_close_authority:: MintCloseAuthority , ExtensionType , StateWithExtensionsOwned ,
48
48
} ,
49
49
instruction:: * ,
50
- state:: { Account , Mint , Multisig } ,
50
+ state:: { Account , Mint } ,
51
51
} ;
52
52
use spl_token_client:: {
53
53
client:: { ProgramRpcClientSendTransaction , RpcClientResponse } ,
@@ -390,7 +390,13 @@ async fn command_create_token(
390
390
rate_bps : Option < i16 > ,
391
391
bulk_signers : Vec < Arc < dyn Signer > > ,
392
392
) -> CommandResult {
393
- println_display ( config, format ! ( "Creating token {}" , token_pubkey) ) ;
393
+ println_display (
394
+ config,
395
+ format ! (
396
+ "Creating token {} under program {}" ,
397
+ token_pubkey, config. program_id
398
+ ) ,
399
+ ) ;
394
400
395
401
let token = token_client_from_config ( config, & token_pubkey) ;
396
402
@@ -574,56 +580,33 @@ async fn command_create_account(
574
580
575
581
async fn command_create_multisig (
576
582
config : & Config < ' _ > ,
577
- multisig : Pubkey ,
583
+ multisig : Arc < dyn Signer > ,
578
584
minimum_signers : u8 ,
579
585
multisig_members : Vec < Pubkey > ,
580
- bulk_signers : BulkSigners ,
581
586
) -> CommandResult {
582
587
println_display (
583
588
config,
584
589
format ! (
585
- "Creating {}/{} multisig {}" ,
590
+ "Creating {}/{} multisig {} under program {} " ,
586
591
minimum_signers,
587
592
multisig_members. len( ) ,
588
- multisig
593
+ multisig. pubkey( ) ,
594
+ config. program_id,
589
595
) ,
590
596
) ;
591
597
592
- let minimum_balance_for_rent_exemption = if !config. sign_only {
593
- config
594
- . program_client
595
- . get_minimum_balance_for_rent_exemption ( Multisig :: LEN )
596
- . await ?
597
- } else {
598
- 0
599
- } ;
598
+ // default is safe here because create_multisig doesnt use it
599
+ let token = token_client_from_config ( config, & Pubkey :: default ( ) ) ;
600
600
601
- let instructions = vec ! [
602
- system_instruction:: create_account(
603
- & config. fee_payer. pubkey( ) ,
604
- & multisig,
605
- minimum_balance_for_rent_exemption,
606
- Multisig :: LEN as u64 ,
607
- & config. program_id,
608
- ) ,
609
- initialize_multisig(
610
- & config. program_id,
611
- & multisig,
612
- multisig_members. iter( ) . collect:: <Vec <_>>( ) . as_slice( ) ,
601
+ let res = token
602
+ . create_multisig (
603
+ & * multisig,
604
+ & multisig_members. iter ( ) . collect :: < Vec < _ > > ( ) ,
613
605
minimum_signers,
614
- ) ? ,
615
- ] ;
606
+ )
607
+ . await ? ;
616
608
617
- let tx_return = handle_tx (
618
- & CliSignerInfo {
619
- signers : bulk_signers,
620
- } ,
621
- config,
622
- false ,
623
- minimum_balance_for_rent_exemption,
624
- instructions,
625
- )
626
- . await ?;
609
+ let tx_return = finish_tx ( config, & res, false ) . await ?;
627
610
Ok ( match tx_return {
628
611
TransactionReturnData :: CliSignature ( signature) => {
629
612
config. output_format . formatted_string ( & signature)
@@ -3063,20 +3046,10 @@ async fn process_command<'a>(
3063
3046
exit ( 1 ) ;
3064
3047
}
3065
3048
3066
- let ( signer, account ) = get_signer ( arg_matches, "address_keypair" , & mut wallet_manager)
3049
+ let ( signer, _ ) = get_signer ( arg_matches, "address_keypair" , & mut wallet_manager)
3067
3050
. unwrap_or_else ( new_throwaway_signer) ;
3068
- if !bulk_signers. contains ( & signer) {
3069
- bulk_signers. push ( signer) ;
3070
- }
3071
3051
3072
- command_create_multisig (
3073
- config,
3074
- account,
3075
- minimum_signers,
3076
- multisig_members,
3077
- bulk_signers,
3078
- )
3079
- . await
3052
+ command_create_multisig ( config, signer, minimum_signers, multisig_members) . await
3080
3053
}
3081
3054
( CommandName :: Authorize , arg_matches) => {
3082
3055
let address = pubkey_of_signer ( arg_matches, "address" , & mut wallet_manager)
0 commit comments