Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 committed Aug 23, 2023
1 parent 31d5f88 commit 67c14b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/validators/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,16 @@ async def register_validators(keystores: Keystores, deposit_data: DepositData) -
)
return

# get latest registry root
latest_registry_root = await validators_registry_contract.get_registry_root()
logger.debug('Fetched latest validators registry root: %s', latest_registry_root)
registry_root = None

while True:
latest_registry_root = await validators_registry_contract.get_registry_root()

if not registry_root or registry_root != latest_registry_root:
registry_root = latest_registry_root
oracles_request = await get_oracles_request(
logger.debug('Fetched latest validators registry root: %s', registry_root)

oracles_request = await create_approval_request(
registry_root=registry_root,
oracles=oracles,
keystores=keystores,
Expand All @@ -91,7 +92,6 @@ async def register_validators(keystores: Keystores, deposit_data: DepositData) -
break
except Exception as e:
logger.exception(e)
latest_registry_root = await validators_registry_contract.get_registry_root()

if len(validators) == 1:
validator = validators[0]
Expand All @@ -116,7 +116,7 @@ async def register_validators(keystores: Keystores, deposit_data: DepositData) -
logger.info('Successfully registered validators with public keys %s', pub_keys)


async def get_oracles_request(
async def create_approval_request(
oracles: Oracles, keystores: Keystores, validators: list[Validator], registry_root: Bytes32
) -> ApprovalRequest:
"""Generate validator registration request data"""
Expand Down

0 comments on commit 67c14b1

Please sign in to comment.