Skip to content

Commit

Permalink
On testnet /get_ursulas is used and its response format is slightly d…
Browse files Browse the repository at this point in the history
…ifferent than /bucket_sampling used on mainnet.
  • Loading branch information
derekpierre committed Aug 21, 2024
1 parent d78c076 commit b78f263
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deployment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ def sample_nodes(
response.raise_for_status()

data = response.json()
result = sorted(data["result"]["ursulas"], key=lambda x: x.lower())
ursulas = data["result"]["ursulas"]
if domain != MAINNET:
# /get_ursulas is used for sampling (instead of /bucket_sampling)
# so the json returned is slightly different
ursulas = [u["checksum_address"] for u in ursulas]

result = sorted(ursulas, key=lambda x: x.lower())
return result

0 comments on commit b78f263

Please sign in to comment.