From 2ab38e1330949114706554834ff9088a77e0ed45 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Mon, 4 Sep 2023 17:50:30 +0200 Subject: [PATCH] Alternative print for underflow --- cli/src/command/account.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cli/src/command/account.rs b/cli/src/command/account.rs index f5e4fef394..bdad6e01fa 100644 --- a/cli/src/command/account.rs +++ b/cli/src/command/account.rs @@ -384,8 +384,15 @@ pub async fn claimable_outputs_command(account: &Account) -> Result<(), Error> { if let Some(expiration) = unlock_conditions.expiration() { let slot_index = account.client().get_slot_index().await?; - let slot_indices_left = *expiration.slot_index() - *slot_index; - println_log_info!(" - expires in: {} slot indices", slot_indices_left); + + if *expiration.slot_index() > *slot_index { + println_log_info!(" - expires in {} slot indices", *expiration.slot_index() - *slot_index); + } else { + println_log_info!( + " - expired {} slot indices ago", + *slot_index - *expiration.slot_index() + ); + } } } }