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

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,