Skip to content

Commit bcf950b

Browse files
Yoichi Hiraipirapira
authored andcommitted
Fix test_startup.py
Before this commit, the test did not expect mainnet deployment information, but now we have it.
1 parent c4790df commit bcf950b

File tree

3 files changed

+7
-28
lines changed

3 files changed

+7
-28
lines changed

raiden/tests/unit/test_startup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ def test_setup_contracts():
7979
config = {"environment_type": Environment.PRODUCTION}
8080
contracts = setup_contracts_or_exit(config, 1)
8181
assert "contracts_path" in config
82-
assert not raiden_contracts_in_data(contracts)
83-
assert not service_contracts_in_data(contracts)
82+
assert raiden_contracts_in_data(contracts)
83+
assert service_contracts_in_data(contracts)
8484

8585
# Mainnet development -- NOT allowed
8686
config = {"environment_type": Environment.DEVELOPMENT}
87-
with pytest.raises(SystemExit):
88-
setup_contracts_or_exit(config, 1)
87+
contracts = setup_contracts_or_exit(config, 1)
88+
assert "contracts_path" in config
89+
assert raiden_contracts_in_data(contracts)
90+
assert service_contracts_in_data(contracts)
8991

9092
# Ropsten production
9193
config = {"environment_type": Environment.PRODUCTION}

raiden/ui/checks.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,6 @@ def check_ethereum_network_id(given_network_id: ChainID, web3: Web3) -> None:
152152
sys.exit(1)
153153

154154

155-
def check_raiden_environment(network_id: ChainID, environment_type: Environment) -> None:
156-
not_allowed = ( # for now we only disallow mainnet with test configuration
157-
network_id == 1 and environment_type == Environment.DEVELOPMENT
158-
)
159-
if not_allowed:
160-
click.secho(
161-
f"The chosen network ({ID_TO_NETWORKNAME[network_id]}) is not a testnet, "
162-
f'but the "development" environment was selected.\n'
163-
f"This is not allowed. Please start again with a safe environment setting "
164-
f"(--environment production).",
165-
fg="red",
166-
)
167-
sys.exit(1)
168-
169-
170155
def check_smart_contract_addresses(
171156
environment_type: Environment,
172157
node_network_id: ChainID,

raiden/ui/startup.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
from raiden.network.proxies.token_network_registry import TokenNetworkRegistry
1414
from raiden.network.proxies.user_deposit import UserDeposit
1515
from raiden.settings import RAIDEN_CONTRACT_VERSION
16-
from raiden.ui.checks import (
17-
check_pfs_configuration,
18-
check_raiden_environment,
19-
check_smart_contract_addresses,
20-
)
16+
from raiden.ui.checks import check_pfs_configuration, check_smart_contract_addresses
2117
from raiden.utils.typing import Address, ChainID, TokenNetworkRegistryAddress
2218
from raiden_contracts.constants import (
2319
CONTRACT_SECRET_REGISTRY,
@@ -50,10 +46,6 @@ def setup_contracts_or_exit(config: Dict[str, Any], network_id: ChainID) -> Dict
5046
If an invalid combination of network id and environment type is provided, exits
5147
the program with an error
5248
"""
53-
environment_type = config["environment_type"]
54-
55-
check_raiden_environment(network_id, environment_type)
56-
5749
contracts: Dict[str, Any] = dict()
5850
contracts_version = RAIDEN_CONTRACT_VERSION
5951

0 commit comments

Comments
 (0)