Skip to content

Commit

Permalink
ignore zero wei transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
harisang committed Oct 7, 2024
1 parent 5163d0f commit ca1e4ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 9 additions & 6 deletions src/fetch/payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,16 @@ def prepare_transfers(
)
)
for address in partner_fees_wei:
transfers.append(
Transfer(
token=None,
recipient=Address(address),
amount_wei=partner_fees_wei[address],
amount_wei = partner_fees_wei[address]
assert amount_wei >= 0, f"Can't construct negative transfer of {amount_wei}"
if amount_wei > 0:
transfers.append(
Transfer(
token=None,
recipient=Address(address),
amount_wei=partner_fees_wei[address],
)
)
)

return PeriodPayouts(overdrafts, transfers)

Expand Down
2 changes: 0 additions & 2 deletions src/models/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class Transfer:
amount_wei: int

def __init__(self, token: Optional[Token], recipient: Address, amount_wei: int):
assert amount_wei > 0, f"Can't construct negative transfer of {amount_wei}"

self.token = token
self._recipient = recipient
self.amount_wei = amount_wei
Expand Down

0 comments on commit ca1e4ff

Please sign in to comment.