Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions packages/testing/src/consensus_testing/forks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,11 @@ class BaseForkMeta(ABCMeta):
For example, if ForkB inherits from ForkA, then ForkA precedes ForkB.
"""

@abstractmethod
def name(cls) -> str:
"""Return the name of the fork."""
pass

def __repr__(cls) -> str:
def __repr__(cls: "type[BaseFork]") -> str:
"""Print the name of the fork, instead of the class."""
return cls.name()

def __le__(cls, other: "BaseForkMeta") -> bool:
def __le__(cls: "type[BaseFork]", other: "type[BaseFork]") -> bool:
"""Check if this fork is older or equal to another (cls <= other)."""
return cls is other or issubclass(other, cls)

Expand Down
Loading