Skip to content

Commit

Permalink
Add address to query filter condition (#1594)
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 authored Jul 28, 2023
1 parent 728e7e2 commit 9f9b181
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion safe_transaction_service/history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,10 @@ def with_confirmations_required(self):
:return: queryset with `confirmations_required: int` field
"""
threshold_safe_status_query = (
SafeStatus.objects.filter(internal_tx__ethereum_tx=OuterRef("ethereum_tx"))
SafeStatus.objects.filter(
address=OuterRef("safe"),
internal_tx__ethereum_tx=OuterRef("ethereum_tx"),
)
.sorted_reverse_by_mined()
.values("threshold")
)
Expand Down
4 changes: 3 additions & 1 deletion safe_transaction_service/history/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,9 @@ def test_with_confirmations_required(self):
)

# SafeStatus not matching the EthereumTx
safe_status = SafeStatusFactory(nonce=1, threshold=8)
safe_status = SafeStatusFactory(
address=multisig_transaction.safe, nonce=1, threshold=8
)
self.assertIsNone(
MultisigTransaction.objects.with_confirmations_required()
.first()
Expand Down

0 comments on commit 9f9b181

Please sign in to comment.