Fix tests to use new constant name
This commit is contained in:
parent
481c9664be
commit
e86771250b
|
@ -67,7 +67,7 @@ def prepare_state_and_deposit(spec, state, validator_index, amount, withdrawal_c
|
|||
|
||||
# insecurely use pubkey as withdrawal key if no credentials provided
|
||||
if withdrawal_credentials is None:
|
||||
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX_BYTE + spec.hash(pubkey)[1:]
|
||||
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX + spec.hash(pubkey)[1:]
|
||||
|
||||
deposit, root, deposit_data_leaves = build_deposit(
|
||||
spec,
|
||||
|
|
|
@ -5,7 +5,7 @@ from eth2spec.utils.ssz.ssz_impl import hash_tree_root
|
|||
def build_mock_validator(spec, i: int, balance: int):
|
||||
pubkey = pubkeys[i]
|
||||
# insecurely use pubkey as withdrawal key as well
|
||||
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX_BYTE + spec.hash(pubkey)[1:]
|
||||
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX + spec.hash(pubkey)[1:]
|
||||
return spec.Validator(
|
||||
pubkey=pubkeys[i],
|
||||
withdrawal_credentials=withdrawal_credentials,
|
||||
|
|
|
@ -32,7 +32,7 @@ def get_valid_transfer(spec, state, slot=None, sender_index=None, amount=None, f
|
|||
|
||||
# ensure withdrawal_credentials reproducible
|
||||
state.validator_registry[transfer.sender].withdrawal_credentials = (
|
||||
spec.BLS_WITHDRAWAL_PREFIX_BYTE + spec.hash(transfer.pubkey)[1:]
|
||||
spec.BLS_WITHDRAWAL_PREFIX + spec.hash(transfer.pubkey)[1:]
|
||||
)
|
||||
|
||||
return transfer
|
||||
|
|
|
@ -101,7 +101,7 @@ def test_invalid_sig_top_up(spec, state):
|
|||
def test_invalid_withdrawal_credentials_top_up(spec, state):
|
||||
validator_index = 0
|
||||
amount = spec.MAX_EFFECTIVE_BALANCE // 4
|
||||
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX_BYTE + spec.hash(b"junk")[1:]
|
||||
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX + spec.hash(b"junk")[1:]
|
||||
deposit = prepare_state_and_deposit(
|
||||
spec,
|
||||
state,
|
||||
|
|
Loading…
Reference in New Issue