From 03e03503f5e87be333785d66151170d56c11fc0f Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Mon, 30 Sep 2024 12:25:44 -0700 Subject: [PATCH] commit commit let's not have the worst of both worlds where we comment out unused code. Remove the printlns, they're not hard to add back in if you need them. --- .../src/service_provider/reward.rs | 3 +- .../tests/integrations/common/mod.rs | 55 +++++++------------ 2 files changed, 21 insertions(+), 37 deletions(-) diff --git a/mobile_verifier/src/service_provider/reward.rs b/mobile_verifier/src/service_provider/reward.rs index 4eb08aff9..da460d39b 100644 --- a/mobile_verifier/src/service_provider/reward.rs +++ b/mobile_verifier/src/service_provider/reward.rs @@ -595,8 +595,7 @@ mod tests { fn epoch() -> Range> { let now = Utc::now(); - let epoch = now - Duration::hours(24)..now; - epoch + now - Duration::hours(24)..now } trait PromoRewardFiltersExt { diff --git a/mobile_verifier/tests/integrations/common/mod.rs b/mobile_verifier/tests/integrations/common/mod.rs index 39c38ea11..05ebbec45 100644 --- a/mobile_verifier/tests/integrations/common/mod.rs +++ b/mobile_verifier/tests/integrations/common/mod.rs @@ -133,65 +133,50 @@ impl MockFileSinkReceiver { pub async fn receive_gateway_reward(&mut self) -> GatewayReward { match self.receive("receive_gateway_reward").await { - Some(mobile_reward) => { - // println!("mobile_reward: {:?}", mobile_reward); - match mobile_reward.reward { - Some(MobileReward::GatewayReward(r)) => r, - _ => panic!("failed to get gateway reward"), - } - } + Some(mobile_reward) => match mobile_reward.reward { + Some(MobileReward::GatewayReward(r)) => r, + _ => panic!("failed to get gateway reward"), + }, None => panic!("failed to receive gateway reward"), } } pub async fn receive_service_provider_reward(&mut self) -> ServiceProviderReward { match self.receive("receive_service_provider_reward").await { - Some(mobile_reward) => { - // println!("mobile_reward: {:?}", mobile_reward); - match mobile_reward.reward { - Some(MobileReward::ServiceProviderReward(r)) => r, - _ => panic!("failed to get service provider reward"), - } - } + Some(mobile_reward) => match mobile_reward.reward { + Some(MobileReward::ServiceProviderReward(r)) => r, + _ => panic!("failed to get service provider reward"), + }, None => panic!("failed to receive service provider reward"), } } pub async fn receive_subscriber_reward(&mut self) -> SubscriberReward { match self.receive("receive_subscriber_reward").await { - Some(mobile_reward) => { - // println!("mobile_reward: {:?}", mobile_reward); - match mobile_reward.reward { - Some(MobileReward::SubscriberReward(r)) => r, - _ => panic!("failed to get subscriber reward"), - } - } + Some(mobile_reward) => match mobile_reward.reward { + Some(MobileReward::SubscriberReward(r)) => r, + _ => panic!("failed to get subscriber reward"), + }, None => panic!("failed to receive subscriber reward"), } } pub async fn receive_promotion_reward(&mut self) -> PromotionReward { match self.receive("receive_promotion_reward").await { - Some(mobile_reward) => { - // println!("mobile_reward: {:?}", mobile_reward); - match mobile_reward.reward { - Some(MobileReward::PromotionReward(r)) => r, - _ => panic!("failed to get promotion reward"), - } - } + Some(mobile_reward) => match mobile_reward.reward { + Some(MobileReward::PromotionReward(r)) => r, + _ => panic!("failed to get promotion reward"), + }, None => panic!("failed to receive promotion reward"), } } pub async fn receive_unallocated_reward(&mut self) -> UnallocatedReward { match self.receive("receive_unallocated_reward").await { - Some(mobile_reward) => { - // println!("mobile_reward: {:?}", mobile_reward); - match mobile_reward.reward { - Some(MobileReward::UnallocatedReward(r)) => r, - _ => panic!("failed to get unallocated reward"), - } - } + Some(mobile_reward) => match mobile_reward.reward { + Some(MobileReward::UnallocatedReward(r)) => r, + _ => panic!("failed to get unallocated reward"), + }, None => panic!("failed to receive unallocated reward"), } }