diff options
| -rw-r--r-- | src/handlers.rs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/handlers.rs b/src/handlers.rs index be2a020..cc71ba7 100644 --- a/src/handlers.rs +++ b/src/handlers.rs | |||
| @@ -303,18 +303,7 @@ pub async fn authorized_propose_transaction( | |||
| 303 | StatusCode::BAD_REQUEST, | 303 | StatusCode::BAD_REQUEST, |
| 304 | )); | 304 | )); |
| 305 | } | 305 | } |
| 306 | } else if new_transaction.by == new_transaction.target { | 306 | } else { // todo: add bank mechanism |
| 307 | if internal_user.balance < new_transaction.amount { | ||
| 308 | return Ok(warp::reply::with_status( | ||
| 309 | warp::reply::json(&GradeCoinResponse { | ||
| 310 | res: ResponseType::Error, | ||
| 311 | message: "Bank does not have enough balance" | ||
| 312 | .to_owned(), | ||
| 313 | }), | ||
| 314 | StatusCode::BAD_REQUEST, | ||
| 315 | )); | ||
| 316 | } | ||
| 317 | } else { | ||
| 318 | return Ok(warp::reply::with_status( | 307 | return Ok(warp::reply::with_status( |
| 319 | warp::reply::json(&GradeCoinResponse { | 308 | warp::reply::json(&GradeCoinResponse { |
| 320 | res: ResponseType::Error, | 309 | res: ResponseType::Error, |
