Skip to content

Commit

Permalink
fix: simplify changes
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed Mar 14, 2024
1 parent 37990c9 commit 6dce334
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/ethereum_test_tools/common/base_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def or_none(cls: Type[T], input: T | FixedSizeBytesConvertible | None) -> T | No

def __eq__(self, other: object) -> bool:
"""
Compares two FixedSizeBytes objects.
Compares two FixedSizeBytes objects to be equal.
"""
if not isinstance(other, FixedSizeBytes):
assert (
Expand All @@ -187,17 +187,9 @@ def __eq__(self, other: object) -> bool:

def __ne__(self, other: object) -> bool:
"""
Compares two FixedSizeBytes objects.
Compares two FixedSizeBytes objects to be not equal.
"""
if not isinstance(other, FixedSizeBytes):
assert (
isinstance(other, str)
or isinstance(other, int)
or isinstance(other, bytes)
or isinstance(other, SupportsBytes)
)
other = self.__class__(other)
return super().__ne__(other)
return not self.__eq__(other)


class Address(FixedSizeBytes[20]): # type: ignore
Expand Down

0 comments on commit 6dce334

Please sign in to comment.