Skip to content

Commit

Permalink
fix(fw): remove unnecessary init methods from exception classes
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed Mar 26, 2024
1 parent f9b3380 commit d37bff4
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions src/ethereum_test_tools/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ class InvalidType(Exception):

key_or_value: Any

def __init__(self, key_or_value: Any, *args):
super().__init__(args)
self.key_or_value = key_or_value

def __str__(self):
"""Print exception string"""
return f"invalid type for key/value: {self.key_or_value}"
Expand All @@ -114,10 +110,6 @@ class InvalidValue(Exception):

key_or_value: Any

def __init__(self, key_or_value: Any, *args):
super().__init__(args)
self.key_or_value = key_or_value

def __str__(self):
"""Print exception string"""
return f"invalid value for key/value: {self.key_or_value}"
Expand All @@ -133,20 +125,6 @@ class AmbiguousKeyValue(Exception):
key_2: str | int
val_2: str | int

def __init__(
self,
key_1: str | int,
val_1: str | int,
key_2: str | int,
val_2: str | int,
*args,
):
super().__init__(args)
self.key_1 = key_1
self.val_1 = val_1
self.key_2 = key_2
self.val_2 = val_2

def __str__(self):
"""Print exception string"""
return f"""
Expand All @@ -164,11 +142,6 @@ class MissingKey(TraceableException):
address: Address
key: int

def __init__(self, address: Address, key: int, *args):
super().__init__(args)
self.address = address
self.key = key

@property
def markers(self) -> Generator[TraceMarkerDescriptor, None, None]:
"""
Expand Down Expand Up @@ -210,13 +183,6 @@ class KeyValueMismatch(TraceableException):
want: int
got: int

def __init__(self, address: Address, key: int, want: int, got: int, *args):
super().__init__(args)
self.address = address
self.key = key
self.want = want
self.got = got

@property
def markers(self) -> Generator[TraceMarkerDescriptor, None, None]:
"""
Expand Down Expand Up @@ -465,12 +431,6 @@ class NonceMismatch(TraceableException):
want: int | None
got: int | None

def __init__(self, address: Address, want: int | None, got: int | None, *args):
super().__init__(args)
self.address = address
self.want = want
self.got = got

@property
def markers(self) -> Generator[TraceMarkerDescriptor, None, None]:
"""
Expand Down Expand Up @@ -511,12 +471,6 @@ class BalanceMismatch(TraceableException):
want: int | None
got: int | None

def __init__(self, address: Address, want: int | None, got: int | None, *args):
super().__init__(args)
self.address = address
self.want = want
self.got = got

@property
def markers(self) -> Generator[TraceMarkerDescriptor, None, None]:
"""
Expand Down Expand Up @@ -549,12 +503,6 @@ class CodeMismatch(TraceableException):
want: str | None
got: str | None

def __init__(self, address: Address, want: str | None, got: str | None, *args):
super().__init__(args)
self.address = address
self.want = want
self.got = got

@property
def markers(self) -> Generator[TraceMarkerDescriptor, None, None]:
"""
Expand Down

0 comments on commit d37bff4

Please sign in to comment.