diff --git a/shared/challenges_markdown/three/part_one.md b/shared/challenges_markdown/three/part_one.md index 147bc11..62cf8a2 100644 --- a/shared/challenges_markdown/three/part_one.md +++ b/shared/challenges_markdown/three/part_one.md @@ -10,7 +10,7 @@ This archive can contain your entire "repo" (repository), which is your **[recor Loading (JS required) … -Your challenge: **find the `verification_code` hidden inside**. +Your challenge: **find the `verificationCode` hidden inside**.
Hint: atproto CAR tools (easy-mode) diff --git a/shared/challenges_markdown/three/part_two.md b/shared/challenges_markdown/three/part_two.md index ca32ac0..ddadf9c 100644 --- a/shared/challenges_markdown/three/part_two.md +++ b/shared/challenges_markdown/three/part_two.md @@ -5,7 +5,7 @@ make a valid CAR file and upload it the inspection will check for: - **Collection:** `codes.advent.challenge.day` -- **Record key:** `3` +- **Record key:** `three` - **Field:** `verificationCode` set to `{{code}}` any valid DID will do for the commit, and the signature won't be checked diff --git a/shared/examples/day_three_inspect_car.rs b/shared/examples/day_three_inspect_car.rs new file mode 100644 index 0000000..1212614 --- /dev/null +++ b/shared/examples/day_three_inspect_car.rs @@ -0,0 +1,20 @@ +use shared::advent::challenges::day_three::repo::inspect_car; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let path = std::env::args() + .nth(1) + .ok_or("usage: day_three_inspect_car ")?; + + let car_bytes = std::fs::read(&path)?; + + let record = inspect_car( + &car_bytes, + &("codes.advent.challenge.day".parse().unwrap()), + &("three".parse().unwrap()), + ).await?; + + println!("{record:#?}"); + + Ok(()) +} diff --git a/web/src/handlers/custom/day_three.rs b/web/src/handlers/custom/day_three.rs index 3861a1f..328deda 100644 --- a/web/src/handlers/custom/day_three.rs +++ b/web/src/handlers/custom/day_three.rs @@ -67,7 +67,7 @@ pub async fn inspect_car( let res = shared::advent::challenges::day_three::repo::inspect_car( &car_bytes, &("codes.advent.challenge.day".parse().unwrap()), - &("3".parse().unwrap()), + &("three".parse().unwrap()), ) .await; @@ -78,9 +78,9 @@ pub async fn inspect_car( set_flash_message( &mut session, "part_two_result", - FlashMessage::Error( - "Sorry, but your car failed inspection.".into() - ), + FlashMessage::Error(format!( + "Sorry, but your car failed inspection: {e}" + )), ) .await .map_err(log_and_respond(StatusCode::INTERNAL_SERVER_ERROR, "Session error"))?;