Skip to content

Commit 314f18d

Browse files
winsvegamarioevz
authored andcommitted
make test scenarios execute compatible
1 parent 6787fbe commit 314f18d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/frontier/scenarios/programs/context_calls.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,14 @@ class ProgramGasPrice(ScenarioTestProgram):
177177

178178
def make_test_code(self, pre: Alloc, fork: Fork) -> Bytecode:
179179
"""Test code."""
180-
return Op.MSTORE(0, Op.GASPRICE) + Op.RETURN(0, 32)
180+
gas_hash = make_gas_hash_contract(pre)
181+
182+
return (
183+
Op.MSTORE(64, Op.GASPRICE)
184+
+ Op.CALL(Op.SUB(Op.GAS, 200000), gas_hash, 0, 64, 32, 0, 0)
185+
+ Op.MSTORE(0, 1)
186+
+ Op.RETURN(0, 32)
187+
)
181188

182189
@cached_property
183190
def id(self) -> str:
@@ -186,7 +193,7 @@ def id(self) -> str:
186193

187194
def result(self) -> ProgramResult:
188195
"""Test result."""
189-
return ProgramResult(result=ScenarioExpectOpcode.GASPRICE)
196+
return ProgramResult(result=1)
190197

191198

192199
class ProgramExtCodeCopyExtCodeSize(ScenarioTestProgram):

tests/frontier/scenarios/test_scenarios.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ def scenarios(fork: Fork, pre: Alloc, test_program: ScenarioTestProgram) -> List
152152
program_classes,
153153
ids=[cls.id for cls in program_classes],
154154
)
155-
@pytest.mark.execute(pytest.mark.skip("Requires gasprice"))
156155
def test_scenarios(
157156
blockchain_test: BlockchainTestFiller,
158157
fork: Fork,

0 commit comments

Comments
 (0)