From f1b0e093db105f632044aa49032ddbd519f4f52c Mon Sep 17 00:00:00 2001 From: Igor Sereda Date: Sun, 4 Feb 2024 11:46:30 +0300 Subject: [PATCH] Commitment Model extended --- bridge_indexer/handlers/tezos/on_head.py | 3 +++ bridge_indexer/models/__init__.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/bridge_indexer/handlers/tezos/on_head.py b/bridge_indexer/handlers/tezos/on_head.py index f88e4c7..59ef4b8 100644 --- a/bridge_indexer/handlers/tezos/on_head.py +++ b/bridge_indexer/handlers/tezos/on_head.py @@ -32,9 +32,12 @@ async def update_commitment(ctx): defaults={ 'inbox_level': commitment_data[0]['inboxLevel'], 'first_level': commitment_data[0]['firstLevel'], + 'first_time': commitment_data[0]['firstTime'], 'last_level': commitment_data[0]['lastLevel'], + 'last_time': commitment_data[0]['lastTime'], 'state': commitment_data[0]['state'], 'hash': commitment_data[0]['hash'], + 'status': commitment_data[0]['status'], }, ) diff --git a/bridge_indexer/models/__init__.py b/bridge_indexer/models/__init__.py index b67053c..7d2314f 100644 --- a/bridge_indexer/models/__init__.py +++ b/bridge_indexer/models/__init__.py @@ -65,9 +65,12 @@ class Meta: id = fields.BigIntField(pk=True) inbox_level = fields.IntField() first_level = fields.IntField() + first_time = fields.DatetimeField() last_level = fields.IntField() + last_time = fields.DatetimeField() state = fields.CharField(max_length=54) hash = fields.CharField(max_length=54) + status = fields.CharField(max_length=16) class AbstractRollupMessage(Model): @@ -77,6 +80,7 @@ class Meta: 'level', 'index', ) + ordering = ['level', 'index'] id = fields.BigIntField(pk=True) level = fields.IntField(index=True)