Skip to content

Commit

Permalink
[Faucet] Fix status code
Browse files Browse the repository at this point in the history
  • Loading branch information
666lcz committed Apr 25, 2022
1 parent 8b5fa02 commit 2c0f3d6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions faucet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ async fn request_gas(
.await
}
};
let resp: FaucetResponse = match result {
Ok(v) => v.into(),
Err(v) => v.into(),
};
(StatusCode::CREATED, Json(resp))
match result {
Ok(v) => (StatusCode::CREATED, Json(FaucetResponse::from(v))),
Err(v) => (
StatusCode::INTERNAL_SERVER_ERROR,
Json(FaucetResponse::from(v)),
),
}
}

async fn create_wallet_context() -> Result<WalletContext, anyhow::Error> {
Expand Down

0 comments on commit 2c0f3d6

Please sign in to comment.