Skip to content

Commit

Permalink
Fix missing validator call
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Oct 26, 2023
1 parent 39ff9db commit d41b102
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions safe_transaction_service/history/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3321,6 +3321,19 @@ def test_estimate_multisig_tx_view(self, estimate_tx_gas_mock: MagicMock):
self.assertEqual(
response.data, {"safe_tx_gas": str(estimate_tx_gas_mock.return_value)}
)
with mock.patch(
"safe_transaction_service.history.views.settings.ETH_L2_NETWORK",
return_value=True,
):
response = self.client.post(
reverse(
"v1:history:multisig-transaction-estimate", args=(safe_address,)
),
format="json",
data=data,
)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, {"safe_tx_gas": "0"})

estimate_tx_gas_mock.side_effect = CannotEstimateGas
response = self.client.post(
Expand Down
1 change: 1 addition & 0 deletions safe_transaction_service/history/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,7 @@ def post(self, request, address, *args, **kwargs):
# don't support Safes below that version
if settings.ETH_L2_NETWORK:
response_serializer = self.response_serializer(data={"safe_tx_gas": 0})
response_serializer.is_valid()
return Response(status=status.HTTP_200_OK, data=response_serializer.data)

serializer = self.get_serializer(data=request.data)
Expand Down

0 comments on commit d41b102

Please sign in to comment.