Skip to content

Commit

Permalink
fix: Do not process 0 claim amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
red-0ne committed Nov 6, 2024
1 parent 2c3e229 commit e1c637c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions x/tokenomics/keeper/settle_pending_claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) (
}
}

app, found := k.applicationKeeper.GetApplication(ctx, claim.SessionHeader.ApplicationAddress)
if !found {
return settledResult, expiredResult, types.ErrTokenomicsApplicationNotFound
}

if app.GetStake().IsZero() {
logger.Warn(fmt.Sprintf("application %q has no stake", claim.SessionHeader.ApplicationAddress))
continue
}

// If this code path is reached, then either:
// 1. The claim does not require a proof.
// 2. The claim requires a proof and a valid proof was found.
Expand Down

0 comments on commit e1c637c

Please sign in to comment.