Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(staking): add more failure event logs #280

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions client/x/evmengine/keeper/ubi.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ package keeper

import (
"context"
"strconv"

"cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/piplabs/story/client/x/evmengine/types"
"github.com/piplabs/story/contracts/bindings"
"github.com/piplabs/story/lib/errors"
Expand Down Expand Up @@ -41,9 +45,26 @@ func (k *Keeper) ProcessUbiEvents(ctx context.Context, height uint64, logs []*ty
return nil
}

func (k *Keeper) ProcessUBIPercentageSet(ctx context.Context, ev *bindings.UBIPoolUBIPercentageSet) error {
func (k *Keeper) ProcessUBIPercentageSet(ctx context.Context, ev *bindings.UBIPoolUBIPercentageSet) (err error) {
defer func() {
sdkCtx := sdk.UnwrapSDKContext(ctx)
if err != nil {
sdkCtx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.EventTypeUpdateUbiFailure,
sdk.NewAttribute(types.AttributeKeyBlockHeight, strconv.FormatInt(sdkCtx.BlockHeight(), 10)),
sdk.NewAttribute(types.AttributeKeyUbiPercentage, strconv.FormatUint(uint64(ev.Percentage), 10)),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

newUBI := math.LegacyNewDecWithPrec(int64(ev.Percentage), 4)
if err := k.distrKeeper.SetUbi(ctx, newUBI); err != nil {

if err = k.distrKeeper.SetUbi(ctx, newUBI); errors.Is(err, sdkerrors.ErrInvalidRequest) {
return errors.WrapErrWithCode(errors.InvalidRequest, err)
} else if err != nil {
return errors.Wrap(err, "set new UBI percentage")
}

Expand Down
29 changes: 25 additions & 4 deletions client/x/evmengine/keeper/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ package keeper

import (
"context"
"strconv"

upgradetypes "cosmossdk.io/x/upgrade/types"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/piplabs/story/client/x/evmengine/types"
"github.com/piplabs/story/contracts/bindings"
"github.com/piplabs/story/lib/errors"
Expand Down Expand Up @@ -41,13 +45,30 @@ func (k *Keeper) ProcessUpgradeEvents(ctx context.Context, height uint64, logs [
return nil
}

func (k *Keeper) ProcessSoftwareUpgrade(ctx context.Context, ev *bindings.UpgradeEntrypointSoftwareUpgrade) error {
err := k.upgradeKeeper.ScheduleUpgrade(ctx, upgradetypes.Plan{
func (k *Keeper) ProcessSoftwareUpgrade(ctx context.Context, ev *bindings.UpgradeEntrypointSoftwareUpgrade) (err error) {
defer func() {
sdkCtx := sdk.UnwrapSDKContext(ctx)
if err != nil {
sdkCtx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.EventTypeUpgradeFailure,
sdk.NewAttribute(types.AttributeKeyBlockHeight, strconv.FormatInt(sdkCtx.BlockHeight(), 10)),
sdk.NewAttribute(types.AttributeKeyUpgradeName, ev.Name),
sdk.NewAttribute(types.AttributeKeyUpgradeHeight, strconv.FormatInt(ev.Height, 10)),
sdk.NewAttribute(types.AttributeKeyUpgradeInfo, ev.Info),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

if err = k.upgradeKeeper.ScheduleUpgrade(ctx, upgradetypes.Plan{
Name: ev.Name,
Info: ev.Info,
Height: ev.Height,
})
if err != nil {
}); errors.Is(err, sdkerrors.ErrInvalidRequest) {
return errors.WrapErrWithCode(errors.InvalidRequest, err)
} else if err != nil {
return errors.Wrap(err, "process software upgrade: schedule upgrade")
}

Expand Down
14 changes: 14 additions & 0 deletions client/x/evmengine/types/events.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package types

// evmstaking module event types.
const (
EventTypeUpgradeFailure = "upgrade_failure"
EventTypeUpdateUbiFailure = "update_ubi_failure"

AttributeKeyStatusCode = "status_code"
AttributeKeyBlockHeight = "block_height"
AttributeKeyUpgradeName = "upgrade_name"
AttributeKeyUpgradeHeight = "upgrade_height"
AttributeKeyUpgradeInfo = "upgrade_info"
AttributeKeyUbiPercentage = "ubi_percentage"
)
16 changes: 8 additions & 8 deletions client/x/evmstaking/keeper/delegator_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ func (k Keeper) ProcessSetWithdrawalAddress(ctx context.Context, ev *bindings.IP
sdk.NewAttribute(types.AttributeKeyBlockHeight, strconv.FormatInt(sdkCtx.BlockHeight(), 10)),
sdk.NewAttribute(types.AttributeKeyDelegatorUncmpPubKey, hex.EncodeToString(ev.DelegatorUncmpPubkey)),
sdk.NewAttribute(types.AttributeKeyRewardAddress, hex.EncodeToString(ev.ExecutionAddress[:])),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

delCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.DelegatorUncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
}
depositorPubkey, err := k1util.PubKeyBytesToCosmos(delCmpPubkey)
if err != nil {
Expand All @@ -60,15 +60,15 @@ func (k Keeper) ProcessSetRewardAddress(ctx context.Context, ev *bindings.IPToke
sdk.NewAttribute(types.AttributeKeyBlockHeight, strconv.FormatInt(sdkCtx.BlockHeight(), 10)),
sdk.NewAttribute(types.AttributeKeyDelegatorUncmpPubKey, hex.EncodeToString(ev.DelegatorUncmpPubkey)),
sdk.NewAttribute(types.AttributeKeyWithdrawalAddress, hex.EncodeToString(ev.ExecutionAddress[:])),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

delCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.DelegatorUncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
}
depositorPubkey, err := k1util.PubKeyBytesToCosmos(delCmpPubkey)
if err != nil {
Expand All @@ -95,15 +95,15 @@ func (k Keeper) ProcessAddOperator(ctx context.Context, ev *bindings.IPTokenStak
sdk.NewAttribute(types.AttributeKeyBlockHeight, strconv.FormatInt(sdkCtx.BlockHeight(), 10)),
sdk.NewAttribute(types.AttributeKeyDelegatorUncmpPubKey, hex.EncodeToString(ev.UncmpPubkey)),
sdk.NewAttribute(types.AttributeKeyOperatorAddress, ev.Operator.Hex()),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

delCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.UncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
}
depositorPubkey, err := k1util.PubKeyBytesToCosmos(delCmpPubkey)
if err != nil {
Expand All @@ -129,15 +129,15 @@ func (k Keeper) ProcessRemoveOperator(ctx context.Context, ev *bindings.IPTokenS
sdk.NewAttribute(types.AttributeKeyBlockHeight, strconv.FormatInt(sdkCtx.BlockHeight(), 10)),
sdk.NewAttribute(types.AttributeKeyDelegatorUncmpPubKey, hex.EncodeToString(ev.UncmpPubkey)),
sdk.NewAttribute(types.AttributeKeyOperatorAddress, ev.Operator.Hex()),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

delCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.UncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
}
depositorPubkey, err := k1util.PubKeyBytesToCosmos(delCmpPubkey)
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions client/x/evmstaking/keeper/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ func (k Keeper) ProcessDeposit(ctx context.Context, ev *bindings.IPTokenStakingD
sdk.NewAttribute(types.AttributeKeyPeriodType, strconv.FormatInt(ev.StakingPeriod.Int64(), 10)),
sdk.NewAttribute(types.AttributeKeyAmount, ev.StakeAmount.String()),
sdk.NewAttribute(types.AttributeKeySenderAddress, ev.OperatorAddress.Hex()),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

delCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.DelegatorUncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
}
depositorPubkey, err := k1util.PubKeyBytesToCosmos(delCmpPubkey)
if err != nil {
Expand All @@ -48,7 +48,7 @@ func (k Keeper) ProcessDeposit(ctx context.Context, ev *bindings.IPTokenStakingD

valCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.ValidatorUncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress validator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress validator pubkey"))
}
validatorPubkey, err := k1util.PubKeyBytesToCosmos(valCmpPubkey)
if err != nil {
Expand Down Expand Up @@ -110,7 +110,7 @@ func (k Keeper) ProcessDeposit(ctx context.Context, ev *bindings.IPTokenStakingD

val, err := k.stakingKeeper.GetValidator(ctx, validatorAddr)
if errors.Is(err, stypes.ErrNoValidatorFound) {
return types.WrapErrWithCode(types.ValidatorNotFound, errors.New("validator not exists"))
return errors.WrapErrWithCode(errors.ValidatorNotFound, errors.New("validator not exists"))
} else if err != nil {
return errors.Wrap(err, "get validator failed")
}
Expand Down Expand Up @@ -143,9 +143,9 @@ func (k Keeper) ProcessDeposit(ctx context.Context, ev *bindings.IPTokenStakingD
)
_, err = skeeperMsgServer.Delegate(ctx, msg)
if errors.Is(err, stypes.ErrDelegationBelowMinimum) {
return types.WrapErrWithCode(types.InvalidDelegationAmount, err)
return errors.WrapErrWithCode(errors.InvalidDelegationAmount, err)
} else if errors.Is(err, stypes.ErrNoPeriodTypeFound) {
return types.WrapErrWithCode(types.InvalidPeriodType, err)
return errors.WrapErrWithCode(errors.InvalidPeriodType, err)
} else if err != nil {
return errors.Wrap(err, "delegate")
}
Expand Down
16 changes: 8 additions & 8 deletions client/x/evmstaking/keeper/redelegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (k Keeper) ProcessRedelegate(ctx context.Context, ev *bindings.IPTokenStaki
sdk.NewAttribute(types.AttributeKeyDelegateID, ev.DelegationId.String()),
sdk.NewAttribute(types.AttributeKeyAmount, ev.Amount.String()),
sdk.NewAttribute(types.AttributeKeySenderAddress, ev.OperatorAddress.Hex()),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
Expand All @@ -51,7 +51,7 @@ func (k Keeper) ProcessRedelegate(ctx context.Context, ev *bindings.IPTokenStaki

delCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.DelegatorUncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress delegator pubkey"))
}
depositorPubkey, err := k1util.PubKeyBytesToCosmos(delCmpPubkey)
if err != nil {
Expand All @@ -60,7 +60,7 @@ func (k Keeper) ProcessRedelegate(ctx context.Context, ev *bindings.IPTokenStaki

valSrcCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.ValidatorUncmpSrcPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress src validator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress src validator pubkey"))
}
validatorSrcPubkey, err := k1util.PubKeyBytesToCosmos(valSrcCmpPubkey)
if err != nil {
Expand All @@ -69,7 +69,7 @@ func (k Keeper) ProcessRedelegate(ctx context.Context, ev *bindings.IPTokenStaki

valDstCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.ValidatorUncmpDstPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress dst validator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress dst validator pubkey"))
}
validatorDstPubkey, err := k1util.PubKeyBytesToCosmos(valDstCmpPubkey)
if err != nil {
Expand Down Expand Up @@ -97,16 +97,16 @@ func (k Keeper) ProcessRedelegate(ctx context.Context, ev *bindings.IPTokenStaki
if delEvmAddr.String() != ev.OperatorAddress.String() {
operatorAddr, err := k.DelegatorOperatorAddress.Get(ctx, depositorAddr.String())
if errors.Is(err, collections.ErrNotFound) {
return types.WrapErrWithCode(
types.InvalidOperator,
return errors.WrapErrWithCode(
errors.InvalidOperator,
errors.New("invalid redelegateOnBehalf txn, no operator"),
)
} else if err != nil {
return errors.Wrap(err, "get delegator's operator address failed")
}
if operatorAddr != ev.OperatorAddress.String() {
return types.WrapErrWithCode(
types.InvalidOperator,
return errors.WrapErrWithCode(
errors.InvalidOperator,
errors.New("invalid redelegateOnBehalf txn, not from operator"),
)
}
Expand Down
12 changes: 6 additions & 6 deletions client/x/evmstaking/keeper/unjail.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ func (k Keeper) ProcessUnjail(ctx context.Context, ev *bindings.IPTokenStakingUn
sdk.NewAttribute(types.AttributeKeyBlockHeight, strconv.FormatInt(sdkCtx.BlockHeight(), 10)),
sdk.NewAttribute(types.AttributeKeyValidatorUncmpPubKey, hex.EncodeToString(ev.ValidatorUncmpPubkey)),
sdk.NewAttribute(types.AttributeKeySenderAddress, ev.Unjailer.Hex()),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

valCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.ValidatorUncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress validator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress validator pubkey"))
}
validatorPubkey, err := k1util.PubKeyBytesToCosmos(valCmpPubkey)
if err != nil {
Expand All @@ -53,16 +53,16 @@ func (k Keeper) ProcessUnjail(ctx context.Context, ev *bindings.IPTokenStakingUn
if valEvmAddr.String() != ev.Unjailer.String() {
operatorAddr, err := k.DelegatorOperatorAddress.Get(ctx, valDelAddr.String())
if errors.Is(err, collections.ErrNotFound) {
return types.WrapErrWithCode(
types.InvalidOperator,
return errors.WrapErrWithCode(
errors.InvalidOperator,
errors.New("invalid unjailOnBehalf txn, no operator for delegator"),
)
} else if err != nil {
return errors.Wrap(err, "get validator's operator address failed")
}
if operatorAddr != ev.Unjailer.String() {
return types.WrapErrWithCode(
types.InvalidOperator,
return errors.WrapErrWithCode(
errors.InvalidOperator,
errors.New("invalid unjailOnBehalf txn, not from operator"),
)
}
Expand Down
4 changes: 2 additions & 2 deletions client/x/evmstaking/keeper/update_commission.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ func (k Keeper) ProcessUpdateValidatorCommission(ctx context.Context, ev *bindin
sdk.NewAttribute(types.AttributeKeyBlockHeight, strconv.FormatInt(sdkCtx.BlockHeight(), 10)),
sdk.NewAttribute(types.AttributeKeyValidatorUncmpPubKey, hex.EncodeToString(ev.ValidatorUncmpPubkey)),
sdk.NewAttribute(types.AttributeKeyCommissionRate, strconv.FormatUint(uint64(ev.CommissionRate), 10)),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
}()

valCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.ValidatorUncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress validator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress validator pubkey"))
}
validatorPubkey, err := k1util.PubKeyBytesToCosmos(valCmpPubkey)
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions client/x/evmstaking/keeper/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (k Keeper) ProcessCreateValidator(ctx context.Context, ev *bindings.IPToken
sdk.NewAttribute(types.AttributeKeyMaxCommissionChangeRate, strconv.FormatUint(uint64(ev.MaxCommissionChangeRate), 10)),
sdk.NewAttribute(types.AttributeKeyTokenType, strconv.FormatUint(uint64(ev.SupportsUnlocked), 10)),
sdk.NewAttribute(types.AttributeKeySenderAddress, ev.OperatorAddress.Hex()),
sdk.NewAttribute(types.AttributeKeyStatusCode, types.UnwrapErrCode(err).String()),
sdk.NewAttribute(types.AttributeKeyStatusCode, errors.UnwrapErrCode(err).String()),
),
})
}
Expand All @@ -44,7 +44,7 @@ func (k Keeper) ProcessCreateValidator(ctx context.Context, ev *bindings.IPToken
// When creating a validator, it's self-delegation. Thus, validator pubkey is also delegation pubkey.
valCmpPubkey, err := UncmpPubKeyToCmpPubKey(ev.ValidatorUncmpPubkey)
if err != nil {
return types.WrapErrWithCode(types.InvalidUncmpPubKey, errors.Wrap(err, "compress validator pubkey"))
return errors.WrapErrWithCode(errors.InvalidUncmpPubKey, errors.Wrap(err, "compress validator pubkey"))
}
validatorPubkey, err := k1util.PubKeyBytesToCosmos(valCmpPubkey)
if err != nil {
Expand Down Expand Up @@ -105,7 +105,7 @@ func (k Keeper) ProcessCreateValidator(ctx context.Context, ev *bindings.IPToken
skeeperMsgServer := skeeper.NewMsgServerImpl(evmstakingSKeeper)

if _, err = k.stakingKeeper.GetValidator(ctx, validatorAddr); err == nil {
return types.WrapErrWithCode(types.ValidatorAlreadyExists, errors.New("validator already exists"))
return errors.WrapErrWithCode(errors.ValidatorAlreadyExists, errors.New("validator already exists"))
} else if !errors.Is(err, stypes.ErrNoValidatorFound) {
// Either the validator does not exist, or unknown error.
return errors.Wrap(err, "get validator")
Expand Down Expand Up @@ -142,11 +142,11 @@ func (k Keeper) ProcessCreateValidator(ctx context.Context, ev *bindings.IPToken

_, err = skeeperMsgServer.CreateValidator(ctx, msg)
if errors.Is(err, stypes.ErrCommissionLTMinRate) {
return types.WrapErrWithCode(types.InvalidCommissionRate, err)
return errors.WrapErrWithCode(errors.InvalidCommissionRate, err)
} else if errors.Is(err, stypes.ErrMinSelfDelegationBelowMinDelegation) {
return types.WrapErrWithCode(types.InvalidMinSelfDelegation, err)
return errors.WrapErrWithCode(errors.InvalidMinSelfDelegation, err)
} else if errors.Is(err, stypes.ErrNoTokenTypeFound) {
return types.WrapErrWithCode(types.InvalidTokenType, err)
return errors.WrapErrWithCode(errors.InvalidTokenType, err)
} else if err != nil {
return errors.Wrap(err, "create validator")
}
Expand Down
Loading
Loading