Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add negative description to reversed constraints #243

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Type(models.TextChoices):
max_length=10, choices=Type.choices, default=Type.VERIFICATION
)
description = models.TextField(null=True, blank=True)
negative_description = models.TextField(null=True, blank=True)
explanation = models.TextField(null=True, blank=True)
response = models.TextField(null=True, blank=True)
icon_url = models.CharField(max_length=255, null=True, blank=True)
Expand Down Expand Up @@ -190,6 +191,7 @@ def get_wallet_balance(self):
)

if self.chain_type == NetworkTypes.EVM or int(self.chain_id) == 500:
# TODO: Get from Web3Utils
return EVMFundManager(self).get_balance(self.wallet.address)
elif self.chain_type == NetworkTypes.SOLANA:
fund_manager = SolanaFundManager(self)
Expand Down Expand Up @@ -226,6 +228,7 @@ def gas_price(self):
try:
from faucet.faucet_manager.fund_manager import EVMFundManager

# TODO: Get from Web3Utils
return EVMFundManager(self).get_gas_price()
except: # noqa: E722
logging.exception(f"Error getting gas price for {self.chain_name}")
Expand Down
2 changes: 2 additions & 0 deletions core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Meta:
"title",
"type",
"description",
"negative_description",
"explanation",
"response",
"icon_url",
Expand All @@ -53,6 +54,7 @@ class Meta:
"title",
"type",
"description",
"negative_description",
"explanation",
"response",
"icon_url",
Expand Down
18 changes: 18 additions & 0 deletions prizetap/migrations/0047_constraint_negative_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.4 on 2024-01-03 08:03

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('prizetap', '0046_alter_raffle_creator_name_alter_raffle_description'),
]

operations = [
migrations.AddField(
model_name='constraint',
name='negative_description',
field=models.TextField(blank=True, null=True),
),
]
18 changes: 18 additions & 0 deletions tokenTap/migrations/0025_constraint_negative_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.4 on 2024-01-03 08:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('tokenTap', '0024_tokendistribution_contract'),
]

operations = [
migrations.AddField(
model_name='constraint',
name='negative_description',
field=models.TextField(blank=True, null=True),
),
]
Loading