diff --git a/src/validators/tasks.py b/src/validators/tasks.py index b7dffcfd..4a28b9fa 100644 --- a/src/validators/tasks.py +++ b/src/validators/tasks.py @@ -194,19 +194,6 @@ async def process_validators( return tx_hash -async def get_validators_count_from_vault_assets(harvest_params: HarvestParams | None) -> int: - vault_balance = await get_withdrawable_assets(harvest_params) - if settings.network in GNO_NETWORKS: - # apply GNO -> mGNO exchange rate - vault_balance = convert_to_mgno(vault_balance) - - metrics.stakeable_assets.set(int(vault_balance)) - - # calculate number of validators that can be registered - validators_count = vault_balance // DEPOSIT_AMOUNT - return validators_count - - async def poll_oracles_approval( keystore: BaseKeystore | None, validators: Sequence[Validator], @@ -265,6 +252,19 @@ async def poll_oracles_approval( ) +async def get_validators_count_from_vault_assets(harvest_params: HarvestParams | None) -> int: + vault_balance = await get_withdrawable_assets(harvest_params) + if settings.network in GNO_NETWORKS: + # apply GNO -> mGNO exchange rate + vault_balance = convert_to_mgno(vault_balance) + + metrics.stakeable_assets.set(int(vault_balance)) + + # calculate number of validators that can be registered + validators_count = vault_balance // DEPOSIT_AMOUNT + return validators_count + + # pylint: disable-next=too-many-arguments,too-many-locals async def create_approval_request( protocol_config: ProtocolConfig,