Skip to content

Commit

Permalink
Merge branch 'develop' into feat/keytypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowman authored Jun 7, 2023
2 parents 072da5b + 6c5bde1 commit a8db627
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers
* @joe-bowman @ajansari95 @aljo242
* @joe-bowman @ajansari95 @aljo242 @muku314115
14 changes: 7 additions & 7 deletions x/participationrewards/keeper/hooks.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keeper

import (
"errors"

"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
sdk "github.com/cosmos/cosmos-sdk/types"

Expand Down Expand Up @@ -56,11 +54,7 @@ func (k *Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64)
k.GetParams(ctx).DistributionProportions,
)
if err != nil {
if errors.Is(err, types.ErrNothingToAllocate) {
k.Logger(ctx).Info(err.Error())
} else {
k.Logger(ctx).Error(err.Error())
}
k.Logger(ctx).Error(err.Error())
}

k.Logger(ctx).Info("Triggering submodule hooks")
Expand All @@ -74,6 +68,12 @@ func (k *Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64)
return nil
}

if allocation == nil {
// if allocation is unset, then return early to avoid panic
k.Logger(ctx).Error("nil allocation", "error", err.Error())
return nil
}

if err := k.AllocateZoneRewards(ctx, tvs, *allocation); err != nil {
k.Logger(ctx).Error(err.Error())
return err
Expand Down

0 comments on commit a8db627

Please sign in to comment.