Repository: raiden-network/raiden-contracts

Issue:
Suggest the new option --token-network-registry-address when refusing --registry-address
When `deploy register` is called with `--registry-address`, the script shows
```
Error: no such option: --registry-address is no longer a valid option
```

The script should also show the new option `--token-network-registry-address`.

Discussion:

Patch:
diff --git a/raiden_contracts/deploy/__main__.py b/raiden_contracts/deploy/__main__.py
index d33c85c..ff1fc24 100644
--- a/raiden_contracts/deploy/__main__.py
+++ b/raiden_contracts/deploy/__main__.py
@@ -51,9 +51,17 @@ def validate_address(_, _param, value):
         raise click.BadParameter('must be a valid ethereum address')
 
 
-def error_removed_option(_, param, value):
-    if value is not None:
-        raise click.NoSuchOption(f'--{param.name.replace("_", "-")} is no longer a valid option')
+def error_removed_option(message: str):
+    """ Takes a message and returns a callback that raises NoSuchOption
+
+    if the value is not None. The message is used as an argument to NoSuchOption. """
+    def f(_, param, value):
+        if value is not None:
+            raise click.NoSuchOption(
+                f'--{param.name.replace("_", "-")} is no longer a valid option. ' +
+                message,
+            )
+    return f
 
 
 def common_options(func):
@@ -373,7 +381,7 @@ def token(
 @click.option(
     '--registry-address',
     default=None,
-    callback=error_removed_option,
+    callback=error_removed_option('Use --token-network-registry-address'),
     hidden=True,
     help='Renamed into --token-network-registry-address',
 )


Test patch:
diff --git a/raiden_contracts/tests/test_deploy_script.py b/raiden_contracts/tests/test_deploy_script.py
index 58b17b7..18a21d2 100644
--- a/raiden_contracts/tests/test_deploy_script.py
+++ b/raiden_contracts/tests/test_deploy_script.py
@@ -451,4 +451,4 @@ def test_red_eyes_deployer(web3):
 def test_error_removed_option_raises():
     with pytest.raises(NoSuchOption):
         mock = MagicMock()
-        error_removed_option(None, mock, '0xaabbcc')
+        error_removed_option('msg')(None, mock, '0xaabbcc')