Skip to content

Commit

Permalink
fix: Prevent 0 settlement due to int div
Browse files Browse the repository at this point in the history
  • Loading branch information
red-0ne committed Nov 7, 2024
1 parent 88a3d45 commit 4b04353
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/tokenomics/keeper/token_logic_modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,14 @@ func (k Keeper) ProcessTokenLogicModules(
logger = logger.With("actual_settlement_upokt", actualSettlementCoin)
logger.Info(fmt.Sprintf("About to start processing TLMs for (%d) compute units, equal to (%s) claimed", numClaimComputeUnits, actualSettlementCoin))

if actualSettlementCoin.Amount.IsZero() {
logger.Warn(fmt.Sprintf(
"actual settlement coin is zero, skipping TLM processing, application %q stake %s",
application.Address, application.Stake,
))
return nil
}

// Execute all the token logic modules processors
for tlm, tlmProcessor := range tokenLogicModuleProcessorMap {
logger.Info(fmt.Sprintf("Starting TLM processing: %q", tlm))
Expand Down

0 comments on commit 4b04353

Please sign in to comment.