Skip to content

Commit

Permalink
fix: var shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Oct 31, 2023
1 parent 555ca54 commit da98ec9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions internal/provider/alliance/alliance_protocols_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,21 @@ func calculateNormalizedRewardWeight(
alliance alliancetypes.AllianceAsset,
) sdktypes.Dec {

// We shouldd consider that reward weight
// If alliance, is not initiated return zero.
if !alliance.IsInitialized {
return sdktypes.ZeroDec()
}

// We should consider that reward weight
// starts at one because it also takes in
// consideration the OneDec.
rewardsWeight := sdktypes.OneDec()
for _, alliance := range alliances {
// When an alliance is not initialized, it means that users are not
// receiving rewards so NormalizedRewardWeight is zero (right now).
// receiving rewards so NormalizedRewardWeight for this alliance shouldn't
// be considered.
if !alliance.IsInitialized {
return sdktypes.ZeroDec()
continue
}
// If an alliance is not initialized it means that
// rewards are not distributed to that alliance so
Expand Down

0 comments on commit da98ec9

Please sign in to comment.