Skip to content

Commit

Permalink
Added request body check
Browse files Browse the repository at this point in the history
  • Loading branch information
SaveTheAles authored May 29, 2024
1 parent 36415c3 commit afa00b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tx_service/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def handle_tx():
# Parse the JSON request body
req_body = request.get_json()

# Check the request body
if "proof" not in req_body.keys():
return jsonify({"status": "fail", "error": "There is no proof value"})
if "pubkey" not in req_body.keys():
return jsonify({"status": "fail", "error": "There is no pubkey value"})

# Extract the transaction data from the request body
proof = req_body["proof"]
pubkey = req_body["pubkey"]
Expand Down

0 comments on commit afa00b5

Please sign in to comment.