Skip to content

Commit

Permalink
Alternative print for underflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Sep 4, 2023
1 parent e52c59e commit 2ab38e1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cli/src/command/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
}
}
}
Expand Down

0 comments on commit 2ab38e1

Please sign in to comment.