Skip to content

Commit

Permalink
Merge pull request #38 from eniac-x-labs/feature/add_null_check
Browse files Browse the repository at this point in the history
[R4R] : add null check
  • Loading branch information
ink-web3 authored Apr 23, 2024
2 parents b0c3503 + 2c5c758 commit 03201d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions api/l3staking/api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def get_node_detail(request):
# @check_api_token
def get_l2_stake_record(request):
params = json.loads(request.body.decode())
staker_address = params.get('staker_address', "0x")
staker_address = params.get('staker_address', "")
if staker_address == "":
return error_json(msg="staker address cannot be empty");
strategy = params.get('strategy', "0x")
page = params.get('page', 1)
page_size = params.get('page_size', 10)
Expand All @@ -97,7 +99,9 @@ def get_l2_stake_record(request):
# @check_api_token
def get_l2_unstake_record(request):
params = json.loads(request.body.decode())
staker_address = params.get('staker_address', "0x")
staker_address = params.get('staker_address', "")
if staker_address == "":
return error_json(msg="staker address cannot be empty");
strategy = params.get('strategy', "0x")
page = params.get('page', 1)
page_size = params.get('page_size', 10)
Expand All @@ -115,7 +119,9 @@ def get_l2_unstake_record(request):

def get_l2_withdraw_record(request):
params = json.loads(request.body.decode())
staker_address = params.get('staker_address', "0x")
staker_address = params.get('staker_address', "")
if staker_address == "":
return error_json(msg="staker address cannot be empty");
strategy = params.get('strategy', "0x")
page = params.get('page', 1)
page_size = params.get('page_size', 10)
Expand Down

0 comments on commit 03201d8

Please sign in to comment.