Skip to content

Commit

Permalink
match iot and mobile reward period settings
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldjeffrey committed May 13, 2024
1 parent c661525 commit 5c7d693
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions iot_verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ impl Server {
pool: pool.clone(),
rewards_sink,
reward_manifests_sink,
reward_period_hours: settings.rewards,
reward_offset: settings.reward_offset_minutes,
reward_period_hours: settings.reward_period,
reward_offset: settings.reward_period_offset,
price_tracker,
};

Expand Down
10 changes: 5 additions & 5 deletions iot_verifier/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ pub struct Settings {
pub price_tracker: price::price_tracker::Settings,
/// Reward period in hours. (Default to 24)
#[serde(with = "humantime_serde", default = "default_reward_period")]
pub rewards: Duration,
pub reward_period: Duration,
/// Reward calculation offset in minutes, rewards will be calculated at the end
/// of the reward period + reward_offset_minutes
#[serde(with = "humantime_serde", default = "default_reward_offset_minutes")]
pub reward_offset_minutes: Duration,
/// of the reward_period + reward_period_offset
#[serde(with = "humantime_serde", default = "default_reward_period_offset")]
pub reward_period_offset: Duration,
#[serde(default = "default_max_witnesses_per_poc")]
pub max_witnesses_per_poc: u64,
/// The cadence at which hotspots are permitted to beacon (in seconds)
Expand Down Expand Up @@ -177,7 +177,7 @@ fn default_reward_period() -> Duration {
humantime::parse_duration("24 hours").unwrap()
}

fn default_reward_offset_minutes() -> Duration {
fn default_reward_period_offset() -> Duration {
humantime::parse_duration("30 minutes").unwrap()
}

Expand Down
2 changes: 1 addition & 1 deletion mobile_verifier/src/rewarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ where
carrier_service_verifier,
hex_boosting_info_resolver,
settings.reward_period,
settings.reward_offset,
settings.reward_period_offset,
mobile_rewards,
reward_manifests,
price_tracker,
Expand Down
6 changes: 3 additions & 3 deletions mobile_verifier/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub struct Settings {
/// Reward period in hours. (Default is 24 hours)
#[serde(with = "humantime_serde", default = "default_reward_period")]
pub reward_period: Duration,
#[serde(with = "humantime_serde", default = "default_reward_offset_minutes")]
pub reward_offset: Duration,
#[serde(with = "humantime_serde", default = "default_reward_period_offset")]
pub reward_period_offset: Duration,
pub database: db_store::Settings,
pub ingest: file_store::Settings,
pub data_transfer_ingest: file_store::Settings,
Expand Down Expand Up @@ -76,7 +76,7 @@ fn default_reward_period() -> Duration {
humantime::parse_duration("24 hours").unwrap()
}

fn default_reward_offset_minutes() -> Duration {
fn default_reward_period_offset() -> Duration {
humantime::parse_duration("30 minutes").unwrap()
}

Expand Down

0 comments on commit 5c7d693

Please sign in to comment.