Skip to content

Commit

Permalink
Replace Exception with ValueError for input validation in MultiSigWal…
Browse files Browse the repository at this point in the history
…letGenerator
  • Loading branch information
yavrsky committed Dec 18, 2024
1 parent 5e7eb65 commit 96cb019
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ def generate_storage(cls, **kwargs) -> Dict[str, str]:
required_confirmations = kwargs.get('required_confirmations', 1)

if len(originator_addresses) > cls.MAX_OWNER_COUNT:
raise Exception('Number of originators must not be more than 50')
raise ValueError('Number of originators must not be more than 50')
if required_confirmations > len(originator_addresses):
raise Exception('Number of required confirmations must be less'
'or equal than number of originators')
raise ValueError('Number of required confirmations must be less'
'or equal than number of originators')

storage: Dict[str, str] = {}
for originator_address in originator_addresses:
if originator_address == cls.ZERO_ADDRESS:
raise Exception('Originator address must not be zero')
raise ValueError('Originator address must not be zero')
is_owner_value_slot = cls.calculate_mapping_value_slot(
cls.IS_OWNER_SLOT,
originator_address,
Expand Down

0 comments on commit 96cb019

Please sign in to comment.