Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sug0 committed Feb 14, 2024
1 parent de2b04b commit 8c17ab0
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/handler/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn request_challenge(
State(mut state): State<FaucetState>,
Path(player_id): Path<String>,
) -> Result<Json<FaucetResponseDto>, ApiError> {
tracing::info!("Challenge request from {}",player_id);
tracing::info!("Challenge request from {}", player_id);
let client = reqwest::Client::new();
let req = client
.get(format!(
Expand All @@ -79,7 +79,10 @@ pub async fn request_challenge(
};

if too_many_requests {
tracing::info!("Challenge request from {}, was not accepted (too many reqs)", player_id);
tracing::info!(
"Challenge request from {}, was not accepted (too many reqs)",
player_id
);
return Err(FaucetError::TooManyRequests.into());
}
last_requests.insert(player_id.clone(), now);
Expand All @@ -101,7 +104,11 @@ pub async fn request_transfer(
State(mut state): State<FaucetState>,
ValidatedRequest(payload): ValidatedRequest<FaucetRequestDto>,
) -> Result<Json<FaucetResponseStatusDto>, ApiError> {
tracing::info!("Faucet request from {} is asking for {}", payload.player_id, payload.transfer.amount);
tracing::info!(
"Faucet request from {} is asking for {}",
payload.player_id,
payload.transfer.amount
);

let auth_key: String = state.auth_key.clone();

Expand Down Expand Up @@ -234,7 +241,11 @@ pub async fn request_transfer(
};

if transfer_result {
tracing::info!("Faucet request from {} for {} was succesful", payload.player_id, payload.transfer.amount);
tracing::info!(
"Faucet request from {} for {} was succesful",
payload.player_id,
payload.transfer.amount
);
state.faucet_repo.add(payload.challenge.clone()).await;
}

Expand Down

0 comments on commit 8c17ab0

Please sign in to comment.