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

make lint shows deprecated usage of sdkerrors #1446

Closed
rootulp opened this issue Mar 7, 2023 · 0 comments · Fixed by #1448
Closed

make lint shows deprecated usage of sdkerrors #1446

rootulp opened this issue Mar 7, 2023 · 0 comments · Fixed by #1448
Assignees
Labels
chore optional label for items that follow the `chore` conventional commit

Comments

@rootulp
Copy link
Collaborator

rootulp commented Mar 7, 2023

Problem

make lint results in warnings:

$ make lint
--> Running golangci-lint
x/blob/types/errors.go:10:38: SA1019: sdkerrors.Register is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
	ErrReservedNamespace              = sdkerrors.Register(ModuleName, 11110, "cannot use reserved namespace IDs")
	                                    ^
x/blob/types/errors.go:11:38: SA1019: sdkerrors.Register is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
	ErrInvalidNamespaceLen            = sdkerrors.Register(ModuleName, 11111, "invalid namespace length")
	                                    ^
x/blob/types/errors.go:12:38: SA1019: sdkerrors.Register is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
	ErrInvalidDataSize                = sdkerrors.Register(ModuleName, 11112, "data must be multiple of shareSize")
	                                    ^
x/tokenfilter/ibc_middleware.go:60:12: SA1019: sdkerrors.Wrapf is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
	ackErr := sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "only native denom transfers accepted, got %s", data.Denom)
	          ^
x/blob/handler.go:24:16: SA1019: sdkerrors.Wrap is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
			return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)
			            ^
x/qgb/types/genesis.go:33:10: SA1019: sdkerrors.Wrap is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
		return sdkerrors.Wrap(err, "params")
		       ^
x/qgb/types/genesis.go:64:10: SA1019: sdkerrors.Wrap is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
		return sdkerrors.Wrap(err, "data commitment window")
		       ^
x/qgb/types/validator.go:28:16: SA1019: sdkerrors.Wrapf is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
			return nil, sdkerrors.Wrapf(err, "member %d", i)
			            ^
x/qgb/types/validator.go:173:11: SA1019: sdkerrors.Wrapf is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
			return sdkerrors.Wrapf(err, "member %d", i)
			       ^
make: *** [lint] Error 1

Proposal

https://pkg.go.dev/github.com/cosmos/cosmos-sdk@v0.46.7/types/errors claims

New code should generally import cosmossdk.io/errors directly and define a custom set of errors in custom codespace, rather than importing this package.

But we should verify if using cosmossdk.io/errors directly results in a breaking change to exported errors. It's likely possible to make this change even if it is breaking.

@rootulp rootulp added the chore optional label for items that follow the `chore` conventional commit label Mar 7, 2023
@rootulp rootulp self-assigned this Mar 7, 2023
rootulp added a commit that referenced this issue Mar 7, 2023
Closes #1446

Before: `make lint` showed warnings
After: `make lint` shows no more warnings

```shell
$ make lint
--> Running golangci-lint
--> Running markdownlint
```
0xchainlover pushed a commit to celestia-org/celestia-app that referenced this issue Aug 1, 2024
Closes celestiaorg/celestia-app#1446

Before: `make lint` showed warnings
After: `make lint` shows no more warnings

```shell
$ make lint
--> Running golangci-lint
--> Running markdownlint
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore optional label for items that follow the `chore` conventional commit
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant