mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-19 23:19:28 +00:00
Add test for compute_fork_digest
This commit is contained in:
parent
e6d8a8641d
commit
ffeecfbca5
@ -314,6 +314,19 @@ def test_get_block_signature(spec, state):
|
||||
)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
def test_compute_fork_digest(spec, state):
|
||||
actual_fork_digest = spec.compute_fork_digest(state.fork.current_version, state.genesis_validators_root)
|
||||
|
||||
expected_fork_data_root = spec.hash_tree_root(
|
||||
spec.ForkData(current_version=state.fork.current_version,
|
||||
genesis_validators_root=state.genesis_validators_root))
|
||||
expected_fork_digest = spec.ForkDigest(expected_fork_data_root[:4])
|
||||
|
||||
assert actual_fork_digest == expected_fork_digest
|
||||
|
||||
|
||||
# Attesting
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user