Skip to content

Commit 3dd6550

Browse files
committed
Refactor CalculatePocRewardShared::new function
1 parent d9d154f commit 3dd6550

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

mobile_verifier/src/reward_shares.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -581,17 +581,9 @@ impl CalculatedPocRewardShares {
581581
allocated_rewards: DataTransferAndPocAllocatedRewardBuckets,
582582
radios: impl Iterator<Item = &'a coverage_point_calculator::CoveragePoints>,
583583
) -> Option<Self> {
584-
//TODO fix this
585-
let (total_points, _boost_points, _poc_points) = radios.fold(
586-
(dec!(0), dec!(0), dec!(0)),
587-
|(total, boosted, poc), radio| {
588-
(
589-
total + radio.total_shares(),
590-
boosted + radio.total_boosted_shares(),
591-
poc + radio.total_base_shares(),
592-
)
593-
},
594-
);
584+
let total_points = radios
585+
.map(|radio| radio.total_shares())
586+
.sum::<Decimal>();
595587

596588
if total_points.is_zero() {
597589
return None;

0 commit comments

Comments
 (0)