Skip to content

Commit

Permalink
indexer-agent: Fix bug in stake usage summary
Browse files Browse the repository at this point in the history
- If null POI is provided we should expect that the agent will get a
valid POI from the graph-node. I.e only expect 0 rewards if a 0x0...
POI is explicitly provided
  • Loading branch information
fordN committed Oct 13, 2023
1 parent 44cbddc commit 9b1ad88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/indexer-common/src/indexer-management/allocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -999,10 +999,10 @@ export class AllocationManager {
// Fetch the allocation on chain to inspect its amount
const allocation = await this.network.networkMonitor.allocation(action.allocationID)

// Accrue rewards, except for null or zeroed POI
// Accrue rewards, except for zeroed POI
const zeroHexString = utils.hexlify(Array(32).fill(0))
rewards =
!action.poi || action.poi === zeroHexString
action.poi === zeroHexString
? BigNumber.from(0)
: await this.network.contracts.rewardsManager.getRewards(action.allocationID)

Expand Down

0 comments on commit 9b1ad88

Please sign in to comment.