Skip to content

Commit bccc85b

Browse files
marioevzfselmo
authored andcommitted
feat(forks): Add parent method
1 parent f75461f commit bccc85b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ethereum_test_forks/base_fork.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,15 @@ def ignore(cls) -> bool:
539539
"""Return whether the fork should be ignored during test generation."""
540540
return cls._ignore
541541

542+
@classmethod
543+
def parent(cls) -> Type["BaseFork"] | None:
544+
"""Return the parent fork."""
545+
base_class = cls.__bases__[0]
546+
assert issubclass(base_class, BaseFork)
547+
if base_class == BaseFork:
548+
return None
549+
return base_class
550+
542551

543552
# Fork Type
544553
Fork = Type[BaseFork]

0 commit comments

Comments
 (0)