Fix EIP4844 previous_version in tests

This commit is contained in:
Hsiao-Wei Wang 2022-11-23 05:09:12 +08:00
parent 2d99f1b551
commit d202f620de
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
2 changed files with 4 additions and 1 deletions

View File

@ -165,6 +165,9 @@ def do_fork(state, spec, post_spec, fork_epoch, with_block=True, operation_dict=
elif post_spec.fork == CAPELLA: elif post_spec.fork == CAPELLA:
assert state.fork.previous_version == post_spec.config.BELLATRIX_FORK_VERSION assert state.fork.previous_version == post_spec.config.BELLATRIX_FORK_VERSION
assert state.fork.current_version == post_spec.config.CAPELLA_FORK_VERSION assert state.fork.current_version == post_spec.config.CAPELLA_FORK_VERSION
elif post_spec.fork == EIP4844:
assert state.fork.previous_version == post_spec.config.CAPELLA_FORK_VERSION
assert state.fork.current_version == post_spec.config.EIP4844_FORK_VERSION
if with_block: if with_block:
return state, _state_transition_and_sign_block_at_slot(post_spec, state, operation_dict=operation_dict) return state, _state_transition_and_sign_block_at_slot(post_spec, state, operation_dict=operation_dict)

View File

@ -60,7 +60,7 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
previous_version = spec.config.BELLATRIX_FORK_VERSION previous_version = spec.config.BELLATRIX_FORK_VERSION
current_version = spec.config.CAPELLA_FORK_VERSION current_version = spec.config.CAPELLA_FORK_VERSION
elif spec.fork == EIP4844: elif spec.fork == EIP4844:
previous_version = spec.config.BELLATRIX_FORK_VERSION previous_version = spec.config.CAPELLA_FORK_VERSION
current_version = spec.config.EIP4844_FORK_VERSION current_version = spec.config.EIP4844_FORK_VERSION
state = spec.BeaconState( state = spec.BeaconState(