Skip to content

Commit f5a54b3

Browse files
committed
fix: Tox
1 parent e2af98b commit f5a54b3

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/ethereum_clis/cli_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def print(self):
181181
}
182182

183183

184-
def validate_opcode(obj: Any) -> Opcodes:
184+
def validate_opcode(obj: Any) -> Opcodes | Opcode:
185185
"""Validate an opcode from a string."""
186186
if isinstance(obj, Opcode) or isinstance(obj, Opcodes):
187187
return obj
@@ -207,7 +207,7 @@ def __add__(self, other: Self) -> Self:
207207
new_dict = self.model_dump() | other.model_dump()
208208
for match_key in self.root.keys() & other.root.keys():
209209
new_dict[match_key] = self.root[match_key] + other.root[match_key]
210-
return OpcodeCount(new_dict)
210+
return self.__class__(new_dict)
211211

212212

213213
class Result(CamelModel):

src/ethereum_test_specs/blockchain.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,9 @@ def make_fixture(
752752
)
753753
self.check_exception_test(exception=invalid_blocks > 0)
754754
self.verify_post_state(t8n, t8n_state=alloc)
755+
info = {}
756+
if self._opcode_count is not None:
757+
info["opcode_count"] = self._opcode_count.model_dump()
755758
return BlockchainFixture(
756759
fork=fork,
757760
genesis=genesis.header,
@@ -766,9 +769,7 @@ def make_fixture(
766769
blob_schedule=FixtureBlobSchedule.from_blob_schedule(fork.blob_schedule()),
767770
chain_id=self.chain_id,
768771
),
769-
info={
770-
"opcode_count": self._opcode_count.model_dump(),
771-
},
772+
info=info,
772773
)
773774

774775
def make_hive_fixture(
@@ -821,6 +822,9 @@ def make_hive_fixture(
821822
self.verify_post_state(t8n, t8n_state=alloc)
822823

823824
# Create base fixture data, common to all fixture formats
825+
info = {}
826+
if self._opcode_count is not None:
827+
info["opcode_count"] = self._opcode_count.model_dump()
824828
fixture_data = {
825829
"fork": fork,
826830
"genesis": genesis.header,
@@ -834,9 +838,7 @@ def make_hive_fixture(
834838
chain_id=self.chain_id,
835839
blob_schedule=FixtureBlobSchedule.from_blob_schedule(fork.blob_schedule()),
836840
),
837-
"info": {
838-
"opcode_count": self._opcode_count.model_dump(),
839-
},
841+
"info": info,
840842
}
841843

842844
# Add format-specific fields

0 commit comments

Comments
 (0)