Skip to content

Commit

Permalink
Remove blockExplorerUri (#185)
Browse files Browse the repository at this point in the history
Clients should use blockExplorerUriTemplate only
  • Loading branch information
fmrsabino authored Aug 3, 2021
1 parent bb12c04 commit 7c1ea00
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
17 changes: 17 additions & 0 deletions src/chains/migrations/0022_remove_chain_block_explorer_uri.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.6 on 2021-08-03 08:25

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("chains", "0021_alter_chain_safe_apps_rpc_authentication"),
]

operations = [
migrations.RemoveField(
model_name="chain",
name="block_explorer_uri",
),
]
3 changes: 0 additions & 3 deletions src/chains/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class RpcAuthentication(models.TextChoices):
default=RpcAuthentication.NO_AUTHENTICATION,
)
safe_apps_rpc_uri = models.URLField(default="")
block_explorer_uri = (
models.URLField()
) # TODO: Remove in a later migration (once the clients no longer need it)
block_explorer_uri_address_template = models.URLField()
block_explorer_uri_tx_hash_template = models.URLField()
currency_name = models.CharField(max_length=255)
Expand Down
1 change: 0 additions & 1 deletion src/chains/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class Meta:
"rpc_uri",
"safe_apps_rpc_uri",
"block_explorer_uri_template",
"block_explorer_uri",
"native_currency",
"transaction_service",
"theme",
Expand Down
1 change: 0 additions & 1 deletion src/chains/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Meta:
lambda o: random.choice(list(Chain.RpcAuthentication))
)
safe_apps_rpc_uri = factory.Faker("url")
block_explorer_uri = factory.Faker("url")
block_explorer_uri_address_template = factory.Faker("url")
block_explorer_uri_tx_hash_template = factory.Faker("url")
currency_name = factory.Faker("cryptocurrency_name")
Expand Down
3 changes: 0 additions & 3 deletions src/chains/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def test_json_payload_format(self):
"authentication": chain.safe_apps_rpc_authentication,
"value": chain.safe_apps_rpc_uri,
},
"blockExplorerUri": chain.block_explorer_uri,
"blockExplorerUriTemplate": {
"address": chain.block_explorer_uri_address_template,
"txHash": chain.block_explorer_uri_tx_hash_template,
Expand Down Expand Up @@ -137,7 +136,6 @@ def test_json_payload_format(self):
"authentication": chain.safe_apps_rpc_authentication,
"value": chain.safe_apps_rpc_uri,
},
"blockExplorerUri": chain.block_explorer_uri,
"blockExplorerUriTemplate": {
"address": chain.block_explorer_uri_address_template,
"txHash": chain.block_explorer_uri_tx_hash_template,
Expand Down Expand Up @@ -188,7 +186,6 @@ def test_match(self):
"authentication": chain.safe_apps_rpc_authentication,
"value": chain.safe_apps_rpc_uri,
},
"block_explorer_uri": chain.block_explorer_uri,
"block_explorer_uri_template": {
"address": chain.block_explorer_uri_address_template,
"tx_hash": chain.block_explorer_uri_tx_hash_template,
Expand Down

0 comments on commit 7c1ea00

Please sign in to comment.