From 02c79160c923ab417a4812e4a0f17a9f02022f66 Mon Sep 17 00:00:00 2001 From: brentstone Date: Mon, 26 Aug 2024 16:31:22 -0700 Subject: [PATCH] format denominated amount --- crates/apps_lib/src/client/rpc.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/apps_lib/src/client/rpc.rs b/crates/apps_lib/src/client/rpc.rs index 4f38f5621b8..8063fdc4923 100644 --- a/crates/apps_lib/src/client/rpc.rs +++ b/crates/apps_lib/src/client/rpc.rs @@ -35,7 +35,8 @@ use namada_sdk::proof_of_stake::types::{ use namada_sdk::proof_of_stake::PosParams; use namada_sdk::queries::{Client, RPC}; use namada_sdk::rpc::{ - self, enriched_bonds_and_unbonds, query_epoch, TxResponse, + self, enriched_bonds_and_unbonds, format_denominated_amount, query_epoch, + TxResponse, }; use namada_sdk::storage::{BlockHeight, BlockResults, Epoch}; use namada_sdk::tendermint_rpc::endpoint::status; @@ -1186,9 +1187,17 @@ pub async fn query_total_supply( .total_supply(context.client(), &token) .await, ); + let amount_str = format_denominated_amount( + context.client(), + context.io(), + &token, + supply, + ) + .await; display_line!( context.io(), - "Total supply of token {token}: {supply} raw units" + "Total supply of token {token}: {}", + amount_str ); }