Skip to content

Commit

Permalink
Paris support - fix #703
Browse files Browse the repository at this point in the history
Bare Minimum Barely tested code for now.

* look at `delegatedBalance` instead of `balance` in the TzKT API query
  results
* do not include bakers' fees as reward as discussed in issue
  • Loading branch information
nicolasochem committed Jun 3, 2024
1 parent ae2c50f commit 16d6147
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/tzkt/tzkt_reward_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_rewards_for_cycle_map(self, cycle, rewards_type) -> RewardProviderModel:
address=self.baking_address, cycle=cycle, fetch_delegators=True
)

delegate_staking_balance = split["stakingBalance"]
delegate_staking_balance = split["delegatedBalance"]

# calculate estimated rewards
num_blocks = split["blocks"] + split["missedBlocks"] + split["futureBlocks"]
Expand All @@ -46,7 +46,6 @@ def get_rewards_for_cycle_map(self, cycle, rewards_type) -> RewardProviderModel:
rewards_and_fees = (
split["blockRewards"]
+ split["endorsementRewards"]
+ split["blockFees"]
+ split["revelationRewards"]
)
denunciation_rewards = (
Expand All @@ -72,8 +71,8 @@ def get_rewards_for_cycle_map(self, cycle, rewards_type) -> RewardProviderModel:

delegators_balances = {
item["address"]: {
"staking_balance": item["balance"],
"current_balance": item["currentBalance"],
"staking_balance": item["delegatedBalance"],
"current_balance": item["currentDelegatedBalance"],
}
for item in split["delegators"]
if item["balance"] > 0
Expand Down

0 comments on commit 16d6147

Please sign in to comment.