Skip to content

Commit

Permalink
Merge branch 'master' of github.com:thirdeye-dev/thirdeye
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0elliot committed Jan 30, 2024
2 parents a0ca7ac + 174d195 commit 67653f1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@


class Migration(migrations.Migration):

dependencies = [
('smartcontract', '0007_alter_smartcontract_chain'),
("smartcontract", "0007_alter_smartcontract_chain"),
]

operations = [
migrations.AlterField(
model_name='smartcontract',
name='chain',
field=models.CharField(choices=[('ETH', 'eth'), ('SOL', 'sol')], max_length=16),
model_name="smartcontract",
name="chain",
field=models.CharField(
choices=[("ETH", "eth"), ("SOL", "sol")], max_length=16
),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@


class Migration(migrations.Migration):

dependencies = [
('smartcontract', '0008_alter_smartcontract_chain'),
("smartcontract", "0008_alter_smartcontract_chain"),
]

operations = [
migrations.AlterField(
model_name='smartcontract',
name='address',
model_name="smartcontract",
name="address",
field=models.CharField(max_length=44),
),
]
1 change: 1 addition & 0 deletions backend/api_app/smartcontract/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Chain(models.TextChoices):
ETH = "ETH", "eth"
SOL = "SOL", "sol"


class Network(models.TextChoices):
# eth network choices
MAINNET = "MAINNET", "mainnet"
Expand Down
8 changes: 5 additions & 3 deletions backend/api_app/smartcontract/serializers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
import logging
import re

from rest_framework import serializers

Expand Down Expand Up @@ -71,8 +71,10 @@ def smart_contract_validator(value):
pattern_sol_check = pattern_sol.match(value)
pattern_eth_check = pattern_eth.match(value)

logger.info(f"pattern_sol_check: {pattern_sol_check} and pattern_eth_check: {pattern_eth_check} for value: {value}")

logger.info(
f"pattern_sol_check: {pattern_sol_check} and pattern_eth_check: {pattern_eth_check} for value: {value}"
)

if not (pattern_sol_check or pattern_eth_check):
raise serializers.ValidationError("Invalid smart contract address")

Expand Down

0 comments on commit 67653f1

Please sign in to comment.