Skip to content

Commit

Permalink
fix some logging and CLI functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Aug 27, 2024
1 parent b83d428 commit 3c1af5d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 5 additions & 4 deletions crates/apps_lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2108,9 +2108,10 @@ pub mod cmds {
fn def() -> App {
App::new(Self::CMD)
.about(wrap!(
"Query the total supply in the network of the given \
token. For the native token, this will query the raw \
total supply and not the effective total supply."
"Query the effective total circulating supply of the \
native token NAM. This excludes illquid NAM tokens held \
in places such as the PGF account. This is the token \
amount used in inflation calculations."
))
.add_args::<args::QueryEffNativeSupply<args::CliTypes>>()
}
Expand Down Expand Up @@ -7055,7 +7056,7 @@ pub mod args {
}

fn def(app: App) -> App {
app
app.add_args::<Query<CliTypes>>()
}
}

Expand Down
7 changes: 5 additions & 2 deletions crates/apps_lib/src/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,10 @@ pub async fn query_total_supply<N: Namada>(
.total_supply(context.client(), &token)
.await,
);
display_line!(context.io(), "Total supply of {token}: {supply}");
display_line!(
context.io(),
"Total supply of token {token}: {supply} raw units"
);
}

/// Query the effective total supply of the native token
Expand All @@ -1199,7 +1202,7 @@ pub async fn query_effective_native_supply<N: Namada>(context: &N) {
.effective_native_supply(context.client())
.await,
);
display_line!(context.io(), "{native_supply} NAM");
display_line!(context.io(), "nam: {}", native_supply.to_string_native());
}

/// Query a validator's state information
Expand Down
1 change: 1 addition & 0 deletions crates/tests/src/e2e/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,7 @@ pub mod constants {
// Native VP aliases
pub const GOVERNANCE_ADDRESS: &str = "governance";
pub const MASP: &str = "masp";
pub const PGF_ADDRESS: &str = "pgf";

// Fungible token addresses
pub const NAM: &str = "NAM";
Expand Down

0 comments on commit 3c1af5d

Please sign in to comment.