Skip to content

Commit

Permalink
Merge pull request #55 from starknet-id/feat/add_orbiter_quest
Browse files Browse the repository at this point in the history
feat: add task verify_twitter_fw_sq to orbiter quest
  • Loading branch information
Th0rgal authored Aug 3, 2023
2 parents 8d4ef7d + 66b7866 commit febc77c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/endpoints/quests/orbiter/claimable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use starknet::{
use std::sync::Arc;

const QUEST_ID: u32 = 8;
const TASK_IDS: &[u32] = &[32, 33, 34, 35];
const LAST_TASK: u32 = TASK_IDS[3];
const TASK_IDS: &[u32] = &[32, 33, 34, 35, 36];
const LAST_TASK: u32 = TASK_IDS[4];
const NFT_LEVEL: u32 = 10;

#[derive(Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions src/endpoints/quests/orbiter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ pub mod claimable;
pub mod verify_has_bridged;
pub mod verify_has_root_domain;
pub mod verify_twitter_fw;
pub mod verify_twitter_fw_sq;
pub mod verify_twitter_rt;
24 changes: 24 additions & 0 deletions src/endpoints/quests/orbiter/verify_twitter_fw_sq.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use std::sync::Arc;

use crate::{
models::{AppState, VerifyQuery},
utils::{get_error, CompletedTasksTrait},
};
use axum::{
extract::{Query, State},
http::StatusCode,
response::IntoResponse,
Json,
};
use serde_json::json;

pub async fn handler(
State(state): State<Arc<AppState>>,
Query(query): Query<VerifyQuery>,
) -> impl IntoResponse {
let task_id = 35;
match state.upsert_completed_task(query.addr, task_id).await {
Ok(_) => (StatusCode::OK, Json(json!({"res": true}))).into_response(),
Err(e) => get_error(format!("{}", e)),
}
}
2 changes: 1 addition & 1 deletion src/endpoints/quests/orbiter/verify_twitter_rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub async fn handler(
State(state): State<Arc<AppState>>,
Query(query): Query<VerifyQuery>,
) -> impl IntoResponse {
let task_id = 35;
let task_id = 36;
match state.upsert_completed_task(query.addr, task_id).await {
Ok(_) => (StatusCode::OK, Json(json!({"res": true}))).into_response(),
Err(e) => get_error(format!("{}", e)),
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ async fn main() {
"/quests/orbiter/verify_twitter_fw",
get(endpoints::quests::orbiter::verify_twitter_fw::handler),
)
.route(
"/quests/orbiter/verify_twitter_fw_sq",
get(endpoints::quests::orbiter::verify_twitter_fw_sq::handler),
)
.route(
"/quests/orbiter/verify_twitter_rt",
get(endpoints::quests::orbiter::verify_twitter_rt::handler),
Expand Down

0 comments on commit febc77c

Please sign in to comment.