Skip to content

Commit

Permalink
Fix index var name
Browse files Browse the repository at this point in the history
  • Loading branch information
tsudmi committed Jan 30, 2023
1 parent 3b28632 commit f273a30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/validators/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ async def register_single_validator(

credentials = get_eth1_withdrawal_credentials(VAULT_CONTRACT_ADDRESS)
tx_validator = _encode_tx_validator(credentials, validator)
proof = tree.get_proof([tx_validator, validator.index]) # type: ignore
proof = tree.get_proof([tx_validator, validator.deposit_data_index]) # type: ignore

tx_data = SingleValidatorRegistration(
keeperParams=KeeperApprovalParams(
Expand Down Expand Up @@ -268,7 +268,7 @@ async def register_multiple_validator(
for validator in validators:
tx_validator = _encode_tx_validator(credentials, validator)
tx_validators.append(tx_validator)
leaves.append((tx_validator, validator.index))
leaves.append((tx_validator, validator.deposit_data_index))

multi_proof = tree.get_multi_proof(leaves)
sorted_tx_validators: list[bytes] = [v[0] for v in multi_proof.leaves]
Expand Down
2 changes: 1 addition & 1 deletion src/validators/typings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class NetworkValidator:

@dataclass
class Validator:
index: int
deposit_data_index: int
public_key: HexStr
signature: HexStr

Expand Down
2 changes: 1 addition & 1 deletion src/validators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async def load_deposit_data() -> DepositData:
validators: list[Validator] = []
for i, data in enumerate(deposit_data):
validator = Validator(
index=i,
deposit_data_index=i,
public_key=add_0x_prefix(data['pubkey']),
signature=add_0x_prefix(data['signature']),
)
Expand Down

0 comments on commit f273a30

Please sign in to comment.