File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ """Test for account touching behavior introduced in Frontier."""
Original file line number Diff line number Diff line change 1+ """test account touch behavior."""
2+
3+ import pytest
4+ from execution_testing import (
5+ Account ,
6+ Alloc ,
7+ Environment ,
8+ Op ,
9+ StateTestFiller ,
10+ Transaction ,
11+ )
12+
13+
14+ @pytest .mark .valid_from ("Frontier" )
15+ @pytest .mark .valid_until ("Berlin" )
16+ def test_zero_gas_price_and_touching (
17+ state_test : StateTestFiller ,
18+ pre : Alloc ,
19+ ) -> None :
20+ """
21+ Test sending a zero gasprice transaction in early forks respects
22+ account touching rules.
23+ """
24+ sender = pre .fund_eoa ()
25+ value = 0x01
26+
27+ contract = pre .deploy_contract (
28+ code = (Op .SSTORE (0 , value ) + Op .STOP ),
29+ )
30+
31+ tx = Transaction (
32+ gas_limit = 500_000 ,
33+ to = contract ,
34+ gas_price = 0 ,
35+ sender = sender ,
36+ protected = False ,
37+ )
38+
39+ state_test (
40+ env = Environment (),
41+ pre = pre ,
42+ tx = tx ,
43+ post = {contract : Account (storage = {0 : value })},
44+ )
You can’t perform that action at this time.
0 commit comments