Skip to content

Commit

Permalink
Refactor into_rewards a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
maplant committed Jul 24, 2023
1 parent d066c29 commit a71a601
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions mobile_verifier/src/reward_shares.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,11 @@ impl CoveragePoints {
let total_shares = self.total_shares();
let available_poc_rewards =
get_scheduled_tokens_for_poc_and_dc(epoch.end - epoch.start) - transfer_rewards_sum;
if let Some(poc_rewards_per_share) = available_poc_rewards.checked_div(total_shares) {
let start_period = epoch.start.encode_timestamp();
let end_period = epoch.end.encode_timestamp();
Some(
available_poc_rewards
.checked_div(total_shares)
.map(|poc_rewards_per_share| {
let start_period = epoch.start.encode_timestamp();
let end_period = epoch.end.encode_timestamp();
self.coverage_points
.into_iter()
.flat_map(
Expand Down Expand Up @@ -383,11 +384,8 @@ impl CoveragePoints {
radio_reward.poc_reward > 0
}
_ => false,
}),
)
} else {
None
}
})
})
}
}

Expand Down

0 comments on commit a71a601

Please sign in to comment.