Skip to content

Commit d7eca57

Browse files
committed
nit(testing): Move valid_opcodes so merge catches the conflict (#2069)
* nit(testing): Move position of `valid_opcodes` so merge catches the conflict * fixup
1 parent 7a58fab commit d7eca57

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

  • packages/testing/src/execution_testing/forks/forks

packages/testing/src/execution_testing/forks/forks/forks.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,6 +3355,31 @@ def is_deployed(cls) -> bool:
33553355
"""Return True if this fork is deployed."""
33563356
return False
33573357

3358+
@classmethod
3359+
def valid_opcodes(
3360+
cls, *, block_number: int = 0, timestamp: int = 0
3361+
) -> List[Opcodes]:
3362+
"""Add SLOTNUM opcode for Amsterdam (EIP-7843)."""
3363+
return [Opcodes.SLOTNUM] + super(Amsterdam, cls).valid_opcodes(
3364+
block_number=block_number, timestamp=timestamp
3365+
)
3366+
3367+
@classmethod
3368+
def opcode_gas_map(
3369+
cls, *, block_number: int = 0, timestamp: int = 0
3370+
) -> Dict[OpcodeBase, int | Callable[[OpcodeBase], int]]:
3371+
"""Add SLOTNUM opcode gas cost for Amsterdam (EIP-7843)."""
3372+
gas_costs = cls.gas_costs(
3373+
block_number=block_number, timestamp=timestamp
3374+
)
3375+
base_map = super(Amsterdam, cls).opcode_gas_map(
3376+
block_number=block_number, timestamp=timestamp
3377+
)
3378+
return {
3379+
**base_map,
3380+
Opcodes.SLOTNUM: gas_costs.G_BASE,
3381+
}
3382+
33583383
@classmethod
33593384
def engine_new_payload_version(
33603385
cls, *, block_number: int = 0, timestamp: int = 0
@@ -3381,28 +3406,3 @@ def header_slot_number_required(
33813406
"""Slot number in header required from Amsterdam (EIP-7843)."""
33823407
del block_number, timestamp
33833408
return True
3384-
3385-
@classmethod
3386-
def opcode_gas_map(
3387-
cls, *, block_number: int = 0, timestamp: int = 0
3388-
) -> Dict[OpcodeBase, int | Callable[[OpcodeBase], int]]:
3389-
"""Add SLOTNUM opcode gas cost for Amsterdam (EIP-7843)."""
3390-
gas_costs = cls.gas_costs(
3391-
block_number=block_number, timestamp=timestamp
3392-
)
3393-
base_map = super(Amsterdam, cls).opcode_gas_map(
3394-
block_number=block_number, timestamp=timestamp
3395-
)
3396-
return {
3397-
**base_map,
3398-
Opcodes.SLOTNUM: gas_costs.G_BASE,
3399-
}
3400-
3401-
@classmethod
3402-
def valid_opcodes(
3403-
cls, *, block_number: int = 0, timestamp: int = 0
3404-
) -> List[Opcodes]:
3405-
"""Add SLOTNUM opcode for Amsterdam (EIP-7843)."""
3406-
return [Opcodes.SLOTNUM] + super(Amsterdam, cls).valid_opcodes(
3407-
block_number=block_number, timestamp=timestamp
3408-
)

0 commit comments

Comments
 (0)