Skip to content

Commit 86c7a23

Browse files
committed
remove redudant error package
1 parent 49173f0 commit 86c7a23

File tree

4 files changed

+9
-174
lines changed

4 files changed

+9
-174
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ all: tools install lint
7777
## govet: Run go vet.
7878
govet:
7979
@echo Running go vet...
80-
@go vet ./...
80+
@go vet $(shell go list ./... | grep -v '/api')
8181

8282
## govulncheck: Run govulncheck
8383
govulncheck:

pkg/errors/critical.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ package errors
33

44
import (
55
"fmt"
6+
7+
sdkerrors "cosmossdk.io/errors"
68
)
79

810
const codespace = "NETWORK-CRITICAL"
911

10-
var ErrCritical = Register(codespace, 3, "the state of the blockchain is inconsistent or an invariant is broken")
12+
var ErrCritical = sdkerrors.Register(codespace, 3, "the state of the blockchain is inconsistent or an invariant is broken")
1113

1214
// Critical handles and/or returns an error in case a critical error has been encountered:
1315
// - Inconsistent state
1416
// - Broken invariant
1517
func Critical(description string) error {
16-
return Wrap(ErrCritical, description)
18+
return sdkerrors.Wrap(ErrCritical, description)
1719
}
1820

1921
// Criticalf extends a critical error with additional information.

pkg/errors/errors.go

Lines changed: 0 additions & 166 deletions
This file was deleted.

x/profile/keeper/msg_server_validator.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
sdk "github.com/cosmos/cosmos-sdk/types"
99
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
1010

11-
"github.com/ignite/network/pkg/errors"
1211
"github.com/ignite/network/x/profile/types"
1312
)
1413

@@ -23,7 +22,7 @@ func (k msgServer) UpdateValidatorDescription(ctx context.Context, msg *types.Ms
2322

2423
// Check if the validator address is already in the store
2524
validator, err := k.Validator.Get(ctx, msg.Address)
26-
if errors.IsOf(err, collections.ErrNotFound) {
25+
if errorsmod.IsOf(err, collections.ErrNotFound) {
2726
validator = types.Validator{
2827
Address: msg.Address,
2928
Description: types.ValidatorDescription{},
@@ -48,7 +47,7 @@ func (k msgServer) UpdateValidatorDescription(ctx context.Context, msg *types.Ms
4847
validator.Description.SecurityContact = msg.SecurityContact
4948
}
5049

51-
if errors.IsOf(err, collections.ErrNotFound) {
50+
if errorsmod.IsOf(err, collections.ErrNotFound) {
5251
err = sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(
5352
&types.EventValidatorCreated{
5453
Address: validator.Address,
@@ -83,7 +82,7 @@ func (k msgServer) AddValidatorOperatorAddress(ctx context.Context, msg *types.M
8382

8483
// get the current validator to eventually overwrite description and add opAddr
8584
validatorStore, err := k.Validator.Get(ctx, valAddr)
86-
if !errors.IsOf(err, collections.ErrNotFound) {
85+
if !errorsmod.IsOf(err, collections.ErrNotFound) {
8786
validator.Description = validatorStore.Description
8887
validator = validatorStore.AddValidatorOperatorAddress(opAddr)
8988
}
@@ -100,7 +99,7 @@ func (k msgServer) AddValidatorOperatorAddress(ctx context.Context, msg *types.M
10099
}
101100

102101
sdkCtx := sdk.UnwrapSDKContext(ctx)
103-
if !errors.IsOf(err, collections.ErrNotFound) {
102+
if !errorsmod.IsOf(err, collections.ErrNotFound) {
104103
err = sdkCtx.EventManager().EmitTypedEvent(
105104
&types.EventValidatorOperatorAddressesUpdated{
106105
Address: validator.Address,

0 commit comments

Comments
 (0)