Fix tests

This commit is contained in:
Hsiao-Wei Wang 2023-05-10 22:26:55 +08:00
parent 59455719d1
commit 74596190e7
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
4 changed files with 14 additions and 1 deletions

View File

@ -53,6 +53,9 @@ DENEB_FORK_EPOCH: 18446744073709551615
# EIP6110
EIP6110_FORK_VERSION: 0x05000000 # temporary stub
EIP6110_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000000 # temporary stub
EIP7002_FORK_EPOCH: 18446744073709551615
# Time parameters

View File

@ -52,6 +52,9 @@ DENEB_FORK_EPOCH: 18446744073709551615
# EIP6110
EIP6110_FORK_VERSION: 0x05000001
EIP6110_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000001
EIP7002_FORK_EPOCH: 18446744073709551615
# Time parameters

View File

@ -16,6 +16,7 @@ from eth2spec.test.helpers.constants import (
CAPELLA,
DENEB,
EIP6110,
EIP7002,
)
from eth2spec.test.helpers.deposits import (
prepare_state_and_deposit,
@ -179,6 +180,9 @@ def do_fork(state, spec, post_spec, fork_epoch, with_block=True, sync_aggregate=
elif post_spec.fork == EIP6110:
assert state.fork.previous_version == post_spec.config.DENEB_FORK_VERSION
assert state.fork.current_version == post_spec.config.EIP6110_FORK_VERSION
elif post_spec.fork == EIP7002:
assert state.fork.previous_version == post_spec.config.DENEB_FORK_VERSION
assert state.fork.current_version == post_spec.config.EIP7002_FORK_VERSION
if with_block:
return state, _state_transition_and_sign_block_at_slot(

View File

@ -1,5 +1,5 @@
from eth2spec.test.helpers.constants import (
ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110,
ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7002,
)
from eth2spec.test.helpers.execution_payload import (
compute_el_header_block_hash,
@ -90,6 +90,9 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
elif spec.fork == EIP6110:
previous_version = spec.config.DENEB_FORK_VERSION
current_version = spec.config.EIP6110_FORK_VERSION
elif spec.fork == EIP7002:
previous_version = spec.config.DENEB_FORK_VERSION
current_version = spec.config.EIP7002_FORK_VERSION
state = spec.BeaconState(
genesis_time=0,