From 44931ac25454de34d43dc58569435e42f622f5ea Mon Sep 17 00:00:00 2001 From: spencer-tb Date: Wed, 11 Sep 2024 09:14:27 -0400 Subject: [PATCH] small fix --- src/ethereum_test_forks/forks/forks.py | 28 ++++++++++++++----- .../test_codecopy_ext_precompile.py | 6 ++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/ethereum_test_forks/forks/forks.py b/src/ethereum_test_forks/forks/forks.py index 88c9910f12..8232c376e2 100644 --- a/src/ethereum_test_forks/forks/forks.py +++ b/src/ethereum_test_forks/forks/forks.py @@ -404,7 +404,9 @@ def call_opcodes( """ At Homestead, DELEGATECALL opcode was introduced. """ - return [(Opcodes.DELEGATECALL, EVMCodeType.LEGACY),] + super( + return [ + (Opcodes.DELEGATECALL, EVMCodeType.LEGACY), + ] + super( Homestead, cls ).call_opcodes(block_number, timestamp) @@ -449,7 +451,9 @@ def call_opcodes( """ At Byzantium, STATICCALL opcode was introduced. """ - return [(Opcodes.STATICCALL, EVMCodeType.LEGACY),] + super( + return [ + (Opcodes.STATICCALL, EVMCodeType.LEGACY), + ] + super( Byzantium, cls ).call_opcodes(block_number, timestamp) @@ -483,7 +487,9 @@ def create_opcodes( """ At Constantinople, `CREATE2` opcode is added. """ - return [(Opcodes.CREATE2, EVMCodeType.LEGACY),] + super( + return [ + (Opcodes.CREATE2, EVMCodeType.LEGACY), + ] + super( Constantinople, cls ).create_opcodes(block_number, timestamp) @@ -974,7 +980,7 @@ def pre_allocation_blockchain(cls) -> Mapping: type tests. """ new_allocation = { - 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE: { + Address(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE): { "nonce": 1, "code": ( "0x60203611603157600143035f35116029575f35612000014311602957612000" @@ -1020,7 +1026,10 @@ def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCo """ EOF V1 is supported starting from this fork. """ - return super(CancunEIP7692, cls,).evm_code_types( # noqa: SC200 + return super( + CancunEIP7692, + cls, + ).evm_code_types( # noqa: SC200 block_number, timestamp, ) + [EVMCodeType.EOF_V1] @@ -1049,7 +1058,9 @@ def create_opcodes( """ EOF V1 introduces `EOFCREATE`. """ - return [(Opcodes.EOFCREATE, EVMCodeType.EOF_V1),] + super( + return [ + (Opcodes.EOFCREATE, EVMCodeType.EOF_V1), + ] + super( CancunEIP7692, cls # noqa: SC200 ).create_opcodes(block_number, timestamp) @@ -1084,7 +1095,10 @@ def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCo """ EOF V1 is supported starting from this fork. """ - return super(PragueEIP7692, cls,).evm_code_types( # noqa: SC200 + return super( + PragueEIP7692, + cls, + ).evm_code_types( # noqa: SC200 block_number, timestamp, ) + [EVMCodeType.EOF_V1] diff --git a/tests/verkle/eip4762_verkle_gas_witness/test_codecopy_ext_precompile.py b/tests/verkle/eip4762_verkle_gas_witness/test_codecopy_ext_precompile.py index f0d376e098..886e4e9ecb 100644 --- a/tests/verkle/eip4762_verkle_gas_witness/test_codecopy_ext_precompile.py +++ b/tests/verkle/eip4762_verkle_gas_witness/test_codecopy_ext_precompile.py @@ -7,7 +7,7 @@ import pytest -from ethereum_test_forks import Verkle +from ethereum_test_forks import Fork, Verkle from ethereum_test_tools import ( Account, Address, @@ -21,8 +21,6 @@ ) from ethereum_test_tools.vm.opcode import Opcodes as Op from ethereum_test_types.verkle.helpers import chunkify_code -from ethereum_test_forks import Fork - # TODO(verkle): Update reference spec version REFERENCE_SPEC_GIT_PATH = "EIPS/eip-4762.md" @@ -78,7 +76,7 @@ def test_extcodecopy_precompile(blockchain_test: BlockchainTestFiller, fork: For if target == system_contract_address: code = Account(**fork.pre_allocation_blockchain()[system_contract_address]).code code_chunks = chunkify_code(code) - for i in range(5): + for i, chunk in enumerate(code_chunks, start=0): witness_check.add_code_chunk( address=TestAddress2, chunk_number=i, value=code_chunks[i] )