Skip to content

Commit

Permalink
ensure mobile subscriber id is properly credited for mobile rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffgrunewald committed Jun 28, 2023
1 parent 000140d commit d9b9c29
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions reward_index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license.workspace = true

[dependencies]
anyhow = {workspace = true}
bs58 = {workspace = true}
config = {workspace = true}
clap = {workspace = true}
thiserror = {workspace = true}
Expand Down
20 changes: 7 additions & 13 deletions reward_index/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,13 @@ impl Indexer {
},
r.dc_transfer_reward,
)),
Some(MobileReward::SubscriberReward(r)) => {
let key = match str::from_utf8(&r.subscriber_id) {
Ok(k) => k.to_string(),
Err(_e) => bail!("got an invalid subscriber id"),
};
Ok((
RewardKey {
key,
reward_type: RewardType::MobileSubscriber,
},
r.discovery_location_amount,
))
}
Some(MobileReward::SubscriberReward(r)) => Ok((
RewardKey {
key: bs58::encode(&r.subscriber_id).into_string(),
reward_type: RewardType::MobileSubscriber,
},
r.discovery_location_amount,
)),
_ => bail!("got an invalid reward share"),
}
}
Expand Down

0 comments on commit d9b9c29

Please sign in to comment.