@@ -6,9 +6,6 @@ use storage::Database;
66use streamer:: { RewardsNotificationPayload , StreamProducer , StreamProducerQueue } ;
77
88use crate :: auth:: VerifiedAuth ;
9- use crate :: referral:: RewardsRedemptionClient ;
10-
11- const GIFT_CODE_PREFIX : & str = "GIFT-" ;
129
1310const REFERRAL_ELIGIBILITY_DAYS : i64 = 7 ;
1411
@@ -59,10 +56,6 @@ impl RewardsClient {
5956 }
6057
6158 pub async fn use_referral_code ( & mut self , auth : & VerifiedAuth , code : & str , ip_address : & str ) -> Result < ( ) , Box < dyn Error + Send + Sync > > {
62- if code. starts_with ( GIFT_CODE_PREFIX ) && code. len ( ) >= 16 {
63- return self . process_gift_code ( auth, code) . await ;
64- }
65-
6659 if !self . database . client ( ) ?. rewards ( ) . referral_code_exists ( code) ? {
6760 return Err ( RewardsError :: Referral ( "Referral code does not exist" . to_string ( ) ) . into ( ) ) ;
6861 }
@@ -79,12 +72,6 @@ impl RewardsClient {
7972 }
8073 }
8174
82- async fn process_gift_code ( & mut self , auth : & VerifiedAuth , code : & str ) -> Result < ( ) , Box < dyn Error + Send + Sync > > {
83- let mut redemption_client = RewardsRedemptionClient :: new ( self . database . clone ( ) , self . stream_producer . clone ( ) ) ;
84- redemption_client. redeem ( & auth. address , code, auth. device . id ) . await ?;
85- Ok ( ( ) )
86- }
87-
8875 async fn process_referral ( & mut self , auth : & VerifiedAuth , code : & str , ip_address : & str ) -> Result < ( ) , Box < dyn Error + Send + Sync > > {
8976 self . check_referrer_limits ( code) ?;
9077 let invite_event = self . validate_referral_usage ( auth, code) ?;
0 commit comments