Skip to content

Commit

Permalink
split rewards/withdrawal
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelsoup42 committed Sep 16, 2023
1 parent c501baf commit b45e750
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,21 @@ def _transaction_balance(self, transaction: blockfrost.utils.Namespace) -> Any:
result[
self._asset_tuple(self.data.LOVELACE_ASSET) + ("", " deposit", True)
] = np.longlong(transaction.deposit)
result[self._asset_tuple(self.data.LOVELACE_ASSET) + ("", " rewards", True)] = (
np.negative(
if transaction.reward_amount:
result[
self._asset_tuple(self.data.LOVELACE_ASSET) + ("", " rewards", True)
] = np.longlong(transaction.reward_amount)
if transaction.withdrawals:
result[
self._asset_tuple(self.data.LOVELACE_ASSET)
+ ("", " rewards withdrawal", True)
] = np.negative(
functools.reduce(
np.add,
[np.longlong(w.amount) for w in transaction.withdrawals],
np.longlong(0),
)
)
if not transaction.reward_amount
else np.longlong(transaction.reward_amount)
)
for utxo in transaction.utxos.nonref_inputs:
if not utxo.collateral or not transaction.valid_contract:
for amount in utxo.amount:
Expand Down

0 comments on commit b45e750

Please sign in to comment.