Skip to content

Commit

Permalink
Test invalid limits in test_constructor_call in
Browse files Browse the repository at this point in the history
test_token_network.py

This closes
#656
  • Loading branch information
pirapira authored and karlb committed Mar 4, 2019
1 parent efe153d commit 64c127c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions raiden_contracts/tests/test_token_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,46 @@ def test_constructor_call(
token_network_deposit_limit,
])

# failure with channel_participant_deposit_limit being zero
with pytest.raises(TransactionFailed):
get_token_network([
custom_token.address,
secret_registry_contract.address,
chain_id,
TEST_SETTLE_TIMEOUT_MIN,
TEST_SETTLE_TIMEOUT_MAX,
deprecation_executor,
0,
token_network_deposit_limit,
])

# failure with both limits being zero
with pytest.raises(TransactionFailed):
get_token_network([
custom_token.address,
secret_registry_contract.address,
chain_id,
TEST_SETTLE_TIMEOUT_MIN,
TEST_SETTLE_TIMEOUT_MAX,
deprecation_executor,
0,
0,
])

# failure with channel_participant_deposit_limit being bigger than
# token_network_deposit_limit.
with pytest.raises(TransactionFailed):
get_token_network([
custom_token.address,
secret_registry_contract.address,
chain_id,
TEST_SETTLE_TIMEOUT_MIN,
TEST_SETTLE_TIMEOUT_MAX,
deprecation_executor,
token_network_deposit_limit,
channel_participant_deposit_limit,
])

# see a success to make sure that the above failures are meaningful
get_token_network([
custom_token.address,
Expand Down

0 comments on commit 64c127c

Please sign in to comment.