Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Nov 14, 2024
1 parent 1d77d6d commit 16ddaf3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
12 changes: 8 additions & 4 deletions crates/apps_lib/src/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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
);
}
Expand Down
11 changes: 6 additions & 5 deletions crates/tests/src/integration/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 16ddaf3

Please sign in to comment.