From 2633606fb7c815c2e142c53a3ceed0efb28e3955 Mon Sep 17 00:00:00 2001 From: Tomas Tauber <2410580+tomtau@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:29:43 +0800 Subject: [PATCH] Problem: Cosmos SDK is not upgraded to the latest version (0.46.10) (#925) * Problem: Cosmos SDK is not upgraded to the latest version (0.46.10) Solution: upgraded the dependency, plus Go to 1.20.1 * bump net and lint * use cosmos sdk errors package * use the cosmos sdk errors package * wrap newsdk errors * lint fixes * more lint fixes --- .github/workflows/audit.yml | 2 +- .github/workflows/build.yml | 10 +-- .github/workflows/buildwin.yml | 2 +- .github/workflows/codecov.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/goreleaser.yml | 2 +- .github/workflows/lint.yml | 4 +- CHANGELOG.md | 8 ++ Makefile | 2 +- app/ante.go | 7 +- app/test_helpers.go | 3 +- go.mod | 15 ++-- go.sum | 95 +++------------------ gomod2nix.toml | 22 ++--- third_party/cosmos-sdk | 2 +- x/chainmain/types/errors.go | 2 +- x/icaauth/handler.go | 3 +- x/icaauth/keeper/keeper.go | 6 +- x/icaauth/module_ibc.go | 9 +- x/icaauth/types/message_register_account.go | 3 +- x/icaauth/types/message_submit_tx.go | 5 +- x/nft-transfer/ibc_module.go | 24 +++--- x/nft-transfer/keeper/grpc_query.go | 2 +- x/nft-transfer/keeper/packet.go | 3 +- x/nft-transfer/keeper/relay.go | 2 +- x/nft-transfer/keeper/trace.go | 2 +- x/nft-transfer/types/ack.go | 2 +- x/nft-transfer/types/errors.go | 2 +- x/nft-transfer/types/msgs.go | 16 ++-- x/nft-transfer/types/packet.go | 15 ++-- x/nft-transfer/types/trace.go | 2 +- x/nft/handler.go | 3 +- x/nft/keeper/collection.go | 2 +- x/nft/keeper/denom.go | 2 +- x/nft/keeper/grpc_query.go | 2 +- x/nft/keeper/keeper.go | 2 +- x/nft/keeper/nft.go | 2 +- x/nft/keeper/querier.go | 29 ++++--- x/nft/types/errors.go | 2 +- x/nft/types/genesis.go | 3 +- x/nft/types/msgs.go | 15 ++-- x/nft/types/validation.go | 2 +- x/supply/keeper/keeper.go | 3 +- 43 files changed, 147 insertions(+), 196 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 9c88ae230..782c15840 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19.4 + go-version: 1.20.1 - uses: actions/checkout@v2 with: submodules: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f4c30dbb..564629a53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19.4 + go-version: 1.20.1 - name: Checkout Comment PR Branch uses: actions/checkout@v2 if: github.event_name == 'issue_comment' @@ -135,7 +135,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.19.4 + go-version: 1.20.1 - name: install runsim run: | export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/runsim@v1.0.0 @@ -160,7 +160,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.19.4 + go-version: 1.20.1 - name: Checkout Comment PR Branch uses: actions/checkout@v2 if: github.event_name == 'issue_comment' @@ -209,7 +209,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.19.4 + go-version: 1.20.1 - name: Checkout Comment PR Branch uses: actions/checkout@v2 if: github.event_name == 'issue_comment' @@ -257,7 +257,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.19.4 + go-version: 1.20.1 - name: Checkout Comment PR Branch uses: actions/checkout@v2 if: github.event_name == 'issue_comment' diff --git a/.github/workflows/buildwin.yml b/.github/workflows/buildwin.yml index 6aabb0443..d62f6051c 100644 --- a/.github/workflows/buildwin.yml +++ b/.github/workflows/buildwin.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19.4 + go-version: 1.20.1 - name: Normal check out code uses: actions/checkout@v2 with: diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 80898f762..816c31d79 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19.4 + go-version: 1.20.1 - uses: actions/checkout@v2 with: submodules: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0bd878759..d6c5e2da4 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.19.4 + go-version: 1.20.1 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 2dd44ff7f..0f3e24e98 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19.4 + go-version: 1.20.1 - name: release dry run run: make release-dry-run - name: setup release environment diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 27b6be63e..2ac5205bb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.19.4 + go-version: 1.20.1 - uses: actions/checkout@v3 with: submodules: true @@ -27,7 +27,7 @@ jobs: - uses: golangci/golangci-lint-action@v3 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.50 + version: v1.51 args: --timeout 10m github-token: ${{ secrets.github_token }} if: "env.GIT_DIFF != ''" diff --git a/CHANGELOG.md b/CHANGELOG.md index b218b3cf8..56fae8d06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +*February 20, 2023* + +## v4.2.3 +Cosmos SDK was upgraded to v0.46.10 and binaries are built with go 1.20.1. + +### Improvements +- [925](https://github.com/crypto-org-chain/chain-main/issues/925) Cosmos SDK was upgraded to v0.46.10 + *January 3, 2023* ## v4.2.2 diff --git a/Makefile b/Makefile index a15f498cd..bf3b7f7c5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PACKAGES=$(shell go list ./... | grep -v '/simulation') PACKAGE_NAME:=github.com/crypto-org-chain/chain-main -GOLANG_CROSS_VERSION = v1.19.4 +GOLANG_CROSS_VERSION = v1.20.1 VERSION := $(shell echo $(shell git describe --tags 2>/dev/null ) | sed 's/^v//') diff --git a/app/ante.go b/app/ante.go index f50a97678..593f28805 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,6 +1,7 @@ package app import ( + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -18,13 +19,13 @@ type HandlerOptions struct { func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { if options.AccountKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") + return nil, newsdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") } if options.BankKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") + return nil, newsdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") } if options.SignModeHandler == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") + return nil, newsdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") } sigGasConsumer := options.SigGasConsumer diff --git a/app/test_helpers.go b/app/test_helpers.go index 2f6e5350b..7bd63b909 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -18,6 +18,7 @@ import ( tmtypes "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tm-db" + newsdkerrors "cosmossdk.io/errors" bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -436,7 +437,7 @@ func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey) { panic(err) } if len(pkBytes) != ed25519.PubKeySize { - panic(errors.Wrap(errors.ErrInvalidPubKey, "invalid pubkey size")) + panic(newsdkerrors.Wrap(errors.ErrInvalidPubKey, "invalid pubkey size")) } return &ed25519.PubKey{Key: pkBytes} } diff --git a/go.mod b/go.mod index 57dec327e..113cb4cc3 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,13 @@ module github.com/crypto-org-chain/chain-main/v4 -go 1.19 +go 1.20 require ( + cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.3 github.com/armon/go-metrics v0.4.1 github.com/cosmos/cosmos-proto v1.0.0-alpha8 - github.com/cosmos/cosmos-sdk v0.46.9 + github.com/cosmos/cosmos-sdk v0.46.10 github.com/cosmos/ibc-go/v5 v5.2.0 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 @@ -33,7 +34,6 @@ require ( cloud.google.com/go/compute v1.10.0 // indirect cloud.google.com/go/iam v0.5.0 // indirect cloud.google.com/go/storage v1.27.0 // indirect - cosmossdk.io/errors v1.0.0-beta.7 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect @@ -147,9 +147,9 @@ require ( golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect golang.org/x/net v0.5.0 // indirect golang.org/x/oauth2 v0.1.0 // indirect - golang.org/x/sys v0.4.0 // indirect - golang.org/x/term v0.4.0 // indirect - golang.org/x/text v0.6.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.100.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -161,7 +161,7 @@ require ( replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 - + github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.10 github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.11.2-0.20220719170349-e736b9afa7d1 // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 @@ -172,4 +172,5 @@ replace ( // TODO: remove after fixed https://github.com/cosmos/cosmos-sdk/issues/11364 github.com/zondax/hid => github.com/zondax/hid v0.9.0 + golang.org/x/net => golang.org/x/net v0.7.0 ) diff --git a/go.sum b/go.sum index 19d5fc076..580b80719 100644 --- a/go.sum +++ b/go.sum @@ -349,8 +349,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= -github.com/cosmos/cosmos-sdk v0.46.9 h1:s19zY5vX0kjV2eJOzR0Y3P6EqgtgpwMdPmXM05TQsXM= -github.com/cosmos/cosmos-sdk v0.46.9/go.mod h1:ZFL/yjcIZq67H8FiWoLCnnaChkXnbRRYEEhGrFq8fzE= +github.com/cosmos/cosmos-sdk v0.46.10 h1:XaWiCJtoZNCeg9odJsZYotQFQrVqaHyKYDkc8lcoEIw= +github.com/cosmos/cosmos-sdk v0.46.10/go.mod h1:ZFL/yjcIZq67H8FiWoLCnnaChkXnbRRYEEhGrFq8fzE= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -1217,74 +1217,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1390,13 +1324,10 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1415,7 +1346,6 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1424,22 +1354,18 @@ golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1449,9 +1375,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/gomod2nix.toml b/gomod2nix.toml index 95926a301..ec75f59f2 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -79,8 +79,9 @@ schema = 3 version = "v1.0.0-alpha8" hash = "sha256-iXzXoS5Kfh5DBy+PhdFWraDWXda/3M4j7j4VECjv4CA=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.46.9" - hash = "sha256-4D8A/8IfzRICpR2mIwilS9HUVhMjKHwNygf7BeVPwNM=" + version = "v0.46.10" + hash = "sha256-lCrSKm9WZCBcqJv/2c9fUhEPkd9kLo7a/7OgUqcGwdo=" + replaced = "github.com/cosmos/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" hash = "sha256-Qm2aC2vaS8tjtMUbHmlBSagOSqbduEEDwc51qvQaBmA=" @@ -413,20 +414,21 @@ schema = 3 version = "v0.0.0-20220722155223-a9213eeb770e" hash = "sha256-kNgzydWRpjm0sZl4uXEs3LX5L0xjJtJRAFf/CTlYUN4=" [mod."golang.org/x/net"] - version = "v0.5.0" - hash = "sha256-HpbIAiLs7S1+tVsaSSdbCPw1IK43A0bFFuSzPSyjLbo=" + version = "v0.7.0" + hash = "sha256-LgZYZRwtMqm+soNh+esxDSeRuIDxRGb9OEfYaFJHCDI=" + replaced = "golang.org/x/net" [mod."golang.org/x/oauth2"] version = "v0.1.0" hash = "sha256-D6stmD8DEQr0OGIcECpBvszHhw78Imyt3cnblHceJGc=" [mod."golang.org/x/sys"] - version = "v0.4.0" - hash = "sha256-jchMzHCH5dg+IL/F+LqaX/fyAcB/nvHQpfBjqwaRJH0=" + version = "v0.5.0" + hash = "sha256-0LTr3KeJ1OMQAwYUQo1513dXJtQAJn5Dq8sFkc8ps1U=" [mod."golang.org/x/term"] - version = "v0.4.0" - hash = "sha256-wQKxHV10TU4vCU8Re2/hFmAbur/jRWEOB8QXBzgTFNY=" + version = "v0.5.0" + hash = "sha256-f3DiX7NkDsEZpPS+PbmnOH9F5WHFZ1sQrfFg/T2UPno=" [mod."golang.org/x/text"] - version = "v0.6.0" - hash = "sha256-+bpeRWR3relKACdal6NPj+eP5dnWCplTViArSN7/qA4=" + version = "v0.7.0" + hash = "sha256-ydgUqX+t5Qke16C6d3FP/06U/N1n+rUKpLRFj4KXjwk=" [mod."golang.org/x/xerrors"] version = "v0.0.0-20220907171357-04be3eba64a2" hash = "sha256-6+zueutgefIYmgXinOflz8qGDDDj0Zhv+2OkGhBTKno=" diff --git a/third_party/cosmos-sdk b/third_party/cosmos-sdk index 0b6451402..06406f6a7 160000 --- a/third_party/cosmos-sdk +++ b/third_party/cosmos-sdk @@ -1 +1 @@ -Subproject commit 0b64514027ed9f0adf9fdb7841ada7911b3e34d2 +Subproject commit 06406f6a70f228bbb6d09b45a4e343477f1ef7e9 diff --git a/x/chainmain/types/errors.go b/x/chainmain/types/errors.go index ceb33e0be..a5f3d3cef 100644 --- a/x/chainmain/types/errors.go +++ b/x/chainmain/types/errors.go @@ -3,7 +3,7 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "cosmossdk.io/errors" ) // x/chainmain module sentinel errors diff --git a/x/icaauth/handler.go b/x/icaauth/handler.go index 23f1b527a..dcbdc0457 100644 --- a/x/icaauth/handler.go +++ b/x/icaauth/handler.go @@ -3,6 +3,7 @@ package icaauth import ( "fmt" + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/crypto-org-chain/chain-main/v4/x/icaauth/keeper" @@ -25,7 +26,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, newsdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } diff --git a/x/icaauth/keeper/keeper.go b/x/icaauth/keeper/keeper.go index 0b83ae5cb..ad634cc28 100644 --- a/x/icaauth/keeper/keeper.go +++ b/x/icaauth/keeper/keeper.go @@ -4,10 +4,10 @@ import ( "fmt" "time" + newsdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -66,12 +66,12 @@ func (k *Keeper) DoSubmitTx(ctx sdk.Context, connectionID, owner string, msgs [] channelID, found := k.icaControllerKeeper.GetActiveChannelID(ctx, connectionID, portID) if !found { - return sdkerrors.Wrapf(icatypes.ErrActiveChannelNotFound, "failed to retrieve active channel for port %s", portID) + return newsdkerrors.Wrapf(icatypes.ErrActiveChannelNotFound, "failed to retrieve active channel for port %s", portID) } channelCapability, found := k.scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(portID, channelID)) if !found { - return sdkerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability") + return newsdkerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability") } data, err := icatypes.SerializeCosmosTx(k.cdc, msgs) diff --git a/x/icaauth/module_ibc.go b/x/icaauth/module_ibc.go index d888886a3..52fe35a9f 100644 --- a/x/icaauth/module_ibc.go +++ b/x/icaauth/module_ibc.go @@ -3,6 +3,7 @@ package icaauth import ( "strings" + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" @@ -65,7 +66,7 @@ func (am IBCModule) OnChanOpenTry( counterpartyVersion string, ) (string, error) { // https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md#ibcmodule-implementation - return "", sdkerrors.Wrap(icatypes.ErrInvalidChannelFlow, "channel handshake must be initiated by controller chain") + return "", newsdkerrors.Wrap(icatypes.ErrInvalidChannelFlow, "channel handshake must be initiated by controller chain") } // OnChanOpenAck implements the IBCModule interface @@ -86,7 +87,7 @@ func (am IBCModule) OnChanOpenConfirm( channelID string, ) error { // https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md#ibcmodule-implementation - return sdkerrors.Wrap(icatypes.ErrInvalidChannelFlow, "channel handshake must be initiated by controller chain") + return newsdkerrors.Wrap(icatypes.ErrInvalidChannelFlow, "channel handshake must be initiated by controller chain") } // OnChanCloseInit implements the IBCModule interface @@ -96,7 +97,7 @@ func (am IBCModule) OnChanCloseInit( channelID string, ) error { // https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md#ibcmodule-implementation - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") + return newsdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") } // OnChanCloseConfirm implements the IBCModule interface @@ -115,7 +116,7 @@ func (am IBCModule) OnRecvPacket( relayer sdk.AccAddress, ) ibcexported.Acknowledgement { // https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md#ibcmodule-implementation - return channeltypes.NewErrorAcknowledgement(sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "cannot receive packet on controller chain")) + return channeltypes.NewErrorAcknowledgement(newsdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "cannot receive packet on controller chain")) } // OnAcknowledgementPacket implements the IBCModule interface diff --git a/x/icaauth/types/message_register_account.go b/x/icaauth/types/message_register_account.go index 0886d954b..0dfb889e4 100644 --- a/x/icaauth/types/message_register_account.go +++ b/x/icaauth/types/message_register_account.go @@ -1,6 +1,7 @@ package types import ( + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -41,7 +42,7 @@ func (msg *MsgRegisterAccount) GetSignBytes() []byte { func (msg *MsgRegisterAccount) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Owner) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) } return nil } diff --git a/x/icaauth/types/message_submit_tx.go b/x/icaauth/types/message_submit_tx.go index cbfff3f4d..fae4f8a55 100644 --- a/x/icaauth/types/message_submit_tx.go +++ b/x/icaauth/types/message_submit_tx.go @@ -3,6 +3,7 @@ package types import ( "time" + newsdkerrors "cosmossdk.io/errors" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -39,7 +40,7 @@ func (msg MsgSubmitTx) GetMessages() ([]sdk.Msg, error) { for i, msgAny := range msg.Msgs { msg, ok := msgAny.GetCachedValue().(sdk.Msg) if !ok { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "messages contains %T which is not a sdk.Msg", msgAny) + return nil, newsdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "messages contains %T which is not a sdk.Msg", msgAny) } msgs[i] = msg } @@ -83,7 +84,7 @@ func (msg *MsgSubmitTx) GetSignBytes() []byte { func (msg *MsgSubmitTx) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Owner) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) } return nil } diff --git a/x/nft-transfer/ibc_module.go b/x/nft-transfer/ibc_module.go index 5b277993e..ed97a6a90 100644 --- a/x/nft-transfer/ibc_module.go +++ b/x/nft-transfer/ibc_module.go @@ -5,8 +5,10 @@ import ( "math" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + newsdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" @@ -48,16 +50,16 @@ func ValidateTransferChannelParams( return err } if channelSequence > uint64(math.MaxUint32) { - return sdkerrors.Wrapf(types.ErrMaxTransferChannels, "channel sequence %d is greater than max allowed nft-transfer channels %d", channelSequence, uint64(math.MaxUint32)) + return newsdkerrors.Wrapf(types.ErrMaxTransferChannels, "channel sequence %d is greater than max allowed nft-transfer channels %d", channelSequence, uint64(math.MaxUint32)) } if order != channeltypes.UNORDERED { - return sdkerrors.Wrapf(channeltypes.ErrInvalidChannelOrdering, "expected %s channel, got %s ", channeltypes.UNORDERED, order) + return newsdkerrors.Wrapf(channeltypes.ErrInvalidChannelOrdering, "expected %s channel, got %s ", channeltypes.UNORDERED, order) } // Require portID is the portID transfer module is bound to boundPort := keeper.GetPort(ctx) if boundPort != portID { - return sdkerrors.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) + return newsdkerrors.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) } return nil @@ -83,7 +85,7 @@ func (im IBCModule) OnChanOpenInit( } if version != types.Version { - return "", sdkerrors.Wrapf(types.ErrInvalidVersion, "got %s, expected %s", version, types.Version) + return "", newsdkerrors.Wrapf(types.ErrInvalidVersion, "got %s, expected %s", version, types.Version) } // Claim channel capability passed back by IBC module @@ -110,7 +112,7 @@ func (im IBCModule) OnChanOpenTry( } if counterpartyVersion != types.Version { - return "", sdkerrors.Wrapf(types.ErrInvalidVersion, "invalid counterparty version: %s, expected %s", counterpartyVersion, types.Version) + return "", newsdkerrors.Wrapf(types.ErrInvalidVersion, "invalid counterparty version: %s, expected %s", counterpartyVersion, types.Version) } // Module may have already claimed capability in OnChanOpenInit in the case of crossing hellos @@ -136,7 +138,7 @@ func (im IBCModule) OnChanOpenAck( counterpartyVersion string, ) error { if counterpartyVersion != types.Version { - return sdkerrors.Wrapf(types.ErrInvalidVersion, "invalid counterparty version: %s, expected %s", counterpartyVersion, types.Version) + return newsdkerrors.Wrapf(types.ErrInvalidVersion, "invalid counterparty version: %s, expected %s", counterpartyVersion, types.Version) } im.keeper.SetEscrowAddress(ctx, portID, channelID) return nil @@ -159,7 +161,7 @@ func (im IBCModule) OnChanCloseInit( channelID string, ) error { // Disallow user-initiated channel closing for transfer channels - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") + return newsdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") } // OnChanCloseConfirm implements the IBCModule interface @@ -219,11 +221,11 @@ func (im IBCModule) OnAcknowledgementPacket( ) error { var ack channeltypes.Acknowledgement if err := types.ModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-721 transfer packet acknowledgement: %v", err) + return newsdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-721 transfer packet acknowledgement: %v", err) } var data types.NonFungibleTokenPacketData if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-721 transfer packet data: %s", err.Error()) + return newsdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-721 transfer packet data: %s", err.Error()) } if err := im.keeper.OnAcknowledgementPacket(ctx, packet, data, ack); err != nil { @@ -270,7 +272,7 @@ func (im IBCModule) OnTimeoutPacket( ) error { var data types.NonFungibleTokenPacketData if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-721 transfer packet data: %s", err.Error()) + return newsdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-721 transfer packet data: %s", err.Error()) } // refund tokens if err := im.keeper.OnTimeoutPacket(ctx, packet, data); err != nil { diff --git a/x/nft-transfer/keeper/grpc_query.go b/x/nft-transfer/keeper/grpc_query.go index 79bd5d73c..245d43ea3 100644 --- a/x/nft-transfer/keeper/grpc_query.go +++ b/x/nft-transfer/keeper/grpc_query.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" "github.com/crypto-org-chain/chain-main/v4/x/nft-transfer/types" ) diff --git a/x/nft-transfer/keeper/packet.go b/x/nft-transfer/keeper/packet.go index 169aec7f0..987aa9768 100644 --- a/x/nft-transfer/keeper/packet.go +++ b/x/nft-transfer/keeper/packet.go @@ -3,6 +3,7 @@ package keeper import ( "strings" + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" @@ -96,7 +97,7 @@ func (k Keeper) createOutgoingPacket(ctx sdk.Context, owner := nft.GetOwner() if !sender.Equals(owner) { - return channeltypes.Packet{}, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "not token owner") + return channeltypes.Packet{}, newsdkerrors.Wrap(sdkerrors.ErrUnauthorized, "not token owner") } if isAwayFromOrigin { diff --git a/x/nft-transfer/keeper/relay.go b/x/nft-transfer/keeper/relay.go index 6233b015a..f25269565 100644 --- a/x/nft-transfer/keeper/relay.go +++ b/x/nft-transfer/keeper/relay.go @@ -1,10 +1,10 @@ package keeper import ( + sdkerrors "cosmossdk.io/errors" "github.com/armon/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v5/modules/core/24-host" diff --git a/x/nft-transfer/keeper/trace.go b/x/nft-transfer/keeper/trace.go index eeb1d0b07..82c88bc3c 100644 --- a/x/nft-transfer/keeper/trace.go +++ b/x/nft-transfer/keeper/trace.go @@ -1,9 +1,9 @@ package keeper import ( + sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/crypto-org-chain/chain-main/v4/x/nft-transfer/types" tmbytes "github.com/tendermint/tendermint/libs/bytes" ) diff --git a/x/nft-transfer/types/ack.go b/x/nft-transfer/types/ack.go index a7ee55691..9b26d44f9 100644 --- a/x/nft-transfer/types/ack.go +++ b/x/nft-transfer/types/ack.go @@ -3,7 +3,7 @@ package types import ( "fmt" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "cosmossdk.io/errors" channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" ) diff --git a/x/nft-transfer/types/errors.go b/x/nft-transfer/types/errors.go index 6633dc7cb..015200d7a 100644 --- a/x/nft-transfer/types/errors.go +++ b/x/nft-transfer/types/errors.go @@ -1,7 +1,7 @@ package types import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "cosmossdk.io/errors" ) var ( diff --git a/x/nft-transfer/types/msgs.go b/x/nft-transfer/types/msgs.go index 4c24ea1f9..020032f9e 100644 --- a/x/nft-transfer/types/msgs.go +++ b/x/nft-transfer/types/msgs.go @@ -3,9 +3,9 @@ package types import ( "strings" + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" host "github.com/cosmos/ibc-go/v5/modules/core/24-host" ) @@ -51,33 +51,33 @@ func (MsgTransfer) Type() string { // the chain is not known to IBC. func (msg MsgTransfer) ValidateBasic() error { if err := host.PortIdentifierValidator(msg.SourcePort); err != nil { - return sdkerrors.Wrap(err, "invalid source port ID") + return newsdkerrors.Wrap(err, "invalid source port ID") } if err := host.ChannelIdentifierValidator(msg.SourceChannel); err != nil { - return sdkerrors.Wrap(err, "invalid source channel ID") + return newsdkerrors.Wrap(err, "invalid source channel ID") } if strings.TrimSpace(msg.ClassId) == "" { - return sdkerrors.Wrap(ErrInvalidClassID, "classId cannot be blank") + return newsdkerrors.Wrap(ErrInvalidClassID, "classId cannot be blank") } if len(msg.TokenIds) == 0 { - return sdkerrors.Wrap(ErrInvalidTokenID, "tokenId cannot be blank") + return newsdkerrors.Wrap(ErrInvalidTokenID, "tokenId cannot be blank") } for _, tokenID := range msg.TokenIds { if strings.TrimSpace(tokenID) == "" { - return sdkerrors.Wrap(ErrInvalidTokenID, "tokenId cannot be blank") + return newsdkerrors.Wrap(ErrInvalidTokenID, "tokenId cannot be blank") } } // NOTE: sender format must be validated as it is required by the GetSigners function. _, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err) } if strings.TrimSpace(msg.Receiver) == "" { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing recipient address") + return newsdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing recipient address") } return nil } diff --git a/x/nft-transfer/types/packet.go b/x/nft-transfer/types/packet.go index 440d95d7a..3e9eaab53 100644 --- a/x/nft-transfer/types/packet.go +++ b/x/nft-transfer/types/packet.go @@ -4,6 +4,7 @@ import ( "strings" "time" + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -46,33 +47,33 @@ func NewNonFungibleTokenPacketData( // formats defined by their corresponding chains that are not known to IBC. func (nftpd NonFungibleTokenPacketData) ValidateBasic() error { if strings.TrimSpace(nftpd.ClassId) == "" { - return sdkerrors.Wrap(ErrInvalidClassID, "classId cannot be blank") + return newsdkerrors.Wrap(ErrInvalidClassID, "classId cannot be blank") } if len(nftpd.TokenIds) == 0 { - return sdkerrors.Wrap(ErrInvalidTokenID, "tokenId cannot be blank") + return newsdkerrors.Wrap(ErrInvalidTokenID, "tokenId cannot be blank") } if len(nftpd.TokenIds) != len(nftpd.TokenUris) { - return sdkerrors.Wrap(ErrInvalidPacket, "tokenIds and tokenUris lengths do not match") + return newsdkerrors.Wrap(ErrInvalidPacket, "tokenIds and tokenUris lengths do not match") } if strings.TrimSpace(nftpd.Sender) == "" { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "sender address cannot be blank") + return newsdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "sender address cannot be blank") } // decode the sender address if _, err := sdk.AccAddressFromBech32(nftpd.Sender); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid sender address") + return newsdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid sender address") } if strings.TrimSpace(nftpd.Receiver) == "" { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "receiver address cannot be blank") + return newsdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "receiver address cannot be blank") } // decode the receiver address if _, err := sdk.AccAddressFromBech32(nftpd.Receiver); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid receiver address") + return newsdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid receiver address") } return nil } diff --git a/x/nft-transfer/types/trace.go b/x/nft-transfer/types/trace.go index 209fb50a1..7af4e93ff 100644 --- a/x/nft-transfer/types/trace.go +++ b/x/nft-transfer/types/trace.go @@ -10,7 +10,7 @@ import ( tmbytes "github.com/tendermint/tendermint/libs/bytes" tmtypes "github.com/tendermint/tendermint/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "cosmossdk.io/errors" host "github.com/cosmos/ibc-go/v5/modules/core/24-host" ) diff --git a/x/nft/handler.go b/x/nft/handler.go index a35fccdfc..fae2f9181 100644 --- a/x/nft/handler.go +++ b/x/nft/handler.go @@ -3,6 +3,7 @@ package nft import ( + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -39,7 +40,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized nft message type: %T", msg) + return nil, newsdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized nft message type: %T", msg) } } } diff --git a/x/nft/keeper/collection.go b/x/nft/keeper/collection.go index 0784dc0a7..e9efaa7ca 100644 --- a/x/nft/keeper/collection.go +++ b/x/nft/keeper/collection.go @@ -6,9 +6,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" "github.com/crypto-org-chain/chain-main/v4/x/nft/exported" diff --git a/x/nft/keeper/denom.go b/x/nft/keeper/denom.go index 9f103b932..1d7d9e428 100644 --- a/x/nft/keeper/denom.go +++ b/x/nft/keeper/denom.go @@ -3,8 +3,8 @@ package keeper import ( + sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/crypto-org-chain/chain-main/v4/x/nft/types" ) diff --git a/x/nft/keeper/grpc_query.go b/x/nft/keeper/grpc_query.go index 45747c247..c93ac47de 100644 --- a/x/nft/keeper/grpc_query.go +++ b/x/nft/keeper/grpc_query.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" "github.com/crypto-org-chain/chain-main/v4/x/nft/types" diff --git a/x/nft/keeper/keeper.go b/x/nft/keeper/keeper.go index d5f628c64..76c1600cd 100644 --- a/x/nft/keeper/keeper.go +++ b/x/nft/keeper/keeper.go @@ -7,10 +7,10 @@ import ( "github.com/tendermint/tendermint/libs/log" + sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/crypto-org-chain/chain-main/v4/x/nft/types" ) diff --git a/x/nft/keeper/nft.go b/x/nft/keeper/nft.go index cbd640825..4e62053e0 100644 --- a/x/nft/keeper/nft.go +++ b/x/nft/keeper/nft.go @@ -3,8 +3,8 @@ package keeper import ( + sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/crypto-org-chain/chain-main/v4/x/nft/exported" "github.com/crypto-org-chain/chain-main/v4/x/nft/types" diff --git a/x/nft/keeper/querier.go b/x/nft/keeper/querier.go index 42c474259..76f79631a 100644 --- a/x/nft/keeper/querier.go +++ b/x/nft/keeper/querier.go @@ -7,6 +7,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" + newsdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -35,7 +36,7 @@ func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { case types.QueryNFT: return queryNFT(ctx, req, k, legacyQuerierCdc) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown query path: %s", path[0]) + return nil, newsdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown query path: %s", path[0]) } } } @@ -47,7 +48,7 @@ func querySupply(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerier err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } var supply uint64 @@ -69,7 +70,7 @@ func queryOwner(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierC err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } owner, err := k.GetOwner(ctx, params.Owner, params.Denom) @@ -80,7 +81,7 @@ func queryOwner(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierC bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, owner) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -93,7 +94,7 @@ func queryCollection(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQue err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } collection, err := k.GetCollection(ctx, params.Denom) @@ -103,7 +104,7 @@ func queryCollection(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQue bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, collection) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -115,7 +116,7 @@ func queryDenom(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierC var params types.QueryDenomParams if err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms); err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } denom, err := k.GetDenom(ctx, params.ID) @@ -126,7 +127,7 @@ func queryDenom(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierC bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, denom) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -138,7 +139,7 @@ func queryDenomByName(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQu var params types.QueryDenomByNameParams if err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms); err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } denom, err := k.GetDenomByName(ctx, params.Name) @@ -149,7 +150,7 @@ func queryDenomByName(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQu bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, denom) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -162,7 +163,7 @@ func queryDenoms(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerier bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, denoms) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -174,17 +175,17 @@ func queryNFT(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc var params types.QueryNFTParams if err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms); err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } nft, err := k.GetNFT(ctx, params.Denom, params.TokenID) if err != nil { - return nil, sdkerrors.Wrapf(types.ErrUnknownNFT, "invalid NFT %s from collection %s", params.TokenID, params.Denom) + return nil, newsdkerrors.Wrapf(types.ErrUnknownNFT, "invalid NFT %s from collection %s", params.TokenID, params.Denom) } bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, nft) if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) + return nil, newsdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil diff --git a/x/nft/types/errors.go b/x/nft/types/errors.go index ae11bfafb..77310def5 100644 --- a/x/nft/types/errors.go +++ b/x/nft/types/errors.go @@ -3,7 +3,7 @@ package types import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "cosmossdk.io/errors" ) var ( diff --git a/x/nft/types/genesis.go b/x/nft/types/genesis.go index 1f9b7f58e..46c04ad6d 100644 --- a/x/nft/types/genesis.go +++ b/x/nft/types/genesis.go @@ -3,6 +3,7 @@ package types import ( + newsdkerrors "cosmossdk.io/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -23,7 +24,7 @@ func ValidateGenesis(data GenesisState) error { for _, nft := range c.NFTs { if nft.GetOwner().Empty() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing owner") + return newsdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing owner") } if err := ValidateTokenID(nft.GetID()); err != nil { diff --git a/x/nft/types/msgs.go b/x/nft/types/msgs.go index fd776ed15..ca5722386 100644 --- a/x/nft/types/msgs.go +++ b/x/nft/types/msgs.go @@ -3,6 +3,7 @@ package types import ( + newsdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -48,7 +49,7 @@ func (msg MsgIssueDenom) ValidateBasic() error { } if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) } return ValidateDenomName(msg.Name) } @@ -93,11 +94,11 @@ func (msg MsgTransferNFT) ValidateBasic() error { } if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) } if _, err := sdk.AccAddressFromBech32(msg.Recipient); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address (%s)", err) } return ValidateTokenID(msg.Id) } @@ -140,7 +141,7 @@ func (msg MsgEditNFT) Type() string { return TypeMsgEditNFT } // ValidateBasic Implements Msg. func (msg MsgEditNFT) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) } if err := ValidateDenomID(msg.DenomId); err != nil { @@ -192,10 +193,10 @@ func (msg MsgMintNFT) Type() string { return TypeMsgMintNFT } // ValidateBasic Implements Msg. func (msg MsgMintNFT) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) } if _, err := sdk.AccAddressFromBech32(msg.Recipient); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid receipt address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid receipt address (%s)", err) } if err := ValidateDenomID(msg.DenomId); err != nil { return err @@ -239,7 +240,7 @@ func (msg MsgBurnNFT) Type() string { return TypeMsgBurnNFT } // ValidateBasic Implements Msg. func (msg MsgBurnNFT) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) } if err := ValidateDenomID(msg.DenomId); err != nil { return err diff --git a/x/nft/types/validation.go b/x/nft/types/validation.go index 16c101d94..0529675a2 100644 --- a/x/nft/types/validation.go +++ b/x/nft/types/validation.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "cosmossdk.io/errors" ) const ( diff --git a/x/supply/keeper/keeper.go b/x/supply/keeper/keeper.go index ad3076a98..6e6164c1b 100644 --- a/x/supply/keeper/keeper.go +++ b/x/supply/keeper/keeper.go @@ -1,6 +1,7 @@ package keeper import ( + newsdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -119,7 +120,7 @@ func (k Keeper) GetModuleAccountBalance(ctx sdk.Context, moduleName string) sdk. addr := k.accountKeeper.GetModuleAddress(moduleName) if addr == nil { - panic(sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", moduleName)) + panic(newsdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", moduleName)) } return k.bankKeeper.GetAllBalances(ctx, addr)