diff --git a/x/dymns/keeper/hooks.go b/x/dymns/keeper/hooks.go index ee9f33adc..0b2997f59 100644 --- a/x/dymns/keeper/hooks.go +++ b/x/dymns/keeper/hooks.go @@ -61,7 +61,7 @@ func (h rollappHooks) RollappCreated(ctx sdk.Context, rollappID, alias string, c err := h.Keeper.registerAliasForRollApp(ctx, rollappID, creatorAddr, alias, aliasCost) if err != nil { - return errorsmod.Wrap(errors.Join(gerrc.ErrInternal, err), "register alias for RollApp") + return errorsmod.Wrap(errors.Join(gerrc.ErrUnknown, err), "register alias for RollApp") } return nil @@ -130,7 +130,7 @@ func (h rollappHooks) OnRollAppIdChanged(ctx sdk.Context, previousRollAppId, new for _, alias := range aliasesLinkedToPreviousRollApp { if err := h.MoveAliasToRollAppId(ctx, previousRollAppId, alias, newRollAppId); err != nil { - return errorsmod.Wrapf(errors.Join(gerrc.ErrInternal, err), "failed to migrate alias: %s", alias) + return errorsmod.Wrapf(errors.Join(gerrc.ErrUnknown, err), "failed to migrate alias: %s", alias) } } @@ -147,7 +147,7 @@ func (h rollappHooks) OnRollAppIdChanged(ctx sdk.Context, previousRollAppId, new } if err := h.migrateChainIdsInDymNames(ctx, previousChainIdsToNewChainId); err != nil { - return errorsmod.Wrapf(errors.Join(gerrc.ErrInternal, err), "failed to migrate chain-ids in Dym-Names") + return errorsmod.Wrapf(errors.Join(gerrc.ErrUnknown, err), "failed to migrate chain-ids in Dym-Names") } return nil diff --git a/x/dymns/keeper/msg_server_register_alias.go b/x/dymns/keeper/msg_server_register_alias.go index 4272b3041..e91710c7c 100644 --- a/x/dymns/keeper/msg_server_register_alias.go +++ b/x/dymns/keeper/msg_server_register_alias.go @@ -44,7 +44,7 @@ func (k msgServer) RegisterAlias(goCtx context.Context, msg *dymnstypes.MsgRegis sdk.NewCoins(registrationCost), ); err != nil { return nil, errorsmod.Wrap( - errors.Join(gerrc.ErrInternal, err), "failed to register alias for RollApp", + errors.Join(gerrc.ErrUnknown, err), "failed to register alias for RollApp", ) } @@ -92,7 +92,7 @@ func (k Keeper) registerAliasForRollApp( } if err := k.SetAliasForRollAppId(ctx, rollAppId, alias); err != nil { - return errorsmod.Wrap(gerrc.ErrInternal, "failed to set alias for RollApp") + return errorsmod.Wrap(gerrc.ErrUnknown, "failed to set alias for RollApp") } ctx.EventManager().EmitEvent(sdk.NewEvent( diff --git a/x/dymns/keeper/proposal.go b/x/dymns/keeper/proposal.go index adea37860..d04e6f9f2 100644 --- a/x/dymns/keeper/proposal.go +++ b/x/dymns/keeper/proposal.go @@ -73,7 +73,7 @@ func (k Keeper) migrateChainIdsInParams(ctx sdk.Context, previousChainIdsToNewCh } if err := k.SetParams(ctx, params); err != nil { - return errorsmod.Wrapf(errors.Join(gerrc.ErrInternal, err), "failed to update params") + return errorsmod.Wrapf(errors.Join(gerrc.ErrUnknown, err), "failed to update params") } return nil @@ -127,7 +127,7 @@ func (k Keeper) migrateChainIdsInDymNames(ctx sdk.Context, previousChainIdsToNew if err := k.SetDymName(ctx, dymName); err != nil { return errorsmod.Wrapf( - errors.Join(gerrc.ErrInternal, err), + errors.Join(gerrc.ErrUnknown, err), "failed to migrate chain ids for Dym-Name: %s", dymName.Name, ) } @@ -212,7 +212,7 @@ func (k Keeper) UpdateAliases(ctx sdk.Context, add, remove []dymnstypes.UpdateAl params.Chains.AliasesOfChainIds = newAliasesOfChainIds if err := k.SetParams(ctx, params); err != nil { - return errorsmod.Wrap(errors.Join(gerrc.ErrInternal, err), "failed to update params") + return errorsmod.Wrap(errors.Join(gerrc.ErrUnknown, err), "failed to update params") } return nil