Repository: safe-global/safe-config-service

Issue:
Add a description field for each chain
In the UI, we'd like to display short descriptions for each network. E.g.

* **name**: Volta
* **description**: Energy Web testnet

Please add a new text field in the chain configs. 256 chars or so would be enough.


Discussion:
@katspaugh Regarding the description should it be an optional field?

```javascript
GET /api/v1/chains

{
  "chainName": <string>,
  "description": <string>, // optional
}
```
It could be an empty string if not set.
> It could be an empty string if not set.

Will go with 

```javascript
GET /api/v1/chains

{
  "chainName": <string>,
  "description": <string>, // required but can be empty
  ...
}
```

Resolving patch:
diff --git a/src/chains/migrations/0027_chain_description.py b/src/chains/migrations/0027_chain_description.py
new file mode 100644
--- /dev/null
+++ b/src/chains/migrations/0027_chain_description.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.2.7 on 2021-09-16 12:38
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("chains", "0026_chain_l2"),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name="chain",
+            name="description",
+            field=models.CharField(blank=True, max_length=255),
+        ),
+    ]
diff --git a/src/chains/models.py b/src/chains/models.py
--- a/src/chains/models.py
+++ b/src/chains/models.py
@@ -33,6 +33,7 @@ class RpcAuthentication(models.TextChoices):
         default=100
     )  # A lower number will indicate more relevance
     name = models.CharField(verbose_name="Chain name", max_length=255)
+    description = models.CharField(max_length=255, blank=True)
     l2 = models.BooleanField()
     rpc_authentication = models.CharField(
         max_length=255, choices=RpcAuthentication.choices
diff --git a/src/chains/serializers.py b/src/chains/serializers.py
--- a/src/chains/serializers.py
+++ b/src/chains/serializers.py
@@ -97,6 +97,7 @@ class Meta:
         fields = [
             "chain_id",
             "chain_name",
+            "description",
             "l2",
             "rpc_uri",
             "safe_apps_rpc_uri",


Test patch:
diff --git a/src/chains/tests/factories.py b/src/chains/tests/factories.py
--- a/src/chains/tests/factories.py
+++ b/src/chains/tests/factories.py
@@ -14,6 +14,7 @@ class Meta:
     id = factory.Sequence(lambda id: id)
     relevance = factory.Faker("pyint")
     name = factory.Faker("company")
+    description = factory.Faker("pystr", max_chars=255)
     l2 = factory.Faker("pybool")
     rpc_authentication = factory.lazy_attribute(
         lambda o: random.choice(list(Chain.RpcAuthentication))
diff --git a/src/chains/tests/test_views.py b/src/chains/tests/test_views.py
--- a/src/chains/tests/test_views.py
+++ b/src/chains/tests/test_views.py
@@ -28,6 +28,7 @@ def test_json_payload_format(self):
                 {
                     "chainId": str(gas_price.chain.id),
                     "chainName": chain.name,
+                    "description": chain.description,
                     "l2": chain.l2,
                     "rpcUri": {
                         "authentication": chain.rpc_authentication,
@@ -133,6 +134,7 @@ def test_json_payload_format(self):
         json_response = {
             "chainId": str(chain.id),
             "chainName": chain.name,
+            "description": chain.description,
             "l2": chain.l2,
             "rpcUri": {
                 "authentication": chain.rpc_authentication,
@@ -187,6 +189,7 @@ def test_match(self):
         json_response = {
             "chain_id": str(chain.id),
             "chain_name": chain.name,
+            "description": chain.description,
             "l2": chain.l2,
             "rpc_uri": {
                 "authentication": chain.rpc_authentication,