missed one case, fix withdrawal byte <> int problem

This commit is contained in:
protolambda 2019-06-11 17:32:42 +02:00
parent 2d636ddf5a
commit 7fafebd6cf
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 1 additions and 1 deletions

View File

@ -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 + spec.hash(pubkey)[1:]
withdrawal_credentials = spec.int_to_bytes(spec.BLS_WITHDRAWAL_PREFIX, length=1) + spec.hash(pubkey)[1:]
return spec.Validator(
pubkey=pubkeys[i],
withdrawal_credentials=withdrawal_credentials,