Rename stake_provider(s)_account(s) -> staking_provider(s)_account(s).

pull/3491/head
derekpierre 2024-04-27 10:31:19 -04:00
parent db1ff0eeee
commit 0f0a39d242
No known key found for this signature in database
8 changed files with 15 additions and 15 deletions

View File

@ -21,7 +21,7 @@ def test_ursula_operator_confirmation(
deployer_account,
accounts,
):
staking_provider = accounts.stake_provider_account(0)
staking_provider = accounts.staking_provider_account(0)
operator_address = accounts.ursula_account(0)
min_authorization = taco_application_agent.get_min_authorization()

View File

@ -22,7 +22,7 @@ def test_sampling_distribution(
accounts,
):
# setup
stake_provider_accounts = accounts.stake_providers_accounts
stake_provider_accounts = accounts.staking_providers_accounts
amount = taco_application_agent.get_min_authorization()
all_locked_tokens = len(stake_provider_accounts) * amount

View File

@ -328,7 +328,7 @@ def staking_providers(
staking_providers = list()
for provider_address, operator_address in zip(
accounts.stake_providers_accounts, accounts.ursulas_accounts
accounts.staking_providers_accounts, accounts.ursulas_accounts
):
# for a random amount
amount = minimum_stake + random.randrange(BONUS_TOKENS_FOR_TESTS)

View File

@ -55,7 +55,7 @@ def mock_sample_reservoir(accounts, mock_contract_agency):
):
addresses = {
address: 1
for address in accounts.stake_providers_accounts
for address in accounts.staking_providers_accounts
if address not in without
}
return StakingProvidersReservoir(addresses)
@ -172,7 +172,7 @@ def mock_funding_and_bonding(
mocker.patch.object(EthereumClient, "get_balance", return_value=1)
# bonding
staking_provider = accounts.stake_providers_accounts[0]
staking_provider = accounts.staking_providers_accounts[0]
mock_taco_application_agent.get_staking_provider_from_operator.return_value = (
staking_provider
)
@ -264,12 +264,12 @@ def real_operator_get_staking_provider_address():
@pytest.fixture(scope="module", autouse=True)
def staking_providers(real_operator_get_staking_provider_address, accounts):
def faked(self, *args, **kwargs):
return accounts.stake_providers_accounts[
return accounts.staking_providers_accounts[
accounts.ursulas_accounts.index(self.transacting_power.account)
]
Operator.get_staking_provider_address = faked
return accounts.stake_providers_accounts
return accounts.staking_providers_accounts
@pytest.fixture(scope="module")

View File

@ -78,12 +78,12 @@ def testerchain(mock_testerchain, module_mocker, clock) -> MockBlockchain:
@pytest.fixture(scope="module", autouse=True)
def staking_providers(accounts, test_registry, monkeymodule):
def faked(self, *args, **kwargs):
return accounts.stake_providers_accounts[
return accounts.staking_providers_accounts[
accounts.ursulas_accounts.index(self.transacting_power.account)
]
Operator.get_staking_provider_address = faked
return accounts.stake_providers_accounts
return accounts.staking_providers_accounts
@pytest.fixture(scope="module", autouse=True)

View File

@ -16,10 +16,10 @@ def test_account_organization():
assert account_manager.bob_account == account_addresses[2]
# staking provider addresses
staking_providers = account_manager.stake_providers_accounts
staking_providers = account_manager.staking_providers_accounts
assert staking_providers == account_addresses[3:13]
for i in range(len(staking_providers)):
assert account_manager.stake_provider_account(i) == staking_providers[i]
assert account_manager.staking_provider_account(i) == staking_providers[i]
# ursula addresses
ursulas = account_manager.ursulas_accounts

View File

@ -89,7 +89,7 @@ class ReservedTestAccountManager(TestAccountManager):
def ursulas_accounts(self) -> List[ChecksumAddress]:
return list(self.ursula_account(i) for i in self.__OPERATORS_RANGE)
def stake_provider_account(self, index) -> ChecksumAddress:
def staking_provider_account(self, index) -> ChecksumAddress:
if index not in self.__STAKING_PROVIDERS_RANGE:
raise ValueError(
f"Stake provider index must be lower than {self.NUMBER_OF_URSULAS_IN_TESTS}"
@ -97,9 +97,9 @@ class ReservedTestAccountManager(TestAccountManager):
return self[index + self._FIRST_STAKING_PROVIDER].address
@property
def stake_providers_accounts(self) -> List[ChecksumAddress]:
def staking_providers_accounts(self) -> List[ChecksumAddress]:
return list(
self.stake_provider_account(i) for i in self.__STAKING_PROVIDERS_RANGE
self.staking_provider_account(i) for i in self.__STAKING_PROVIDERS_RANGE
)
@property

View File

@ -74,7 +74,7 @@ def make_reserved_ursulas(
):
num_values = quantity or accounts.NUMBER_OF_URSULAS_IN_TESTS
staking_providers = accounts.stake_providers_accounts[:num_values]
staking_providers = accounts.staking_providers_accounts[:num_values]
operator_signers = [
accounts.get_account_signer(operator_address)
for operator_address in accounts.ursulas_accounts[:num_values]