@@ -17,14 +17,16 @@ use {
1717 solana_transaction:: Transaction ,
1818 solana_vote_program:: { self as vote_program, vote_state:: VoteState } ,
1919 spl_single_pool:: {
20- self , find_default_deposit_account_address, find_pool_address, find_pool_mint_address,
21- find_pool_onramp_address, find_pool_stake_address, instruction:: SinglePoolInstruction ,
22- state:: SinglePool ,
20+ self , find_pool_address, find_pool_mint_address, find_pool_onramp_address,
21+ find_pool_stake_address, instruction:: SinglePoolInstruction , state:: SinglePool ,
2322 } ,
2423 spl_token_client:: token:: Token ,
2524 std:: { rc:: Rc , sync:: Arc } ,
2625} ;
2726
27+ #[ allow( deprecated) ]
28+ use spl_single_pool:: find_default_deposit_account_address;
29+
2830mod config;
2931use config:: * ;
3032
@@ -247,15 +249,21 @@ async fn command_deposit(
247249 } ) ;
248250
249251 // from there we can determine the stake account address
250- let stake_account_address =
251- if let Some ( stake_account_address) = command_config. stake_account_address {
252- stake_account_address
253- } else if let Some ( pool_address) = provided_pool_address {
254- assert ! ( command_config. default_stake_account) ;
255- find_default_deposit_account_address ( & pool_address, & stake_authority. pubkey ( ) )
256- } else {
257- unreachable ! ( )
258- } ;
252+ let stake_account_address = if let Some ( stake_account_address) =
253+ command_config. stake_account_address
254+ {
255+ stake_account_address
256+ } else if let Some ( pool_address) = provided_pool_address {
257+ assert ! ( command_config. default_stake_account) ;
258+ eprintln_display (
259+ config,
260+ "WARNING: This flag is DEPRECATED and will be removed in a future release." . to_string ( ) ,
261+ ) ;
262+ #[ allow( deprecated) ]
263+ find_default_deposit_account_address ( & pool_address, & stake_authority. pubkey ( ) )
264+ } else {
265+ unreachable ! ( )
266+ } ;
259267
260268 // now we validate the stake account and definitively resolve the pool address
261269 let ( pool_address, user_stake_active) = if let Some ( ( meta, stake) ) =
@@ -702,6 +710,11 @@ async fn command_update_metadata(
702710
703711// create default stake account
704712async fn command_create_stake ( config : & Config , command_config : CreateStakeCli ) -> CommandResult {
713+ eprintln_display (
714+ config,
715+ "WARNING: This command is DEPRECATED and will be removed in a future release." . to_string ( ) ,
716+ ) ;
717+
705718 let payer = config. fee_payer ( ) ?;
706719 let owner = config. default_signer ( ) ?;
707720 let stake_authority_address = command_config
@@ -713,6 +726,10 @@ async fn command_create_stake(config: &Config, command_config: CreateStakeCli) -
713726 command_config. vote_account_address ,
714727 ) ;
715728
729+ #[ allow( deprecated) ]
730+ let stake_account_address =
731+ find_default_deposit_account_address ( & pool_address, & stake_authority_address) ;
732+
716733 println_display (
717734 config,
718735 format ! ( "Creating default stake account for pool {}\n " , pool_address) ,
@@ -744,6 +761,7 @@ async fn command_create_stake(config: &Config, command_config: CreateStakeCli) -
744761 ) ;
745762 }
746763
764+ #[ allow( deprecated) ]
747765 let instructions = spl_single_pool:: instruction:: create_and_delegate_user_stake (
748766 & spl_single_pool:: id ( ) ,
749767 & vote_account_address,
@@ -766,10 +784,7 @@ async fn command_create_stake(config: &Config, command_config: CreateStakeCli) -
766784 "CreateDefaultStake" . to_string ( ) ,
767785 CreateStakeOutput {
768786 pool_address,
769- stake_account_address : find_default_deposit_account_address (
770- & pool_address,
771- & stake_authority_address,
772- ) ,
787+ stake_account_address,
773788 signature,
774789 } ,
775790 ) )
0 commit comments