Skip to content

Commit

Permalink
limit rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelsoup42 committed Sep 10, 2023
1 parent 196eec1 commit be92861
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ def __init__(
) -> None:
self.staking_addresses = staking_addresses
if to_block is None:
to_block = int(api.block_latest().height)
to_block = int(api.block_latest().height - 1)
self.to_block = to_block
block_last = api.block(self.to_block)
block_after_last = api.block(self.to_block + 1)
self.end_time = block_after_last.time
self.end_epoch = block_last.epoch + 1
self.own_addresses: FrozenSet[str] = self._own_addresses(api)
self.rewards = rewards
if self.rewards:
Expand Down Expand Up @@ -135,6 +139,7 @@ def _reward_transactions(self, api: BlockFrostApi) -> pd.Series:
a_r
for s_a in self.staking_addresses
for a_r in api.account_rewards(s_a, gather_pages=True)
if a_r.epoch < self.end_epoch
]

pool_result_list = {
Expand Down Expand Up @@ -406,6 +411,7 @@ def _make_balance_frame(self) -> pd.DataFrame:
)
balance.columns = pd.MultiIndex.from_tuples(balance.columns)
balance.sort_index(axis=1, level=0, sort_remaining=True, inplace=True)

return balance

def make_transaction_frame(self) -> pd.DataFrame:
Expand Down

0 comments on commit be92861

Please sign in to comment.