Skip to content

Commit

Permalink
handle unallocated rewards for poc, data & mappers
Browse files Browse the repository at this point in the history
  • Loading branch information
andymck committed Nov 15, 2023
1 parent 8da38aa commit 82daf26
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 127 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions mobile_verifier/src/cli/reward_from_db.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
heartbeats::HeartbeatReward,
reward_shares::{get_scheduled_tokens_for_poc_and_dc, PocShares},
reward_shares::{get_scheduled_tokens_for_poc, PocShares},
speedtests_average::SpeedtestAverages,
Settings,
};
Expand Down Expand Up @@ -30,7 +30,7 @@ impl Cmd {

tracing::info!("Rewarding shares from the following time range: {start} to {end}");
let epoch = start..end;
let expected_rewards = get_scheduled_tokens_for_poc_and_dc(epoch.end - epoch.start);
let expected_rewards = get_scheduled_tokens_for_poc(epoch.end - epoch.start);

let (shutdown_trigger, _shutdown_listener) = triggered::trigger();
let pool = settings.database.connect(env!("CARGO_PKG_NAME")).await?;
Expand All @@ -46,7 +46,7 @@ impl Cmd {
let radio_rewards = reward_shares
.into_rewards(Decimal::ZERO, &epoch)
.ok_or(anyhow::anyhow!("no rewardable events"))?;
for reward in radio_rewards {
for (_reward_amount, reward) in radio_rewards {
if let Some(proto::mobile_reward_share::Reward::RadioReward(proto::RadioReward {
hotspot_key,
poc_reward,
Expand Down
Loading

0 comments on commit 82daf26

Please sign in to comment.