diff --git a/src/endpoints/analytics/get_quest_activity.rs b/src/endpoints/analytics/get_quest_activity.rs index 3168ce60..bbefe169 100644 --- a/src/endpoints/analytics/get_quest_activity.rs +++ b/src/endpoints/analytics/get_quest_activity.rs @@ -68,13 +68,6 @@ pub async fn handler( "expiry": "$_id.expiry" }, "pipeline": [ - doc! { - "$addFields": doc! { - "refactoredTimestamp": doc! { - "$toDate": "$timestamp" - } - } - }, doc! { "$match": doc! { "$expr": doc! { diff --git a/src/endpoints/analytics/get_quest_participation.rs b/src/endpoints/analytics/get_quest_participation.rs index b851c758..bc448f31 100644 --- a/src/endpoints/analytics/get_quest_participation.rs +++ b/src/endpoints/analytics/get_quest_participation.rs @@ -71,13 +71,6 @@ pub async fn handler( "expiry": "$_id.expiry" }, "pipeline": [ - doc! { - "$addFields": doc! { - "refactoredTimestamp": doc! { - "$toDate": "$timestamp" - } - } - }, doc! { "$match": doc! { "$expr": doc! { diff --git a/src/endpoints/quests/starknetid/verify_socials.rs b/src/endpoints/quests/starknetid/verify_socials.rs index ea265cc7..c884a418 100644 --- a/src/endpoints/quests/starknetid/verify_socials.rs +++ b/src/endpoints/quests/starknetid/verify_socials.rs @@ -39,9 +39,9 @@ async fn call_contract_helper( } #[route( - get, - "/quests/starknetid/verify_socials", - crate::endpoints::quests::starknetid::verify_socials +get, +"/quests/starknetid/verify_socials", +crate::endpoints::quests::starknetid::verify_socials )] pub async fn handler( State(state): State>, @@ -53,14 +53,16 @@ pub async fn handler( ) -> Result<(StatusCode, Json), String> { let task_id = 6; let addr = &query.addr; - + println!("addr {:?}", addr); + println!("naming_contract {:?}", state.conf.starknetid_contracts.naming_contract); let domain_res = call_contract_helper( &state, state.conf.starknetid_contracts.naming_contract, selector!("address_to_domain"), vec![*addr], ) - .await?; + .await?; + println!("domain res {:?}", domain_res); let id_res = call_contract_helper( &state, @@ -68,11 +70,22 @@ pub async fn handler( selector!("domain_to_token_id"), domain_res, ) - .await?; + .await?; + + println!("id_res res {:?}", id_res); + let mut twitter = false; let mut discord = false; + for verifier_contract in &state.conf.starknetid_contracts.verifier_contracts { + let calldata = vec![ + id_res[0], + short_string!("discord"), + *verifier_contract, + FieldElement::ZERO, + ]; + println!("calldata : {:?}", calldata); let twitter_verifier_data = call_contract_helper( &state, state.conf.starknetid_contracts.identity_contract, @@ -84,7 +97,8 @@ pub async fn handler( FieldElement::ZERO, ], ) - .await?; + .await?; + println!("twitter_verifier_data : {:?}", twitter_verifier_data); if twitter_verifier_data[0] != felt!("0") { twitter = true; } @@ -100,7 +114,10 @@ pub async fn handler( FieldElement::ZERO, ], ) - .await?; + .await?; + + println!("twitter_verifier_data : {:?}", discord_verifier_data); + if discord_verifier_data[0] != felt!("0") { discord = true; }