Skip to content

Commit

Permalink
use radio_info as the source for all that we can
Browse files Browse the repository at this point in the history
Why pass in information from a source that we're going to be using
gratuitously within the same function. Did I spell that right?
  • Loading branch information
michaeldjeffrey committed Aug 29, 2024
1 parent 7cb1429 commit fb5fa7f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mobile_verifier/src/reward_shares.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ impl CoverageShares {
fn coverage_points(
&self,
radio_id: &RadioId,
oracle_boosting_status: OracleBoostingStatus,
) -> anyhow::Result<coverage_point_calculator::CoveragePoints> {
let radio_info = self.radio_infos.get(radio_id).unwrap();

Expand All @@ -671,7 +670,7 @@ impl CoverageShares {
radio_info.speedtests.clone(),
radio_info.trust_scores.clone(),
hexes,
oracle_boosting_status,
radio_info.oracle_boosting_status,
)?;

Ok(coverage_points)
Expand All @@ -694,7 +693,7 @@ impl CoverageShares {

let mut processed_radios = vec![];
for (radio_id, radio_info) in self.radio_infos.iter() {
let points = match self.coverage_points(radio_id, radio_info.oracle_boosting_status) {
let points = match self.coverage_points(radio_id) {
Ok(points) => points,
Err(err) => {
tracing::error!(
Expand Down Expand Up @@ -753,7 +752,7 @@ impl CoverageShares {

/// Only used for testing
pub fn test_hotspot_reward_shares(&self, hotspot: &RadioId) -> Decimal {
self.coverage_points(hotspot, OracleBoostingStatus::Eligible)
self.coverage_points(hotspot)
.expect("reward shares for hotspot")
.total_shares()
}
Expand Down

0 comments on commit fb5fa7f

Please sign in to comment.