Skip to content

Commit

Permalink
Fix delegates events payload attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
falvaradorodriguez committed Nov 8, 2024
1 parent 1f07bb3 commit 8fb64a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions safe_transaction_service/history/tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 8fb64a4

Please sign in to comment.