BLS withdrawal byte is formatted as int now, but still one byte. Justin changed spec, now fix tests + configs
This commit is contained in:
parent
e86771250b
commit
2d636ddf5a
|
@ -48,7 +48,7 @@ GENESIS_FORK_VERSION: 0x00000000
|
|||
GENESIS_SLOT: 0
|
||||
# 2**64 - 1
|
||||
FAR_FUTURE_EPOCH: 18446744073709551615
|
||||
BLS_WITHDRAWAL_PREFIX: 0x00
|
||||
BLS_WITHDRAWAL_PREFIX: 0
|
||||
|
||||
|
||||
# Time parameters
|
||||
|
|
|
@ -47,7 +47,7 @@ GENESIS_FORK_VERSION: 0x00000000
|
|||
GENESIS_SLOT: 0
|
||||
# 2**64 - 1
|
||||
FAR_FUTURE_EPOCH: 18446744073709551615
|
||||
BLS_WITHDRAWAL_PREFIX: 0x00
|
||||
BLS_WITHDRAWAL_PREFIX: 0
|
||||
|
||||
|
||||
# Time parameters
|
||||
|
|
|
@ -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 + spec.hash(pubkey)[1:]
|
||||
withdrawal_credentials = spec.int_to_bytes(spec.BLS_WITHDRAWAL_PREFIX, length=1) + spec.hash(pubkey)[1:]
|
||||
|
||||
deposit, root, deposit_data_leaves = build_deposit(
|
||||
spec,
|
||||
|
|
|
@ -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 + spec.hash(transfer.pubkey)[1:]
|
||||
spec.int_to_bytes(spec.BLS_WITHDRAWAL_PREFIX, length=1) + 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 + spec.hash(b"junk")[1:]
|
||||
withdrawal_credentials = spec.int_to_bytes(spec.BLS_WITHDRAWAL_PREFIX, length=1) + spec.hash(b"junk")[1:]
|
||||
deposit = prepare_state_and_deposit(
|
||||
spec,
|
||||
state,
|
||||
|
|
Loading…
Reference in New Issue