Skip to content

Commit 8bcab7a

Browse files
committed
add onchain id to list reg
1 parent 3f2ba37 commit 8bcab7a

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

indexer_app/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ async def handle_new_list_registration(
519519
project_list.append({"chain_id": 1, "id": dt["registrant_id"]})
520520
insert_data.append(
521521
{
522-
"id": dt["id"],
522+
"on_chain_id": data["id"],
523523
"registrant_id": dt["registrant_id"],
524524
"list_id": parent_list.id,
525525
"status": dt["status"],
@@ -2146,7 +2146,7 @@ def handle_new_stellar_list_registration(
21462146
try:
21472147
_ = ListRegistration.objects.create(
21482148
**{
2149-
"id": data["id"],
2149+
"on_chain_id": data["id"],
21502150
"registrant_id": data["registrant_id"],
21512151
"list_id": parent_list.id,
21522152
"status": data["status"],
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 5.0.6 on 2025-10-22 23:48
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("lists", "0009_alter_list_on_chain_id_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="listregistration",
15+
name="on_chain_id",
16+
field=models.IntegerField(
17+
help_text="list registration id in contract",
18+
null=True,
19+
verbose_name="list registration id on chain",
20+
),
21+
),
22+
]

lists/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ class ListRegistrationStatus(models.TextChoices):
1313
BLACKLISTED = "Blacklisted", "Blacklisted"
1414

1515

16-
17-
1816
class List(models.Model):
1917
id = models.AutoField(
2018
_("list id"),
@@ -136,6 +134,11 @@ class ListRegistration(models.Model):
136134
primary_key=True,
137135
help_text=_("Registration id."),
138136
)
137+
on_chain_id = models.IntegerField(
138+
_("list registration id on chain"),
139+
null=True,
140+
help_text=_("list registration id in contract"),
141+
)
139142
list = models.ForeignKey(
140143
List,
141144
on_delete=models.CASCADE,

0 commit comments

Comments
 (0)