Skip to content

Commit

Permalink
add fork for protected transaction field
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed Jan 10, 2025
1 parent b012d0b commit e658662
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions tests/frontier/opcodes/test_calldatacopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import pytest

from ethereum_test_forks import Fork
from ethereum_test_forks.forks.forks import Byzantium
from ethereum_test_tools import Account, Alloc, Bytecode, StateTestFiller, Transaction
from ethereum_test_tools.vm.opcode import Opcodes as Op


@pytest.mark.valid_from("Byzantium")
# @pytest.mark.valid_from("Byzantium")
@pytest.mark.parametrize(
"code,tx_data,code_address_storage,to_address_storage",
[
Expand All @@ -21,10 +23,14 @@
),
b"\x00",
Account(
storage={0x00: 0x3456000000000000000000000000000000000000000000000000000000000000}
storage={
0x00: 0x3456000000000000000000000000000000000000000000000000000000000000
}
),
Account(
storage={0x00: 0x3456000000000000000000000000000000000000000000000000000000000000}
storage={
0x00: 0x3456000000000000000000000000000000000000000000000000000000000000
}
),
),
(
Expand All @@ -38,10 +44,14 @@
),
b"\x01",
Account(
storage={0x00: 0x3400000000000000000000000000000000000000000000000000000000000000},
storage={
0x00: 0x3400000000000000000000000000000000000000000000000000000000000000
},
),
Account(
storage={0x00: 0x3400000000000000000000000000000000000000000000000000000000000000},
storage={
0x00: 0x3400000000000000000000000000000000000000000000000000000000000000
},
),
),
(
Expand Down Expand Up @@ -132,9 +142,7 @@
+ Op.JUMPDEST
+ Op.STOP
+ Op.JUMPDEST
+ Op.PUSH1[0x42]
+ Op.PUSH1[0x1F]
+ Op.MSTORE8
+ Op.MSTORE8(offset=0x1F, value=0x42)
+ Op.CALLDATACOPY(dest_offset=0x1F, offset=0x0, size=0x103)
+ Op.PUSH1[0x0]
+ Op.MLOAD
Expand Down Expand Up @@ -166,6 +174,7 @@
def test_calldatacopy(
state_test: StateTestFiller,
code: Bytecode,
fork: Fork,
tx_data: bytes,
pre: Alloc,
code_address_storage: Account,
Expand Down Expand Up @@ -212,6 +221,7 @@ def test_calldatacopy(
data=tx_data,
gas_limit=0x100_000,
gas_price=0x0A,
protected=fork >= Byzantium,
sender=pre.fund_eoa(),
to=to,
value=0x01,
Expand Down

0 comments on commit e658662

Please sign in to comment.