Skip to content

Commit 554c353

Browse files
authored
feat(benchmark/tests): Extra sstore benchmark tests (#2130)
1 parent 72addb2 commit 554c353

2 files changed

Lines changed: 502 additions & 3 deletions

File tree

packages/testing/src/execution_testing/benchmark/benchmark_code_generator.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
optimized bytecode patterns.
44
"""
55

6-
from dataclasses import dataclass
6+
from dataclasses import dataclass, field
77

8-
from execution_testing.base_types import Address
8+
from execution_testing.base_types import Address, Storage
99
from execution_testing.forks import Fork
1010
from execution_testing.specs.benchmark import BenchmarkCodeGenerator
1111
from execution_testing.test_types import Alloc
@@ -17,6 +17,7 @@ class JumpLoopGenerator(BenchmarkCodeGenerator):
1717
"""Generates bytecode that loops execution using JUMP operations."""
1818

1919
contract_balance: int = 0
20+
contract_storage: Storage = field(default_factory=Storage)
2021

2122
def deploy_contracts(self, *, pre: Alloc, fork: Fork) -> Address:
2223
"""Deploy the looping contract."""
@@ -31,7 +32,9 @@ def deploy_contracts(self, *, pre: Alloc, fork: Fork) -> Address:
3132
fork=fork,
3233
)
3334
self._contract_address = pre.deploy_contract(
34-
code=code, balance=self.contract_balance
35+
code=code,
36+
balance=self.contract_balance,
37+
storage=self.contract_storage,
3538
)
3639
return self._contract_address
3740

0 commit comments

Comments
 (0)