diff --git a/x/concentrated-liquidity/math/precompute.go b/x/concentrated-liquidity/math/precompute.go index df3939ee3c4..e51298cb33c 100644 --- a/x/concentrated-liquidity/math/precompute.go +++ b/x/concentrated-liquidity/math/precompute.go @@ -9,7 +9,6 @@ import ( var ( sdkOneDec = sdk.OneDec() - sdkNineDec = sdk.NewDec(9) sdkTenDec = sdk.NewDec(10) powersOfTen []sdk.Dec negPowersOfTen []sdk.Dec diff --git a/x/incentives/keeper/distribute.go b/x/incentives/keeper/distribute.go index c532bf9e6c4..6131044d755 100644 --- a/x/incentives/keeper/distribute.go +++ b/x/incentives/keeper/distribute.go @@ -284,7 +284,7 @@ func (k Keeper) AllocateAcrossGauges(ctx sdk.Context) error { // only allow distribution if the GroupGauge is Active if gauge.IsActiveGauge(currTime) { - coinsToDistributePerInternalGauge, coinsToDistributeThisEpoch, err := k.calcSplitPolicyCoins(ctx, groupGauge.SplittingPolicy, gauge, groupGauge) + coinsToDistributePerInternalGauge, coinsToDistributeThisEpoch, err := k.calcSplitPolicyCoins(groupGauge.SplittingPolicy, gauge, groupGauge) if err != nil { return err } @@ -298,7 +298,9 @@ func (k Keeper) AllocateAcrossGauges(ctx sdk.Context) error { // we distribute tokens from groupGauge to internal gauge therefore update groupGauge fields // updates filledEpoch and distributedCoins - k.updateGaugePostDistribute(ctx, *gauge, coinsToDistributeThisEpoch) + if err := k.updateGaugePostDistribute(ctx, *gauge, coinsToDistributeThisEpoch); err != nil { + return err + } } } @@ -307,7 +309,8 @@ func (k Keeper) AllocateAcrossGauges(ctx sdk.Context) error { // calcSplitPolicyCoins calculates tokens to split given a policy and groupGauge. // TODO: add volume split policy -func (k Keeper) calcSplitPolicyCoins(ctx sdk.Context, policy types.SplittingPolicy, groupGauge *types.Gauge, groupGaugeObj types.GroupGauge) (sdk.Coins, sdk.Coins, error) { +// nolint: unused +func (k Keeper) calcSplitPolicyCoins(policy types.SplittingPolicy, groupGauge *types.Gauge, groupGaugeObj types.GroupGauge) (sdk.Coins, sdk.Coins, error) { if policy == types.Evenly { remainCoins := groupGauge.Coins.Sub(groupGauge.DistributedCoins) @@ -327,7 +330,6 @@ func (k Keeper) calcSplitPolicyCoins(ctx sdk.Context, policy types.SplittingPoli } else { return nil, nil, fmt.Errorf("GroupGauge id %d doesnot have enought coins to distribute.", &groupGauge.Id) } - } // distributeInternal runs the distribution logic for a gauge, and adds the sends to @@ -528,7 +530,7 @@ func (k Keeper) Distribute(ctx sdk.Context, gauges []types.Gauge) (sdk.Coins, er ctx.Logger().Debug("distributeSyntheticInternal, gauge id %d, %d", "module", types.ModuleName, "gaugeId", gauge.Id, "height", ctx.BlockHeight()) gaugeDistributedCoins, err = k.distributeSyntheticInternal(ctx, gauge, filteredLocks, &distrInfo) } else { - // Do not distribue if LockQueryType = Group, because if we distribute here we will be double distributing. + // Do not distributed if LockQueryType = Group, because if we distribute here we will be double distributing. if gauge.DistributeTo.LockQueryType == lockuptypes.ByGroup { continue } diff --git a/x/incentives/types/keys.go b/x/incentives/types/keys.go index fe85d4f8652..cfc1e41a279 100644 --- a/x/incentives/types/keys.go +++ b/x/incentives/types/keys.go @@ -71,5 +71,4 @@ func NoLockInternalGaugeDenom(poolId uint64) string { // KeyGroupGaugeForId returns key for a given groupGaugeId. func KeyGroupGaugeForId(groupGaugeId uint64) []byte { return []byte(fmt.Sprintf("%s%s%d%s", GroupGaugePrefix, "|", groupGaugeId, "|")) - }