This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -300,10 +300,13 @@ impl<'a> Config<'a> {
300300 ( default_program_id, false )
301301 } ;
302302
303- // need to specify a compute limit if compute price and blockhash are specified
304- if matches. is_present ( BLOCKHASH_ARG . name )
305- && matches. is_present ( COMPUTE_UNIT_PRICE_ARG . name )
306- && !matches. is_present ( COMPUTE_UNIT_LIMIT_ARG . name )
303+ if matches. try_contains_id ( BLOCKHASH_ARG . name ) . unwrap_or ( false )
304+ && matches
305+ . try_contains_id ( COMPUTE_UNIT_PRICE_ARG . name )
306+ . unwrap_or ( false )
307+ && !matches
308+ . try_contains_id ( COMPUTE_UNIT_LIMIT_ARG . name )
309+ . unwrap_or ( false )
307310 {
308311 clap:: Error :: with_description (
309312 format ! (
@@ -321,8 +324,17 @@ impl<'a> Config<'a> {
321324 . flatten ( )
322325 . copied ( ) ;
323326
324- let compute_unit_price = value_of ( matches, COMPUTE_UNIT_PRICE_ARG . name ) ;
325- let compute_unit_limit = value_of ( matches, COMPUTE_UNIT_LIMIT_ARG . name )
327+ let compute_unit_price = matches
328+ . try_get_one :: < u64 > ( COMPUTE_UNIT_PRICE_ARG . name )
329+ . ok ( )
330+ . flatten ( )
331+ . copied ( ) ;
332+
333+ let compute_unit_limit = matches
334+ . try_get_one :: < u32 > ( COMPUTE_UNIT_PRICE_ARG . name )
335+ . ok ( )
336+ . flatten ( )
337+ . copied ( )
326338 . map ( ComputeUnitLimit :: Static )
327339 . unwrap_or_else ( || {
328340 if nonce_blockhash. is_some ( ) {
You can’t perform that action at this time.
0 commit comments