From 9168ce46d7a898db4c15579a7ff23508403e30d2 Mon Sep 17 00:00:00 2001 From: Alex | Interchain Labs Date: Tue, 29 Apr 2025 09:51:01 -0400 Subject: [PATCH] chore: deprecate nft for future (#24575) --- CHANGELOG.md | 4 ++++ simapp/app.go | 6 +++--- simapp/app_config.go | 4 ++-- x/README.md | 2 +- x/nft/README.md | 2 ++ x/nft/keeper/class.go | 2 +- x/nft/keeper/genesis.go | 2 +- x/nft/keeper/grpc_query.go | 2 +- x/nft/keeper/grpc_query_test.go | 2 +- x/nft/keeper/keeper.go | 3 ++- x/nft/keeper/keeper_test.go | 6 +++--- x/nft/keeper/keys.go | 2 +- x/nft/keeper/msg_server.go | 2 +- x/nft/keeper/msg_server_test.go | 2 +- x/nft/keeper/nft.go | 2 +- x/nft/keeper/nft_batch.go | 2 +- x/nft/keeper/nft_batch_test.go | 2 +- x/nft/keys.go | 1 + x/nft/module/autocli.go | 3 ++- x/nft/module/module.go | 6 +++--- x/nft/simulation/decoder.go | 5 +++-- x/nft/simulation/decoder_test.go | 8 ++++---- x/nft/simulation/genesis.go | 2 +- x/nft/simulation/genesis_test.go | 6 +++--- x/nft/simulation/msg_factory.go | 4 ++-- x/nft/simulation/operations.go | 4 ++-- x/nft/simulation/operations_test.go | 6 +++--- x/nft/testutil/app_config.go | 2 +- 28 files changed, 52 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c30c7a2375..889d899b66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +### Deprecated + +* (x/nft) [#24575](https://github.com/cosmos/cosmos-sdk/pull/24575) Deprecate the `x/nft` module in the Cosmos SDK repository. This module will not be maintained to the extent that our core modules will and will be kept in a [legacy repo](https://github.com/cosmos/cosmos-legacy). + ## [Unreleased] ### Deprecated diff --git a/simapp/app.go b/simapp/app.go index c9b3bf9c34..dd01e397ee 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -29,9 +29,9 @@ import ( "cosmossdk.io/x/feegrant" feegrantkeeper "cosmossdk.io/x/feegrant/keeper" feegrantmodule "cosmossdk.io/x/feegrant/module" - "cosmossdk.io/x/nft" - nftkeeper "cosmossdk.io/x/nft/keeper" - nftmodule "cosmossdk.io/x/nft/module" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + nftkeeper "cosmossdk.io/x/nft/keeper" //nolint:staticcheck // deprecated and to be removed + nftmodule "cosmossdk.io/x/nft/module" //nolint:staticcheck // deprecated and to be removed "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/upgrade" upgradekeeper "cosmossdk.io/x/upgrade/keeper" diff --git a/simapp/app_config.go b/simapp/app_config.go index 83a61547cc..bd38e1dc96 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -36,8 +36,8 @@ import ( "cosmossdk.io/x/feegrant" _ "cosmossdk.io/x/feegrant/module" // import for side-effects "cosmossdk.io/x/nft" - _ "cosmossdk.io/x/nft/module" // import for side-effects - _ "cosmossdk.io/x/upgrade" // import for side-effects + _ "cosmossdk.io/x/nft/module" + _ "cosmossdk.io/x/upgrade" // import for side-effects upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/runtime" diff --git a/x/README.md b/x/README.md index 0f6c3852ed..61bc071b16 100644 --- a/x/README.md +++ b/x/README.md @@ -34,7 +34,6 @@ capabilities of your blockchain or further specialize it. * [Authz](./authz/README.md) - Authorization for accounts to perform actions on behalf of other accounts. * [Epochs](./epochs/README.md) - Registration so SDK modules can have logic to be executed at the timed tickers. * [Feegrant](./feegrant/README.md) - Grant fee allowances for executing transactions. -* [NFT](./nft/README.md) - NFT module implemented based on [ADR43](https://docs.cosmos.network/main/architecture/adr-043-nft-module.html). * [ProtocolPool](./protocolpool/README.md) - Extended management of community pool functionality. ## Deprecated Modules @@ -44,6 +43,7 @@ in an upcoming release of the Cosmos SDK per our [release process](https://githu * [Crisis](./crisis/README.md) - *Deprecated* halting the blockchain under certain circumstances (e.g. if an invariant is broken). * [Params](./params/README.md) - *Deprecated* Globally available parameter store. +* [NFT](./nft/README.md) - *Deprecated* NFT module implemented based on [ADR43](https://docs.cosmos.network/main/architecture/adr-043-nft-module.html). This module will be moved to the `cosmos-sdk-legacy` repo for use. * [Group](./group/README.md) - *Deprecated* Allows for the creation and management of on-chain multisig accounts. This module will be moved to the `cosmos-sdk-legacy` repo for legacy use. To learn more about the process of building modules, visit the [building modules reference documentation](https://docs.cosmos.network/main/building-modules/intro). diff --git a/x/nft/README.md b/x/nft/README.md index 34c1d40660..4348aaca3e 100644 --- a/x/nft/README.md +++ b/x/nft/README.md @@ -4,6 +4,8 @@ sidebar_position: 1 # `x/nft` +⚠️ **DEPRECATED**: This package is deprecated and will be removed in the next major release. The `x/nft` module will be moved to a separate repo `github.com/cosmos/cosmos-sdk-legacy`. + ## Contents ## Abstract diff --git a/x/nft/keeper/class.go b/x/nft/keeper/class.go index 1e73a27bee..b6c6b60c30 100644 --- a/x/nft/keeper/class.go +++ b/x/nft/keeper/class.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/runtime" ) diff --git a/x/nft/keeper/genesis.go b/x/nft/keeper/genesis.go index 20631dbbf6..4cd2a2c26b 100644 --- a/x/nft/keeper/genesis.go +++ b/x/nft/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( "sort" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/nft/keeper/grpc_query.go b/x/nft/keeper/grpc_query.go index e4ccb1cc31..4b892ad48a 100644 --- a/x/nft/keeper/grpc_query.go +++ b/x/nft/keeper/grpc_query.go @@ -4,7 +4,7 @@ import ( "context" "cosmossdk.io/store/prefix" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/nft/keeper/grpc_query_test.go b/x/nft/keeper/grpc_query_test.go index 42e5c56586..407a9474c3 100644 --- a/x/nft/keeper/grpc_query_test.go +++ b/x/nft/keeper/grpc_query_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/codec/address" ) diff --git a/x/nft/keeper/keeper.go b/x/nft/keeper/keeper.go index d2718d3262..af3215a4be 100644 --- a/x/nft/keeper/keeper.go +++ b/x/nft/keeper/keeper.go @@ -1,9 +1,10 @@ +// Deprecated: This package is deprecated and will be removed in the next major release. The `x/nft` module will be moved to a separate repo `github.com/cosmos/cosmos-sdk-legacy`. package keeper import ( "cosmossdk.io/core/address" store "cosmossdk.io/core/store" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/codec" ) diff --git a/x/nft/keeper/keeper_test.go b/x/nft/keeper/keeper_test.go index 2aea94fd8a..a73d2c38fd 100644 --- a/x/nft/keeper/keeper_test.go +++ b/x/nft/keeper/keeper_test.go @@ -9,9 +9,9 @@ import ( "go.uber.org/mock/gomock" storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/keeper" - "cosmossdk.io/x/nft/module" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/keeper" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/module" //nolint:staticcheck // deprecated and to be removed nfttestutil "cosmossdk.io/x/nft/testutil" "github.com/cosmos/cosmos-sdk/baseapp" diff --git a/x/nft/keeper/keys.go b/x/nft/keeper/keys.go index 51c8b27435..8de0428579 100644 --- a/x/nft/keeper/keys.go +++ b/x/nft/keeper/keys.go @@ -3,7 +3,7 @@ package keeper import ( "bytes" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed "cosmossdk.io/x/nft/internal/conv" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/nft/keeper/msg_server.go b/x/nft/keeper/msg_server.go index a33fa7e791..737a5a474f 100644 --- a/x/nft/keeper/msg_server.go +++ b/x/nft/keeper/msg_server.go @@ -5,7 +5,7 @@ import ( "context" errorsmod "cosmossdk.io/errors" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/nft/keeper/msg_server_test.go b/x/nft/keeper/msg_server_test.go index ae70d60b52..1235bb8f1e 100644 --- a/x/nft/keeper/msg_server_test.go +++ b/x/nft/keeper/msg_server_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "fmt" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed ) var ( diff --git a/x/nft/keeper/nft.go b/x/nft/keeper/nft.go index f6c206dbb2..738ee1bbc8 100644 --- a/x/nft/keeper/nft.go +++ b/x/nft/keeper/nft.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/errors" "cosmossdk.io/store/prefix" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/nft/keeper/nft_batch.go b/x/nft/keeper/nft_batch.go index 889e67fe33..f7e11b6192 100644 --- a/x/nft/keeper/nft_batch.go +++ b/x/nft/keeper/nft_batch.go @@ -4,7 +4,7 @@ import ( "context" "cosmossdk.io/errors" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/nft/keeper/nft_batch_test.go b/x/nft/keeper/nft_batch_test.go index 18c92b3f2f..86d7af5fc6 100644 --- a/x/nft/keeper/nft_batch_test.go +++ b/x/nft/keeper/nft_batch_test.go @@ -4,7 +4,7 @@ import ( "fmt" "math/rand" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed ) func (s *TestSuite) TestBatchMint() { diff --git a/x/nft/keys.go b/x/nft/keys.go index fac6adb7ae..bf7153308a 100644 --- a/x/nft/keys.go +++ b/x/nft/keys.go @@ -1,3 +1,4 @@ +// Deprecated: This package is deprecated and will be removed in the next major release. The `x/nft` module will be moved to a separate repo `github.com/cosmos/cosmos-sdk-legacy`. package nft const ( diff --git a/x/nft/module/autocli.go b/x/nft/module/autocli.go index 5a9d8289fc..0cd0d61ffb 100644 --- a/x/nft/module/autocli.go +++ b/x/nft/module/autocli.go @@ -1,3 +1,4 @@ +// Deprecated: This package is deprecated and will be removed in the next major release. The `x/nft` module will be moved to a separate repo `github.com/cosmos/cosmos-sdk-legacy`. package module import ( @@ -5,7 +6,7 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" nftv1beta1 "cosmossdk.io/api/cosmos/nft/v1beta1" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/version" ) diff --git a/x/nft/module/module.go b/x/nft/module/module.go index 60d303e019..2993a0fb75 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -13,9 +13,9 @@ import ( "cosmossdk.io/core/store" "cosmossdk.io/depinject" "cosmossdk.io/errors" - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/keeper" - "cosmossdk.io/x/nft/simulation" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/keeper" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/simulation" //nolint:staticcheck // deprecated and to be removed sdkclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/nft/simulation/decoder.go b/x/nft/simulation/decoder.go index 7c7fcef4a0..3f506c8d1b 100644 --- a/x/nft/simulation/decoder.go +++ b/x/nft/simulation/decoder.go @@ -1,11 +1,12 @@ +// Deprecated: This package is deprecated and will be removed in the next major release. The `x/nft` module will be moved to a separate repo `github.com/cosmos/cosmos-sdk-legacy`. package simulation import ( "bytes" "fmt" - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/keeper" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/keeper" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/nft/simulation/decoder_test.go b/x/nft/simulation/decoder_test.go index 2601d42fef..e9be61d1c3 100644 --- a/x/nft/simulation/decoder_test.go +++ b/x/nft/simulation/decoder_test.go @@ -6,10 +6,10 @@ import ( "github.com/stretchr/testify/require" - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/keeper" - "cosmossdk.io/x/nft/module" - "cosmossdk.io/x/nft/simulation" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/keeper" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/module" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/simulation" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/nft/simulation/genesis.go b/x/nft/simulation/genesis.go index ec115681f7..a5b7e0c5bc 100644 --- a/x/nft/simulation/genesis.go +++ b/x/nft/simulation/genesis.go @@ -4,7 +4,7 @@ import ( "math/rand" "cosmossdk.io/core/address" - "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/nft/simulation/genesis_test.go b/x/nft/simulation/genesis_test.go index a04511ed15..a9f25de8f8 100644 --- a/x/nft/simulation/genesis_test.go +++ b/x/nft/simulation/genesis_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" - "cosmossdk.io/x/nft" - nftmodule "cosmossdk.io/x/nft/module" - "cosmossdk.io/x/nft/simulation" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + nftmodule "cosmossdk.io/x/nft/module" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/simulation" //nolint:staticcheck // deprecated and to be removed addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/x/nft/simulation/msg_factory.go b/x/nft/simulation/msg_factory.go index ca100ec859..fef2cfe3cb 100644 --- a/x/nft/simulation/msg_factory.go +++ b/x/nft/simulation/msg_factory.go @@ -3,8 +3,8 @@ package simulation import ( "context" - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/keeper" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/keeper" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/testutil/simsx" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/nft/simulation/operations.go b/x/nft/simulation/operations.go index 64483f743e..bb39d896a7 100644 --- a/x/nft/simulation/operations.go +++ b/x/nft/simulation/operations.go @@ -3,8 +3,8 @@ package simulation import ( "math/rand" - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/keeper" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/keeper" //nolint:staticcheck // deprecated and to be removed "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" diff --git a/x/nft/simulation/operations_test.go b/x/nft/simulation/operations_test.go index 15de260f6e..42813202e4 100644 --- a/x/nft/simulation/operations_test.go +++ b/x/nft/simulation/operations_test.go @@ -10,9 +10,9 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" - "cosmossdk.io/x/nft" - nftkeeper "cosmossdk.io/x/nft/keeper" - "cosmossdk.io/x/nft/simulation" + "cosmossdk.io/x/nft" //nolint:staticcheck // deprecated and to be removed + nftkeeper "cosmossdk.io/x/nft/keeper" //nolint:staticcheck // deprecated and to be removed + "cosmossdk.io/x/nft/simulation" //nolint:staticcheck // deprecated and to be removed "cosmossdk.io/x/nft/testutil" "github.com/cosmos/cosmos-sdk/client" diff --git a/x/nft/testutil/app_config.go b/x/nft/testutil/app_config.go index 6e7d85f775..a7236b483f 100644 --- a/x/nft/testutil/app_config.go +++ b/x/nft/testutil/app_config.go @@ -1,7 +1,7 @@ package testutil import ( - _ "cosmossdk.io/x/nft/module" // import as blank for app wiring + _ "cosmossdk.io/x/nft/module" //nolint:staticcheck // deprecated and to be removed // import as blank for app wiring "github.com/cosmos/cosmos-sdk/testutil/configurator" _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring