Skip to content

Commit

Permalink
Add missing chainId parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
falvaradorodriguez committed Nov 7, 2024
1 parent e90cc85 commit bd6310e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class DelegatePayload(TypedDict):
delegator: str
label: str
expiryDateSeconds: Optional[int]
chainId: str


def _build_delegate_payload(
Expand All @@ -240,6 +241,7 @@ def _build_delegate_payload(
expiryDateSeconds=(
int(instance.expiry_date.timestamp()) if instance.expiry_date else None
),
chainId=str(get_chain_id()),
)


Expand Down
4 changes: 4 additions & 0 deletions safe_transaction_service/history/tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def test_delegates_signals_are_correctly_fired(self, send_event_mock: MagicMock)
"delegator": delegate_for_safe.delegator,
"label": delegate_for_safe.label,
"expiryDateSeconds": int(delegate_for_safe.expiry_date.timestamp()),
"chainId": str(EthereumNetwork.GANACHE.value),
}
send_event_mock.assert_called_with(new_delegate_user_payload)

Expand All @@ -224,6 +225,7 @@ def test_delegates_signals_are_correctly_fired(self, send_event_mock: MagicMock)
"delegator": permanent_delegate_without_safe.delegator,
"label": permanent_delegate_without_safe.label,
"expiryDateSeconds": None,
"chainId": str(EthereumNetwork.GANACHE.value),
}
send_event_mock.assert_called_with(new_delegate_user_payload)

Expand All @@ -243,6 +245,7 @@ def test_delegates_signals_are_correctly_fired(self, send_event_mock: MagicMock)
"delegator": delegate_to_update.delegator,
"label": new_label,
"expiryDateSeconds": int(new_expiry_date.timestamp()),
"chainId": str(EthereumNetwork.GANACHE.value),
}
send_event_mock.assert_called_with(updated_delegate_user_payload)

Expand All @@ -256,5 +259,6 @@ def test_delegates_signals_are_correctly_fired(self, send_event_mock: MagicMock)
"delegator": delegate_to_delete.delegator,
"label": delegate_to_delete.label,
"expiryDateSeconds": int(delegate_to_delete.expiry_date.timestamp()),
"chainId": str(EthereumNetwork.GANACHE.value),
}
send_event_mock.assert_called_with(updated_delegate_user_payload)

0 comments on commit bd6310e

Please sign in to comment.