Skip to content

Commit

Permalink
Check length before accessing elements
Browse files Browse the repository at this point in the history
  • Loading branch information
pirapira committed Jul 12, 2019
1 parent 5ae9391 commit 1983528
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions raiden_contracts/deploy/contract_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ def _verify_service_registry_deployment(
""" Check an onchain deployment of ServiceRegistry and constructor arguments """
if to_checksum_address(service_registry.functions.token().call()) != token_address:
raise RuntimeError("service_registry has a wrong token address")
if len(constructor_arguments) != 2:
raise RuntimeError(
"service_registry was deployed with a wrong number of constructor arguments"
)
if token_address != constructor_arguments[0]:
raise RuntimeError(
f"expected token addredd {token_address} "
f"but the constructor argument for {CONTRACT_SERVICE_REGISTRY} is "
f"{constructor_arguments[0]}"
)
if len(constructor_arguments) != 2:
raise RuntimeError(
"service_registry was deployed with a wrong number of constructor arguments"
)

0 comments on commit 1983528

Please sign in to comment.