Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie committed Aug 2, 2024
1 parent 4f8b0d2 commit c93fae5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mobile_verifier/src/reward_shares.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,8 @@ mod test {
);
// These are the same because we gave `total_reward_points: 30,` for each
// VerifiedMappingEventShares which is the same amount as discovery mapping
assert_eq!(819_672_131, r.discovery_location_amount);
assert_eq!(819_672_131, r.verification_mapping_amount);
assert_eq!(821_917_808, r.discovery_location_amount);
assert_eq!(821_917_808, r.verification_mapping_amount);
allocated_mapper_rewards += reward_amount;
}
}
Expand Down
5 changes: 4 additions & 1 deletion mobile_verifier/tests/integrations/rewarder_mappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async fn test_mapper_rewards(pool: PgPool) -> anyhow::Result<()> {
rewarder::reward_mappers(&pool, &mobile_rewards_client, &epoch),
receive_expected_rewards(&mut mobile_rewards)
);

if let Ok((subscriber_rewards, unallocated_reward)) = rewards {
// assert the mapper rewards
// all 3 subscribers will have an equal share,
Expand Down Expand Up @@ -101,7 +102,9 @@ async fn receive_expected_rewards(
let subscriber_reward1 = mobile_rewards.receive_subscriber_reward().await;
let subscriber_reward2 = mobile_rewards.receive_subscriber_reward().await;
let subscriber_reward3 = mobile_rewards.receive_subscriber_reward().await;
let subscriber_rewards = vec![subscriber_reward1, subscriber_reward2, subscriber_reward3];
let mut subscriber_rewards = vec![subscriber_reward1, subscriber_reward2, subscriber_reward3];

subscriber_rewards.sort_by(|a, b| a.subscriber_id.cmp(&b.subscriber_id));

// expect one unallocated reward
let unallocated_reward = mobile_rewards.receive_unallocated_reward().await;
Expand Down

0 comments on commit c93fae5

Please sign in to comment.