Skip to content

Commit 493801e

Browse files
committed
Do not take target into account for EventPaymentReceivedSuccess
1 parent 520af73 commit 493801e

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

raiden/api/python.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141

4242
def event_filter_for_payments(
4343
event: architecture.Event,
44-
our_address: typing.Address,
4544
token_network_identifier: typing.TokenNetworkID = None,
4645
target_address: typing.Address = None,
4746
) -> bool:
@@ -50,8 +49,7 @@ def event_filter_for_payments(
5049
- If no other args are given, all payment related events match
5150
- If a token network identifier is given then only payment events for that match
5251
- If a target is also given then if the event is a payment sent event and the
53-
target matches it's returned. If it's a payment received it's returned only
54-
if target equals our address.
52+
target matches it's returned. If it's a payment received it's always returned.
5553
"""
5654
is_matching_event = (
5755
isinstance(event, EVENTS_PAYMENT_HISTORY_RELATED) and
@@ -70,14 +68,7 @@ def event_filter_for_payments(
7068
event.target == target_address
7169
)
7270
)
73-
received_and_target_matches = (
74-
isinstance(event, (EventPaymentReceivedSuccess)) and
75-
(
76-
target_address is None or
77-
target_address == our_address
78-
)
79-
)
80-
return sent_and_target_matches or received_and_target_matches
71+
return sent_and_target_matches or isinstance(event, (EventPaymentReceivedSuccess))
8172

8273

8374
class RaidenAPI:
@@ -705,10 +696,9 @@ def get_raiden_events_payment_history_with_timestamps(
705696
limit=limit,
706697
offset=offset,
707698
) if event_filter_for_payments(
708-
event.wrapped_event,
709-
self.address,
710-
token_network_identifier,
711-
target_address,
699+
event=event.wrapped_event,
700+
token_network_identifier=token_network_identifier,
701+
target_address=target_address,
712702
)
713703
]
714704

0 commit comments

Comments
 (0)