Skip to content

Commit

Permalink
Add temporary exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkara committed Jan 11, 2025
1 parent 66c9775 commit 235ba30
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fetch_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ def fetch_validators(last_era_id):
account_info = validator.get("account_info")
validator["account_info_url"] = account_info.get("url", "") if account_info else ""
validator["account_info_active"] = account_info.get("is_active", False) if account_info else False

# Exception for specific public key due to inconsistency in the API response. Issue reported.
# TODO: Remove the exception when the API is fixed.
if validator.get("public_key") == "01faa681d910a8ac877b81537d75db42395b9da0da1a3457d223151305f803da0e":
validator["account_info_active"] = True

average_performance = validator.get("average_performance")
validator["average_performance"] = round(average_performance.get("score", 0.0), 1) if average_performance else 0

Expand Down Expand Up @@ -255,4 +261,3 @@ def fetch_validators(last_era_id):
last_era_id = current_era_id - 1
fetch_validators(last_era_id)


0 comments on commit 235ba30

Please sign in to comment.