Skip to content

Commit

Permalink
translate sp name to entity key
Browse files Browse the repository at this point in the history
  • Loading branch information
andymck committed Jan 3, 2024
1 parent e9b7f8e commit 4626b99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion reward_index/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Indexer {
if let Some(sp) = ServiceProvider::from_i32(r.service_provider_id) {
Ok((
RewardKey {
key: sp.as_str_name().to_string(),
key: service_provider_to_entity_key(sp)?,
reward_type: RewardType::MobileServiceProvider,
},
r.amount,
Expand Down Expand Up @@ -204,3 +204,9 @@ impl Indexer {
}
}
}

fn service_provider_to_entity_key(sp: ServiceProvider) -> anyhow::Result<String> {
match sp {
ServiceProvider::HeliumMobile => Ok("Helium Mobile".to_string()),
}
}

0 comments on commit 4626b99

Please sign in to comment.