Skip to content
Closed
Show file tree
Hide file tree
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
12 changes: 0 additions & 12 deletions raiden/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,6 @@ class InvalidTokenAddress(RaidenError):
""" Raised if the token address is invalid """


class InvalidTokenNetworkDepositLimit(RaidenError):
""" Raised when an invalid token network deposit
limit is passed to the token network registry proxy.
"""


class InvalidChannelParticipantDepositLimit(RaidenError):
""" Raised when an invalid channel participant
deposit limit is passed to the token network registry proxy.
"""


class STUNUnavailableException(RaidenError):
pass

Expand Down
9 changes: 3 additions & 6 deletions raiden/network/proxies/token_network_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
from raiden.constants import NULL_ADDRESS, NULL_ADDRESS_BYTES
from raiden.exceptions import (
BrokenPreconditionError,
InvalidChannelParticipantDepositLimit,
InvalidToken,
InvalidTokenAddress,
InvalidTokenNetworkDepositLimit,
RaidenRecoverableError,
RaidenUnrecoverableError,
)
Expand Down Expand Up @@ -113,15 +110,15 @@ def add_token(
)

if token_address == NULL_ADDRESS_BYTES:
raise InvalidTokenAddress("The call to register a token at 0x00..00 will fail.")
raise BrokenPreconditionError("The call to register a token at 0x00..00 will fail.")

if token_network_deposit_limit <= 0:
raise InvalidTokenNetworkDepositLimit(
raise BrokenPreconditionError(
f"Token network deposit limit of {token_network_deposit_limit} is invalid"
)

if channel_participant_deposit_limit > token_network_deposit_limit:
raise InvalidChannelParticipantDepositLimit(
raise BrokenPreconditionError(
f"Channel participant deposit limit of "
f"{channel_participant_deposit_limit} is invalid"
)
Expand Down