From 542663e2585c6db441ab31c06132bd718769d94e Mon Sep 17 00:00:00 2001 From: Yosuke Otosu <15183665+purplesmoke05@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:42:52 +0900 Subject: [PATCH] Fix failure notification code generated by `processor_batch_register_personal_info` (#732) --- batch/indexer_dvp_delivery.py | 2 +- batch/processor_batch_register_personal_info.py | 2 +- tests/batch/test_processor_register_personal_info.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/batch/indexer_dvp_delivery.py b/batch/indexer_dvp_delivery.py index 38abcd50..60d2c05f 100644 --- a/batch/indexer_dvp_delivery.py +++ b/batch/indexer_dvp_delivery.py @@ -795,7 +795,7 @@ async def __sink_on_delivery_info_notification( amount: int, agent_address: str, code: Literal[ - Annotated[1, "deliveryConfirmed"], Annotated[2, "deliveryFinished"] + Annotated[0, "deliveryConfirmed"], Annotated[1, "deliveryFinished"] ], ): notification = Notification() diff --git a/batch/processor_batch_register_personal_info.py b/batch/processor_batch_register_personal_info.py index e8ed8b34..3880d4cd 100644 --- a/batch/processor_batch_register_personal_info.py +++ b/batch/processor_batch_register_personal_info.py @@ -213,7 +213,7 @@ async def process(self): await self.__sink_on_error_notification( db_session=db_session, issuer_address=_upload.issuer_address, - code=2, + code=1, upload_id=_upload.upload_id, error_registration_id=error_registration_id, ) diff --git a/tests/batch/test_processor_register_personal_info.py b/tests/batch/test_processor_register_personal_info.py index 3588a1c5..1cacb4ee 100644 --- a/tests/batch/test_processor_register_personal_info.py +++ b/tests/batch/test_processor_register_personal_info.py @@ -825,7 +825,7 @@ async def test_error_2( _notification.type == NotificationType.BATCH_REGISTER_PERSONAL_INFO_ERROR ) - assert _notification.code == 2 + assert _notification.code == 1 assert _notification.metainfo == { "upload_id": batch_register_upload.upload_id, "error_registration_id": [ @@ -958,7 +958,7 @@ async def test_error_3( _notification.type == NotificationType.BATCH_REGISTER_PERSONAL_INFO_ERROR ) - assert _notification.code == 2 + assert _notification.code == 1 assert _notification.metainfo == { "upload_id": batch_register_upload.upload_id, "error_registration_id": [ @@ -1096,7 +1096,7 @@ async def test_error_4( _notification.type == NotificationType.BATCH_REGISTER_PERSONAL_INFO_ERROR ) - assert _notification.code == 2 + assert _notification.code == 1 assert _notification.metainfo == { "upload_id": batch_register_upload.upload_id, "error_registration_id": [