From 8fb64a47b024aecaebdf5968a56bb4df08959a91 Mon Sep 17 00:00:00 2001 From: Felipe Alvarado Date: Fri, 8 Nov 2024 10:26:48 +0100 Subject: [PATCH] Fix delegates events payload attribute name --- .../history/services/notification_service.py | 4 ++-- safe_transaction_service/history/tests/test_signals.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/safe_transaction_service/history/services/notification_service.py b/safe_transaction_service/history/services/notification_service.py index e58b745cb..19f4c1e09 100644 --- a/safe_transaction_service/history/services/notification_service.py +++ b/safe_transaction_service/history/services/notification_service.py @@ -209,7 +209,7 @@ def build_reorg_payload(block_number: int) -> ReorgPayload: class DelegatePayload(TypedDict): type: str - safeAddress: Optional[str] + address: Optional[str] delegate: str delegator: str label: str @@ -234,7 +234,7 @@ def _build_delegate_payload( """ return DelegatePayload( type=event_type.name, - safeAddress=instance.safe_contract_id if instance.safe_contract_id else None, + address=instance.safe_contract_id if instance.safe_contract_id else None, delegate=instance.delegate, delegator=instance.delegator, label=instance.label, diff --git a/safe_transaction_service/history/tests/test_signals.py b/safe_transaction_service/history/tests/test_signals.py index 37b60aa3a..ed7393160 100644 --- a/safe_transaction_service/history/tests/test_signals.py +++ b/safe_transaction_service/history/tests/test_signals.py @@ -206,7 +206,7 @@ def test_delegates_signals_are_correctly_fired(self, send_event_mock: MagicMock) delegate_for_safe = SafeContractDelegateFactory() new_delegate_user_payload = { "type": TransactionServiceEventType.NEW_DELEGATE.name, - "safeAddress": delegate_for_safe.safe_contract.address, + "address": delegate_for_safe.safe_contract.address, "delegate": delegate_for_safe.delegate, "delegator": delegate_for_safe.delegator, "label": delegate_for_safe.label, @@ -220,7 +220,7 @@ def test_delegates_signals_are_correctly_fired(self, send_event_mock: MagicMock) ) new_delegate_user_payload = { "type": TransactionServiceEventType.NEW_DELEGATE.name, - "safeAddress": None, + "address": None, "delegate": permanent_delegate_without_safe.delegate, "delegator": permanent_delegate_without_safe.delegator, "label": permanent_delegate_without_safe.label, @@ -240,7 +240,7 @@ def test_delegates_signals_are_correctly_fired(self, send_event_mock: MagicMock) delegate_to_update.save() updated_delegate_user_payload = { "type": TransactionServiceEventType.UPDATED_DELEGATE.name, - "safeAddress": new_safe.address, + "address": new_safe.address, "delegate": delegate_to_update.delegate, "delegator": delegate_to_update.delegator, "label": new_label, @@ -254,7 +254,7 @@ def test_delegates_signals_are_correctly_fired(self, send_event_mock: MagicMock) delegate_to_delete.delete() updated_delegate_user_payload = { "type": TransactionServiceEventType.DELETED_DELEGATE.name, - "safeAddress": delegate_to_delete.safe_contract.address, + "address": delegate_to_delete.safe_contract.address, "delegate": delegate_to_delete.delegate, "delegator": delegate_to_delete.delegator, "label": delegate_to_delete.label,