Skip to content

Commit c338381

Browse files
committed
identified an issue and added fixme
1 parent a5c2f01 commit c338381

File tree

1 file changed

+5
-0
lines changed
  • pallets/mining/rewards-allowance/src

1 file changed

+5
-0
lines changed

pallets/mining/rewards-allowance/src/tests.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ fn distribute_rewards(amount_bonded_each_miner: u128, original_amount_bonded_eac
379379
assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630195200000, 2)), Some(original_amount_bonded_each_miner / 10));
380380
assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630195200000, 3)), Some(original_amount_bonded_each_miner / 10));
381381

382+
// FIXME - since we're passing values for the test that have been divided by `/ 1_000_000_000_000_000_000`
383+
// to make it work, the division in the implementation to calculate `manageable_daily_reward_for_miner_as_u128` which is
384+
// `daily_reward_for_miner_as_u128.clone().checked_div(1000000000000000000u128)` ends up being says 5000/1000000000000000000
385+
// which is 0, so it doesn't let us distribute rewards and this doesn't work
386+
// assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1630195200000), Some(2u128));
382387
assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining_distributed(1630195200000), Some(true));
383388
assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630195200000, 0, 1)));
384389
}

0 commit comments

Comments
 (0)