Skip to content

Commit

Permalink
Hotfix for RewardsDenylistUpdated error
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmardefago committed Apr 1, 2022
1 parent e75999b commit b86daec
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/mappings/rewardsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,14 @@ export function handleParameterUpdated(event: ParameterUpdated): void {
// }

export function handleRewardsDenyListUpdated(event: RewardsDenylistUpdated): void {
let subgraphDeployment = SubgraphDeployment.load(event.params.subgraphDeploymentID.toHexString())!
if (event.params.sinceBlock.toI32() == 0) {
subgraphDeployment.deniedAt = 0
} else {
subgraphDeployment.deniedAt = event.params.sinceBlock.toI32()
let subgraphDeployment = SubgraphDeployment.load(event.params.subgraphDeploymentID.toHexString())
if (subgraphDeployment != null) {
if (event.params.sinceBlock.toI32() == 0) {
subgraphDeployment.deniedAt = 0
} else {
subgraphDeployment.deniedAt = event.params.sinceBlock.toI32()
}
subgraphDeployment.save()
}
subgraphDeployment.save()
// We might need to handle the case where the subgraph deployment doesn't exists later
}

0 comments on commit b86daec

Please sign in to comment.