1515 } ,
1616 solana_sdk:: { instruction:: AccountMeta , pubkey:: Pubkey } ,
1717 spl_token_2022:: instruction:: { AuthorityType , MAX_SIGNERS , MIN_SIGNERS } ,
18- spl_token_client:: token:: ComputeUnitLimit ,
1918 std:: { fmt, str:: FromStr } ,
2019 strum:: IntoEnumIterator ,
2120 strum_macros:: { EnumIter , EnumString , IntoStaticStr } ,
@@ -74,10 +73,7 @@ pub const COMPUTE_UNIT_PRICE_ARG: ArgConstant<'static> = ArgConstant {
7473pub const COMPUTE_UNIT_LIMIT_ARG : ArgConstant < ' static > = ArgConstant {
7574 name : "compute_unit_limit" ,
7675 long : "--with-compute-unit-limit" ,
77- help : "Set compute unit limit for transaction, in compute units; also accepts \
78- keyword SIMULATED to use compute units from transaction simulation prior \
79- to sending. Note that SIMULATED may fail if accounts are modified by another \
80- transaction between simulation and execution.",
76+ help : "Set compute unit limit for transaction, in compute units." ,
8177} ;
8278
8379pub static VALID_TOKEN_PROGRAM_IDS : [ Pubkey ; 2 ] = [ spl_token_2022:: ID , spl_token:: ID ] ;
@@ -355,31 +351,6 @@ where
355351 }
356352}
357353
358- fn is_compute_unit_limit_or_simulated < T > ( string : T ) -> Result < ( ) , String >
359- where
360- T : AsRef < str > + fmt:: Display ,
361- {
362- if string. as_ref ( ) . parse :: < u32 > ( ) . is_ok ( ) || string. as_ref ( ) == "SIMULATED" {
363- Ok ( ( ) )
364- } else {
365- Err ( format ! (
366- "Unable to parse input compute unit limit as integer or SIMULATED, provided: {string}"
367- ) )
368- }
369- }
370- pub ( crate ) fn parse_compute_unit_limit < T > ( string : T ) -> Result < ComputeUnitLimit , String >
371- where
372- T : AsRef < str > + fmt:: Display ,
373- {
374- match string. as_ref ( ) . parse :: < u32 > ( ) {
375- Ok ( compute_unit_limit) => Ok ( ComputeUnitLimit :: Static ( compute_unit_limit) ) ,
376- Err ( _) if string. as_ref ( ) == "SIMULATED" => Ok ( ComputeUnitLimit :: Simulated ) ,
377- _ => Err ( format ! (
378- "Unable to parse compute unit limit, provided: {string}"
379- ) ) ,
380- }
381- }
382-
383354struct SignOnlyNeedsFullMintSpec { }
384355impl offline:: ArgsConfig for SignOnlyNeedsFullMintSpec {
385356 fn sign_only_arg < ' a , ' b > ( & self , arg : Arg < ' a , ' b > ) -> Arg < ' a , ' b > {
@@ -659,7 +630,7 @@ pub fn app<'a, 'b>(
659630 . takes_value ( true )
660631 . global ( true )
661632 . value_name ( "COMPUTE-UNIT-LIMIT" )
662- . validator ( is_compute_unit_limit_or_simulated )
633+ . validator ( is_parsable :: < u32 > )
663634 . help ( COMPUTE_UNIT_LIMIT_ARG . help )
664635 )
665636 . arg (
@@ -670,7 +641,6 @@ pub fn app<'a, 'b>(
670641 . value_name ( "COMPUTE-UNIT-PRICE" )
671642 . validator ( is_parsable :: < u64 > )
672643 . help ( COMPUTE_UNIT_PRICE_ARG . help )
673- . requires ( COMPUTE_UNIT_LIMIT_ARG . name )
674644 )
675645 . bench_subcommand ( )
676646 . subcommand ( SubCommand :: with_name ( CommandName :: CreateToken . into ( ) ) . about ( "Create a new token" )
0 commit comments