From 16ddaf3340c8d64572117405d09adee9f4fda4c5 Mon Sep 17 00:00:00 2001 From: brentstone Date: Wed, 13 Nov 2024 22:27:15 -0800 Subject: [PATCH] cleanup --- crates/apps_lib/src/client/rpc.rs | 12 ++++++++---- crates/tests/src/integration/masp.rs | 11 ++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/crates/apps_lib/src/client/rpc.rs b/crates/apps_lib/src/client/rpc.rs index f1daf9d04a..f44fc4023e 100644 --- a/crates/apps_lib/src/client/rpc.rs +++ b/crates/apps_lib/src/client/rpc.rs @@ -47,7 +47,9 @@ use namada_sdk::rpc::{ }; use namada_sdk::storage::BlockResults; use namada_sdk::tendermint_rpc::endpoint::status; -use namada_sdk::token::{DenominatedAmount, MaspDigitPos}; +use namada_sdk::token::{ + DenominatedAmount, MaspDigitPos, NATIVE_MAX_DECIMAL_PLACES, +}; use namada_sdk::tx::display_batch_resp; use namada_sdk::wallet::AddressVpType; use namada_sdk::{error, state as storage, token, Namada}; @@ -372,11 +374,13 @@ pub async fn query_rewards_estimate( .await .unwrap() .unsigned_abs(); - let rewards_estimate = - DenominatedAmount::new(Amount::from_u128(rewards_estimate), 6.into()); + let rewards_estimate = DenominatedAmount::new( + Amount::from_u128(rewards_estimate), + NATIVE_MAX_DECIMAL_PLACES.into(), + ); display_line!( context.io(), - "Estimated nam rewards for the next MASP epoch: {}", + "Estimated native token rewards for the next MASP epoch: {}", rewards_estimate ); } diff --git a/crates/tests/src/integration/masp.rs b/crates/tests/src/integration/masp.rs index 366af3a4ce..a8ea6b906a 100644 --- a/crates/tests/src/integration/masp.rs +++ b/crates/tests/src/integration/masp.rs @@ -1364,7 +1364,9 @@ fn masp_incentives() -> Result<()> { }); assert!(captured.result.is_ok()); assert!( - captured.contains("Estimated nam rewards for the next MASP epoch: 0") + captured.contains( + "Estimated native token rewards for the next MASP epoch: 0" + ) ); // Wait till epoch boundary @@ -1432,10 +1434,9 @@ fn masp_incentives() -> Result<()> { }); assert!(captured.result.is_ok()); // note that 0.126 = 2 * 0.063 which is expected - assert!( - captured - .contains("Estimated nam rewards for the next MASP epoch: 0.126") - ); + assert!(captured.contains( + "Estimated native token rewards for the next MASP epoch: 0.126" + )); // Assert NAM balance at MASP pool is exclusively the // rewards from the shielded BTC