Skip to content

Commit

Permalink
Test MonitoringService deployment with zero SR
Browse files Browse the repository at this point in the history
If ServiceRegistry address is zero, MonitoringService's constructor
is supposed to fail. This commit adds a test for this behavior.
  • Loading branch information
pirapira committed Nov 2, 2019
1 parent b9fa29d commit 7e09dcc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions raiden_contracts/tests/test_monitoring_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,22 @@ def test_monitoring_service_deploy_with_service_registry_without_code(
_udc_address=uninitialized_user_deposit_contract.address,
_token_network_registry_address=token_network_registry_contract.address,
)


def test_monitoring_service_deploy_with_service_registry_zero(
deploy_tester_contract: Callable,
custom_token: Contract,
uninitialized_user_deposit_contract: Contract,
token_network_registry_contract: Contract,
) -> None:
# No good error message is available due to
# https://github.com/raiden-network/raiden-contracts/issues/1329
# with pytest.raises(TransactionFailed, match="ServiceRegistry at address zero"):
with pytest.raises(TransactionFailed):
deploy_tester_contract(
contract_name=CONTRACT_MONITORING_SERVICE,
_token_address=custom_token.address,
_service_registry_address=EMPTY_HEXADDRESS,
_udc_address=uninitialized_user_deposit_contract.address,
_token_network_registry_address=token_network_registry_contract.address,
)

0 comments on commit 7e09dcc

Please sign in to comment.