Skip to content

Commit

Permalink
update errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Oct 4, 2024
1 parent f997632 commit 3d2adf3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/observer/keeper/voting.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"fmt"
"github.com/pkg/errors"

sdkerrors "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -134,12 +135,12 @@ func (k Keeper) CheckObserverSelfDelegation(ctx sdk.Context, accAddress string)
}
validator, found := k.stakingKeeper.GetValidator(ctx, valAddress)
if !found {
return types.ErrNotValidator
return errors.Wrapf(types.ErrNotValidator, "validator : %s", valAddress)
}

delegation, found := k.stakingKeeper.GetDelegation(ctx, selfdelAddr, valAddress)
if !found {
return types.ErrSelfDelegation
return errors.Wrapf(types.ErrSelfDelegation, "self delegation : %s , valAddres : %s", selfdelAddr, valAddress)
}

minDelegation, err := types.GetMinObserverDelegationDec()
Expand Down

0 comments on commit 3d2adf3

Please sign in to comment.