@@ -546,7 +546,9 @@ async fn run_check(wallet_address: Address, key_address: Address, rpc: RpcOpts)
546546
547547 // Expiry: show human-readable date and whether it's expired.
548548 let expiry_str = format_expiry ( info. expiry ) ;
549- if info. expiry != u64:: MAX {
549+ if info. expiry == u64:: MAX {
550+ sh_println ! ( "Expiry: {}" , expiry_str) ?;
551+ } else {
550552 let now = std:: time:: SystemTime :: now ( )
551553 . duration_since ( std:: time:: UNIX_EPOCH )
552554 . unwrap_or_default ( )
@@ -556,8 +558,6 @@ async fn run_check(wallet_address: Address, key_address: Address, rpc: RpcOpts)
556558 } else {
557559 sh_println ! ( "Expiry: {}" , expiry_str) ?;
558560 }
559- } else {
560- sh_println ! ( "Expiry: {}" , expiry_str) ?;
561561 }
562562
563563 sh_println ! ( "Spending Limits: {}" , if info. enforceLimits { "enforced" } else { "none" } ) ?;
@@ -579,7 +579,17 @@ async fn run_authorize(
579579) -> Result < ( ) > {
580580 let enforce = enforce_limits || !limits. is_empty ( ) ;
581581
582- let calldata = if !allowed_calls. is_empty ( ) {
582+ let calldata = if allowed_calls. is_empty ( ) {
583+ // Use the legacy authorizeKey when no scopes are needed.
584+ IAccountKeychain :: authorizeKeyCall {
585+ keyId : key_address,
586+ signatureType : key_type,
587+ expiry,
588+ enforceLimits : enforce,
589+ limits,
590+ }
591+ . abi_encode ( )
592+ } else {
583593 // Use the T3+ authorizeKey overload with KeyRestrictions when scopes are provided.
584594 let sig_type_u8 = match key_type {
585595 SignatureType :: Secp256k1 => 0u8 ,
@@ -603,16 +613,6 @@ async fn run_authorize(
603613 config : restrictions,
604614 }
605615 . abi_encode ( )
606- } else {
607- // Use the legacy authorizeKey when no scopes are needed.
608- IAccountKeychain :: authorizeKeyCall {
609- keyId : key_address,
610- signatureType : key_type,
611- expiry,
612- enforceLimits : enforce,
613- limits,
614- }
615- . abi_encode ( )
616616 } ;
617617
618618 send_keychain_tx ( calldata, tx_opts, & send_tx) . await
@@ -783,10 +783,10 @@ fn print_key_entry(entry: &tempo::KeyEntry) -> Result<()> {
783783 if let Some ( key_address) = entry. key_address {
784784 sh_println ! ( "Key Address: {key_address}" ) ?;
785785
786- if key_address != entry. wallet_address {
787- sh_println ! ( "Mode: keychain (access key)" ) ?;
788- } else {
786+ if key_address == entry. wallet_address {
789787 sh_println ! ( "Mode: direct (EOA)" ) ?;
788+ } else {
789+ sh_println ! ( "Mode: keychain (access key)" ) ?;
790790 }
791791 } else {
792792 sh_println ! ( "Key Address: (not set)" ) ?;
0 commit comments