Skip to content

Commit

Permalink
Merge pull request #313 from derekpierre/fix-sampling
Browse files Browse the repository at this point in the history
Fix use of Porter for sampling
  • Loading branch information
theref authored Aug 22, 2024
2 parents 0067b74 + b78f263 commit bd18f40
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions deployment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ape.contracts import ContractContainer, ContractInstance
from ape_etherscan.utils import API_KEY_ENV_KEY_MAP

from deployment.constants import ARTIFACTS_DIR, LYNX, MAINNET, PORTER_SAMPLING_ENDPOINTS, TAPIR
from deployment.constants import ARTIFACTS_DIR, MAINNET, PORTER_SAMPLING_ENDPOINTS
from deployment.networks import is_local_network


Expand Down Expand Up @@ -192,7 +192,14 @@ def sample_nodes(
params["min_version"] = min_version

response = requests.get(porter_endpoint, params=params)
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 bd18f40

Please sign in to comment.