Skip to content

Commit

Permalink
Merge pull request #78 from terra-money/fix/shadowing
Browse files Browse the repository at this point in the history
fix: var shadowing
  • Loading branch information
emidev98 authored Oct 31, 2023
2 parents 63386ca + bbcae37 commit 92fb2bf
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 92fb2bf

Please sign in to comment.