mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-09 09:14:32 +00:00
Fix block hash computation for deposit transition tests
Request hash is not considered in `compute_el_block_hash`, have to use one of the other overloads for this to work.
This commit is contained in:
parent
b1c9d279bd
commit
de52c76bd3
@ -12,7 +12,7 @@ from eth2spec.test.helpers.deposits import (
|
||||
prepare_deposit_request,
|
||||
)
|
||||
from eth2spec.test.helpers.execution_payload import (
|
||||
compute_el_block_hash,
|
||||
compute_el_block_hash_for_block,
|
||||
)
|
||||
from eth2spec.test.helpers.keys import privkeys, pubkeys
|
||||
from eth2spec.test.helpers.state import (
|
||||
@ -134,7 +134,7 @@ def prepare_state_and_block(spec,
|
||||
# Assign deposits and deposit requests
|
||||
block.body.deposits = deposits
|
||||
block.body.execution_requests.deposits = deposit_requests
|
||||
block.body.execution_payload.block_hash = compute_el_block_hash(spec, block.body.execution_payload, state)
|
||||
block.body.execution_payload.block_hash = compute_el_block_hash_for_block(spec, block)
|
||||
|
||||
return state, block
|
||||
|
||||
@ -251,7 +251,7 @@ def test_deposit_transition__deposit_and_top_up_same_block(spec, state):
|
||||
# Artificially assign deposit's pubkey to a deposit request of the same block
|
||||
top_up_keys = [block.body.deposits[0].data.pubkey]
|
||||
block.body.execution_requests.deposits[0].pubkey = top_up_keys[0]
|
||||
block.body.execution_payload.block_hash = compute_el_block_hash(spec, block.body.execution_payload, state)
|
||||
block.body.execution_payload.block_hash = compute_el_block_hash_for_block(spec, block)
|
||||
|
||||
pre_pending_deposits = len(state.pending_deposits)
|
||||
|
||||
|
@ -70,7 +70,7 @@ def compute_requests_hash(block_requests):
|
||||
m = sha256()
|
||||
for r in block_requests:
|
||||
if len(r) > 1:
|
||||
m.update(sha256(r))
|
||||
m.update(sha256(r).digest())
|
||||
return m.digest()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user