Skip to content

Commit

Permalink
Strip new lines from provider addresses obtained from handpicked addr…
Browse files Browse the repository at this point in the history
…esses file.

Fix linter errors.
  • Loading branch information
derekpierre committed Sep 4, 2024
1 parent 66cbe9a commit 63b32b4
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions scripts/initiate_ritual.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def cli(
num_nodes,
random_seed,
handpicked,
min_version
min_version,
):
"""Initiate a ritual for a TACo domain."""

Expand All @@ -108,7 +108,9 @@ def cli(

# Get the contracts from the registry
coordinator_contract = registry.get_contract(domain=domain, contract_name="Coordinator")
access_controller_contract = registry.get_contract(domain=domain, contract_name=access_controller)
access_controller_contract = registry.get_contract(
domain=domain, contract_name=access_controller
)
fee_model_contract = registry.get_contract(domain=domain, contract_name=fee_model)

# if using a subcription, duration needs to be calculated
Expand All @@ -125,23 +127,25 @@ def cli(
if now > end_of_subscription:
raise ValueError("Subscription has already ended.")
click.echo(
"Subscription has already started. Subtracting the elapsed time from the duration."
)
"Subscription has already started. Subtracting the elapsed time from the duration."
)
elapsed = now - start_of_subscription + 100
duration -= elapsed


# Get the staking providers in the ritual cohort
if handpicked:
providers = sorted(line.lower() for line in handpicked)
providers = sorted(line.lower().strip() for line in handpicked)
if not providers:
raise ValueError(f"No staking providers found in the handpicked file {handpicked.name}")
else:
providers = sample_nodes(
domain=domain, num_nodes=num_nodes, duration=duration, random_seed=random_seed, min_version=min_version
domain=domain,
num_nodes=num_nodes,
duration=duration,
random_seed=random_seed,
min_version=min_version,
)


# Initiate the ritual
transactor = Transactor(account=account)
transactor.transact(
Expand Down

0 comments on commit 63b32b4

Please sign in to comment.