chore: bump linter (#25537)

This commit is contained in:
Alex | Cosmos Labs 2025-11-03 11:30:03 -05:00 committed by GitHub
parent ad7c4c4cc6
commit 12d63d04a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
65 changed files with 87 additions and 79 deletions

View File

@ -379,7 +379,7 @@ benchmark:
### Linting ###
###############################################################################
golangci_version=v2.5.0
golangci_version=v2.6.0
lint-install:
@echo "--> Installing golangci-lint $(golangci_version)"

View File

@ -348,6 +348,7 @@ func (ctx Context) PrintProto(toPrint proto.Message) error {
// PrintObjectLegacy is a variant of PrintProto that doesn't require a proto.Message type
// and uses amino JSON encoding.
//
// Deprecated: It will be removed in the near future!
func (ctx Context) PrintObjectLegacy(toPrint any) error {
out, err := ctx.LegacyAmino.MarshalJSON(toPrint)

View File

@ -1,5 +1,4 @@
//go:build ledger || test_ledger_mock
// +build ledger test_ledger_mock
package keys

View File

@ -23,6 +23,7 @@ import (
// ProtoCodecMarshaler defines an interface for codecs that utilize Protobuf for both
// binary and JSON encoding.
//
// Deprecated: Use Codec instead.
type ProtoCodecMarshaler interface {
Codec

View File

@ -1,5 +1,4 @@
//go:build ledger || test_ledger_mock
// +build ledger test_ledger_mock
package keyring

View File

@ -1,5 +1,4 @@
//go:build linux
// +build linux
package keyring

View File

@ -1,5 +1,4 @@
//go:build linux
// +build linux
package keyring

View File

@ -1,5 +1,4 @@
//go:build !linux
// +build !linux
package keyring

View File

@ -1,5 +1,4 @@
//go:build libsecp256k1_sdk
// +build libsecp256k1_sdk
package secp256k1

View File

@ -1,5 +1,4 @@
//go:build libsecp256k1_sdk
// +build libsecp256k1_sdk
package secp256k1

View File

@ -1,5 +1,4 @@
//go:build !libsecp256k1_sdk
// +build !libsecp256k1_sdk
package secp256k1

View File

@ -1,5 +1,4 @@
//go:build !libsecp256k1_sdk
// +build !libsecp256k1_sdk
package secp256k1

View File

@ -1,5 +1,4 @@
//go:build ledger && test_ledger_mock
// +build ledger,test_ledger_mock
package ledger

View File

@ -1,5 +1,4 @@
//go:build !cgo || !ledger
// +build !cgo !ledger
// test_ledger_mock

View File

@ -1,5 +1,4 @@
//go:build cgo && ledger && !test_ledger_mock
// +build cgo,ledger,!test_ledger_mock
package ledger

View File

@ -1,5 +1,4 @@
//go:build ledger
// +build ledger
package ledger

View File

@ -121,7 +121,7 @@ func (s *internalIntTestSuite) TestImmutabilityArithInt() {
bi := new(big.Int).SetInt64(n)
for j := 0; j < size; j++ {
op := ops[rand.Intn(len(ops))]
op := ops[rand.Intn(len(ops))] //nolint:gosec // testing
uis[j], bis[j] = op(ui, bi)
}

View File

@ -22,6 +22,7 @@ const (
// LegacyDecimalPrecisionBits bits required to represent the above precision
// Ceiling[Log2[10^Precision - 1]]
//
// Deprecated: This is unused and will be removed
LegacyDecimalPrecisionBits = 60

View File

@ -62,7 +62,7 @@ type App struct {
// RegisterModules registers the provided modules with the module manager and
// the basic module manager. This is the primary hook for integrating with
// modules which are not registered using the app config.
func (a *App) RegisterModules(modules ...module.AppModule) error {
func (a *App) RegisterModules(modules ...module.AppModule) error { //nolint:staticcheck // needed for legacy compatibility
for _, appModule := range modules {
name := appModule.Name()
if _, ok := a.ModuleManager.Modules[name]; ok {

View File

@ -11,7 +11,7 @@ import (
cmtrpcserver "github.com/cometbft/cometbft/rpc/jsonrpc/server"
gateway "github.com/cosmos/gogogateway"
"github.com/golang/protobuf/proto" //nolint:staticcheck // keep for compat
"github.com/golang/protobuf/proto" //nolint:staticcheck // needed for compatibility
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"

View File

@ -14,7 +14,7 @@ import (
"strings"
"testing"
"github.com/golang/protobuf/proto" //nolint:staticcheck // keep for compat
"github.com/golang/protobuf/proto" //nolint:staticcheck // needed for testing
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"google.golang.org/grpc/codes"

View File

@ -1,5 +1,4 @@
//go:build test_amino
// +build test_amino
package params

View File

@ -1,5 +1,4 @@
//go:build !test_amino
// +build !test_amino
package params

View File

@ -475,18 +475,18 @@ func doOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, op int, args ...int
require.NoError(t, err)
case opSetRange:
require.True(t, len(args) > 1)
start := args[0]
end := args[1] //nolint:gosec // this is not out of range
start := args[0] //nolint:gosec // this is not out of range
end := args[1] //nolint:gosec // this is not out of range
setRange(t, st, truth, start, end)
case opDel:
k := args[0]
k := args[0] //nolint:gosec // this is not out of range
st.Delete(keyFmt(k))
err := truth.Delete(keyFmt(k))
require.NoError(t, err)
case opDelRange:
require.True(t, len(args) > 1)
start := args[0]
end := args[1] //nolint:gosec // this is not out of range
start := args[0] //nolint:gosec // this is not out of range
end := args[1] //nolint:gosec // this is not out of range
deleteRange(t, st, truth, start, end)
case opWrite:
st.Write()

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package auth

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package authz

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package client

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package cmtservice_test

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package distribution

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package gov

View File

@ -260,7 +260,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() {
for _, tc := range testCases {
s.Run(tc.name, func() {
cmd := cli.NewCmdSubmitLegacyProposal()
cmd := cli.NewCmdSubmitLegacyProposal() //nolint:staticcheck // needed for legacy testing
clientCtx := val.ClientCtx
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package mint

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package server_test

View File

@ -1,5 +1,4 @@
//go:build e2e
// +build e2e
package testutil

View File

@ -1144,6 +1144,7 @@ func (s *E2ETestSuite) mkTxBuilder() client.TxBuilder {
// protoTxProvider is a type which can provide a proto transaction. It is a
// workaround to get access to the wrapper TxBuilder's method GetProtoTx().
//
// Deprecated: It's only used for testing the deprecated Simulate gRPC endpoint
// using a proto Tx field.
type protoTxProvider interface {
@ -1151,6 +1152,7 @@ type protoTxProvider interface {
}
// txBuilderToProtoTx converts a txBuilder into a proto tx.Tx.
//
// Deprecated: It's used for testing the deprecated Simulate gRPC endpoint
// using a proto Tx field and for testing the TxEncode endpoint.
func txBuilderToProtoTx(txBuilder client.TxBuilder) (*tx.Tx, error) {

View File

@ -162,7 +162,7 @@ func TestAminoJSON_Equivalence(t *testing.T) {
signBz, err := handler.GetSignBytes(context.Background(), signerData, txData)
require.NoError(t, err)
legacyHandler := tx.NewSignModeLegacyAminoJSONHandler()
legacyHandler := tx.NewSignModeLegacyAminoJSONHandler() //nolint:staticcheck // needed for legacy testing
txBuilder := encCfg.TxConfig.NewTxBuilder()
require.NoError(t, txBuilder.SetMsgs([]types.Msg{tt.Gogo}...))
txBuilder.SetMemo(handlerOptions.Memo)
@ -457,7 +457,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) {
require.Equal(t, string(gogoBytes), string(newGogoBytes))
// test amino json signer handler equivalence
msg, ok := tc.gogo.(legacytx.LegacyMsg)
msg, ok := tc.gogo.(legacytx.LegacyMsg) //nolint:staticcheck // needed for legacy testing
if !ok {
// not signable
return
@ -482,7 +482,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) {
signBz, err := handler.GetSignBytes(context.Background(), signerData, txData)
require.NoError(t, err)
legacyHandler := tx.NewSignModeLegacyAminoJSONHandler()
legacyHandler := tx.NewSignModeLegacyAminoJSONHandler() //nolint:staticcheck // needed for legacy testing
txBuilder := encCfg.TxConfig.NewTxBuilder()
require.NoError(t, txBuilder.SetMsgs([]types.Msg{msg}...))
txBuilder.SetMemo(handlerOptions.Memo)

View File

@ -52,6 +52,7 @@ func SetupSimulation(config simtypes.Config, dirPrefix, dbName string, verbose,
// SimulationOperations retrieves the simulation params from the provided file path
// and returns all the modules weighted operations
//
// Deprecated: use BuildSimulationOperations with TxConfig
func SimulationOperations(app runtime.AppI, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation {
return BuildSimulationOperations(app, cdc, config, moduletestutil.MakeTestTxConfig())

View File

@ -38,6 +38,7 @@ func NewAppModule(keeper *keeper.Keeper) AppModule {
func (AppModule) ConsensusVersion() uint64 { return 1 }
// Name returns the module's name.
//
// Deprecated: kept for legacy reasons.
func (AppModule) Name() string { return types.ModuleName }

View File

@ -109,6 +109,7 @@ func (coin Coin) IsLTE(other Coin) bool {
}
// IsEqual returns true if the two sets of Coins have the same value
//
// Deprecated: Use Coin.Equal instead.
func (coin Coin) IsEqual(other Coin) bool {
return coin.Equal(other)
@ -700,6 +701,7 @@ func (coins Coins) AmountOf(denom string) math.Int {
// AmountOfNoDenomValidation returns the amount of a denom from coins
// without validating the denomination.
//
// Deprecated: use AmountOf
func (coins Coins) AmountOfNoDenomValidation(denom string) math.Int {
return coins.AmountOf(denom)

View File

@ -39,6 +39,7 @@ var (
LegacyDecValue collcodec.ValueCodec[math.LegacyDec] = legacyDecValueCodec{}
// TimeKey represents a collections.KeyCodec to work with time.Time
//
// Deprecated: exists only for state compatibility reasons, should not
// be used for new storage keys using time. Please use the time KeyCodec
// provided in the collections package.

View File

@ -82,6 +82,7 @@ func (coin DecCoin) IsLT(other DecCoin) bool {
}
// IsEqual returns true if the two sets of Coins have the same value.
//
// Deprecated: Use DecCoin.Equal instead.
func (coin DecCoin) IsEqual(other DecCoin) bool {
return coin.Equal(other)

View File

@ -198,6 +198,7 @@ type HasABCIGenesis interface {
// AppModule is the form for an application module. Most of
// its functionality has been moved to extension interfaces.
//
// Deprecated: use appmodule.AppModule with a combination of extension interfaces instead.
type AppModule interface {
appmodule.AppModule
@ -229,6 +230,7 @@ type HasConsensusVersion interface {
}
// HasABCIEndblock is a released typo of HasABCIEndBlock.
//
// Deprecated: use HasABCIEndBlock instead.
type HasABCIEndblock HasABCIEndBlock

View File

@ -11,7 +11,7 @@ import (
cmtt "github.com/cometbft/cometbft/proto/tendermint/types"
coretypes "github.com/cometbft/cometbft/rpc/core/types"
cmt "github.com/cometbft/cometbft/types"
"github.com/golang/protobuf/proto" //nolint:staticcheck // keep for compat
"github.com/golang/protobuf/proto" //nolint:staticcheck // needed for testing
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

View File

@ -19,6 +19,7 @@ import (
// LegacyMsg defines the old interface a message must fulfill,
// containing Amino signing method.
//
// Deprecated: Please use `Msg` instead.
type LegacyMsg interface {
sdk.Msg
@ -59,6 +60,7 @@ func mustSortJSON(bz []byte) []byte {
}
// StdSignBytes returns the bytes to sign for a transaction.
//
// Deprecated: Please use x/tx/signing/aminojson instead.
func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string) []byte {
if RegressionTestingAminoCodec == nil {

View File

@ -22,6 +22,7 @@ type signModeLegacyAminoJSONHandler struct{}
// NewSignModeLegacyAminoJSONHandler returns a new signModeLegacyAminoJSONHandler.
// Note: The public constructor is only used for testing.
//
// Deprecated: Please use x/tx/signing/aminojson instead.
func NewSignModeLegacyAminoJSONHandler() signing.SignModeHandler {
return signModeLegacyAminoJSONHandler{}

View File

@ -56,28 +56,32 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) {
expectedSignBz []byte
}{
{
"signer which is also fee payer (no tips)", addr1.String(),
func(w *wrapper) {},
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo),
name: "signer which is also fee payer (no tips)",
signer: addr1.String(),
malleate: func(w *wrapper) {},
expectedSignBz: legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo), //nolint:staticcheck // needed for legacy testing
},
{
"explicit fee payer", addr1.String(),
func(w *wrapper) { w.SetFeePayer(addr2) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo),
name: "explicit fee payer",
signer: addr1.String(),
malleate: func(w *wrapper) { w.SetFeePayer(addr2) },
expectedSignBz: legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo), //nolint:staticcheck // needed for legacy testing
},
{
"explicit fee granter", addr1.String(),
func(w *wrapper) { w.SetFeeGranter(addr2) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo),
name: "explicit fee granter",
signer: addr1.String(),
malleate: func(w *wrapper) { w.SetFeeGranter(addr2) },
expectedSignBz: legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo), //nolint:staticcheck // needed for legacy testing
},
{
"explicit fee payer and fee granter", addr1.String(),
func(w *wrapper) {
name: "explicit fee payer and fee granter",
signer: addr1.String(),
malleate: func(w *wrapper) {
w.SetFeePayer(addr2)
w.SetFeeGranter(addr2)
},
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo),
expectedSignBz: legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo), //nolint:staticcheck // needed for legacy testing
},
}
@ -156,28 +160,32 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) {
expectedSignBz []byte
}{
{
"signer which is also fee payer (no tips)", addr1.String(),
func(w *wrapper) {},
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo),
name: "signer which is also fee payer (no tips)",
signer: addr1.String(),
malleate: func(w *wrapper) {},
expectedSignBz: legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo), // nolint:staticcheck // maintain for legacy testing
},
{
"explicit fee payer", addr1.String(),
func(w *wrapper) { w.SetFeePayer(addr2) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo),
name: "explicit fee payer",
signer: addr1.String(),
malleate: func(w *wrapper) { w.SetFeePayer(addr2) },
expectedSignBz: legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo), // nolint:staticcheck // maintain for legacy testing
},
{
"explicit fee granter", addr1.String(),
func(w *wrapper) { w.SetFeeGranter(addr2) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo),
name: "explicit fee granter",
signer: addr1.String(),
malleate: func(w *wrapper) { w.SetFeeGranter(addr2) },
expectedSignBz: legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo), // nolint:staticcheck // maintain for legacy testing
},
{
"explicit fee payer and fee granter", addr1.String(),
func(w *wrapper) {
name: "explicit fee payer and fee granter",
signer: addr1.String(),
malleate: func(w *wrapper) {
w.SetFeePayer(addr2)
w.SetFeeGranter(addr2)
},
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo),
expectedSignBz: legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo), // nolint:staticcheck // maintain for legacy testing
},
}

View File

@ -6,7 +6,7 @@ import (
"strings"
gogogrpc "github.com/cosmos/gogoproto/grpc"
"github.com/golang/protobuf/proto" //nolint:staticcheck // keep for compat
"github.com/golang/protobuf/proto" //nolint:staticcheck // needed for testing
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

View File

@ -111,7 +111,7 @@ func TestAminoJSON(t *testing.T) {
for i, tt := range tests {
t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) {
tx.Msgs = []sdk.Msg{tt.msg}
legacyJSON := string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tt.msg}, "memo"))
legacyJSON := string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tt.msg}, "memo")) // nolint:staticcheck // maintain for legacy testing
require.Equal(t, tt.exp, legacyJSON)
legacyAny, err := cdctypes.NewAnyWithValue(tt.msg)

View File

@ -72,7 +72,7 @@ func (suite *KeeperTestSuite) TestQueryBalance() {
types.NewQueryBalanceRequest(addr, barDenom),
"",
func(res *types.QueryBalanceResponse) {
suite.True(res.Balance.IsEqual(newBarCoin(30)))
suite.True(res.Balance.Equal(newBarCoin(30)))
},
},
}

View File

@ -10,6 +10,7 @@ import (
var (
// KeySendEnabled is store's key for SendEnabled Params
//
// Deprecated: Use the SendEnabled functionality in the keeper.
KeySendEnabled = []byte("SendEnabled")
// KeyDefaultSendEnabled is store's key for the DefaultSendEnabled option

View File

@ -47,6 +47,7 @@ func NewAppModule(keeper *keeper.Keeper) AppModule {
func (am AppModule) IsAppModule() {}
// Name returns the epochs module's name.
//
// Deprecated: kept for legacy reasons.
func (AppModule) Name() string {
return types.ModuleName

View File

@ -529,7 +529,7 @@ func (s *CLITestSuite) msgSubmitLegacyProposal(clientCtx client.Context, from, t
args = append(args, extraArgs...)
cmd := govcli.NewCmdSubmitLegacyProposal()
cmd := govcli.NewCmdSubmitLegacyProposal() //nolint:staticcheck // needed for legacy testing
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
s.Require().NoError(err)

View File

@ -34,13 +34,13 @@ func TestAminoJSON(t *testing.T) {
tx.Msgs = []sdk.Msg{msg}
require.Equal(t,
`{"account_number":"1","chain_id":"foo","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[{"type":"cosmos-sdk/MsgGrantAllowance","value":{"allowance":{"type":"cosmos-sdk/BasicAllowance","value":{"spend_limit":[{"amount":"100","denom":"foo"}]}},"grantee":"cosmos1def","granter":"cosmos1abc"}}],"sequence":"1","timeout_height":"1"}`,
string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")),
string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")), //nolint:staticcheck // needed for legacy testing
)
msg = &feegrant.MsgRevokeAllowance{Granter: "cosmos1abc", Grantee: "cosmos1def"}
tx.Msgs = []sdk.Msg{msg}
require.Equal(t,
`{"account_number":"1","chain_id":"foo","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[{"type":"cosmos-sdk/MsgRevokeAllowance","value":{"grantee":"cosmos1def","granter":"cosmos1abc"}}],"sequence":"1","timeout_height":"1"}`,
string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")),
string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")), //nolint:staticcheck // needed for legacy testing
)
}

View File

@ -11,6 +11,7 @@ import (
)
// GenesisCoreCommand adds core sdk's sub-commands into genesis command.
//
// Deprecated: use Commands instead.
func GenesisCoreCommand(txConfig client.TxConfig, moduleBasics module.BasicManager, defaultNodeHome string) *cobra.Command {
return Commands(txConfig, moduleBasics, defaultNodeHome)

View File

@ -1,5 +1,4 @@
//go:build !race
// +build !race
// Disabled -race because the package github.com/manifoldco/promptui@v0.9.0
// has a data race and this code exposes it, but fixing it would require

View File

@ -185,6 +185,7 @@ func NewCmdCancelProposal() *cobra.Command {
}
// NewCmdSubmitLegacyProposal implements submitting a proposal transaction command.
//
// Deprecated: please use NewCmdSubmitProposal instead.
func NewCmdSubmitLegacyProposal() *cobra.Command {
cmd := &cobra.Command{

View File

@ -181,6 +181,7 @@ func ReadGovPropCmdFlags(proposer string, flagSet *pflag.FlagSet) (*govv1.MsgSub
// Setting the messages is up to the caller.
//
// See also AddGovPropFlagsToCmd.
//
// Deprecated: use ReadPropCmdFlags instead, as this depends on global bech32 prefixes.
func ReadGovPropFlags(clientCtx client.Context, flagSet *pflag.FlagSet) (*govv1.MsgSubmitProposal, error) {
return ReadGovPropCmdFlags(clientCtx.GetFromAddress().String(), flagSet)

View File

@ -161,6 +161,7 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1.QueryVoteParams) ([]
}
// QueryProposerByTxQuery will query for a proposer of a governance proposal by ID.
//
// Deprecated: Should not be used, as not always accurate. It will be removed in v0.51.
func QueryProposerByTxQuery(clientCtx client.Context, proposalID uint64) (Proposer, error) {
q := fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID)

View File

@ -120,12 +120,12 @@ func NewKeeper(
authority: authority,
Constitution: collections.NewItem(sb, types.ConstitutionKey, "constitution", collections.StringValue),
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[v1.Params](cdc)),
Deposits: collections.NewMap(sb, types.DepositsKeyPrefix, "deposits", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[v1.Deposit](cdc)), // nolint: staticcheck // sdk.LengthPrefixedAddressKey is needed to retain state compatibility
Votes: collections.NewMap(sb, types.VotesKeyPrefix, "votes", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[v1.Vote](cdc)), // nolint: staticcheck // sdk.LengthPrefixedAddressKey is needed to retain state compatibility
Deposits: collections.NewMap(sb, types.DepositsKeyPrefix, "deposits", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[v1.Deposit](cdc)), // nolint:staticcheck // sdk.LengthPrefixedAddressKey is needed to retain state compatibility
Votes: collections.NewMap(sb, types.VotesKeyPrefix, "votes", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[v1.Vote](cdc)), // nolint:staticcheck // sdk.LengthPrefixedAddressKey is needed to retain state compatibility
ProposalID: collections.NewSequence(sb, types.ProposalIDKey, "proposal_id"),
Proposals: collections.NewMap(sb, types.ProposalsKeyPrefix, "proposals", collections.Uint64Key, codec.CollValue[v1.Proposal](cdc)),
ActiveProposalsQueue: collections.NewMap(sb, types.ActiveProposalQueuePrefix, "active_proposals_queue", collections.PairKeyCodec(sdk.TimeKey, collections.Uint64Key), collections.Uint64Value), // sdk.TimeKey is needed to retain state compatibility
InactiveProposalsQueue: collections.NewMap(sb, types.InactiveProposalQueuePrefix, "inactive_proposals_queue", collections.PairKeyCodec(sdk.TimeKey, collections.Uint64Key), collections.Uint64Value), // sdk.TimeKey is needed to retain state compatibility
ActiveProposalsQueue: collections.NewMap(sb, types.ActiveProposalQueuePrefix, "active_proposals_queue", collections.PairKeyCodec(sdk.TimeKey, collections.Uint64Key), collections.Uint64Value), // nolint:staticcheck // sdk.TimeKey is needed to retain state compatibility
InactiveProposalsQueue: collections.NewMap(sb, types.InactiveProposalQueuePrefix, "inactive_proposals_queue", collections.PairKeyCodec(sdk.TimeKey, collections.Uint64Key), collections.Uint64Value), // nolint:staticcheck // sdk.TimeKey is needed to retain state compatibility
VotingPeriodProposals: collections.NewMap(sb, types.VotingPeriodProposalKeyPrefix, "voting_period_proposals", collections.Uint64Key, collections.BytesValue),
}

View File

@ -378,6 +378,7 @@ func simulateMsgDeposit(
}
// SimulateMsgVote generates a MsgVote with random values.
//
// Deprecated: this is an internal method and will be removed
func SimulateMsgVote(
txGen client.TxConfig,

View File

@ -82,7 +82,7 @@ func TestBlockProvision(t *testing.T) {
expProvisions := sdk.NewCoin(params.MintDenom,
math.NewInt(tc.expProvisions))
require.True(t, expProvisions.IsEqual(provisions),
require.True(t, expProvisions.Equal(provisions),
"test: %v\n\tExp: %v\n\tGot: %v\n",
i, tc.expProvisions, provisions)
}

View File

@ -28,7 +28,7 @@ var (
_ module.AppModuleSimulation = AppModule{}
_ module.HasGenesis = AppModule{}
_ module.HasServices = AppModule{}
_ module.AppModule = AppModule{}
_ module.AppModule = AppModule{} //nolint:staticcheck // maintain for legacy
_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
@ -56,6 +56,7 @@ func NewAppModule(keeper keeper.Keeper,
func (AppModule) IsAppModule() {}
// Name returns the protocolpool module's name.
//
// Deprecated: kept for legacy reasons.
func (AppModule) Name() string { return types.ModuleName }

View File

@ -46,6 +46,6 @@ func TestMsgDecode(t *testing.T) {
require.NoError(t, err)
msg2, ok := msgUnmarshaled.(*types.MsgCreateValidator)
require.True(t, ok)
require.True(t, msg.Value.IsEqual(msg2.Value))
require.True(t, msg.Value.Equal(msg2.Value))
require.True(t, msg.Pubkey.Equal(msg2.Pubkey))
}

View File

@ -58,7 +58,7 @@ func NewCmdSubmitUpgradeProposal(ac addresscodec.Codec) *cobra.Command {
return err
}
proposal, err := cli.ReadGovPropFlags(clientCtx, cmd.Flags())
proposal, err := cli.ReadGovPropCmdFlags(clientCtx.GetFromAddress().String(), cmd.Flags())
if err != nil {
return err
}
@ -145,7 +145,7 @@ func NewCmdSubmitCancelUpgradeProposal(ac addresscodec.Codec) *cobra.Command {
return err
}
proposal, err := cli.ReadGovPropFlags(clientCtx, cmd.Flags())
proposal, err := cli.ReadGovPropCmdFlags(clientCtx.GetFromAddress().String(), cmd.Flags())
if err != nil {
return err
}

View File

@ -10,6 +10,7 @@ const (
)
// NewSoftwareUpgradeProposal creates a new SoftwareUpgradeProposal instance.
//
// Deprecated: this proposal is considered legacy and is deprecated in favor of
// Msg-based gov proposals. See MsgSoftwareUpgrade.
func NewSoftwareUpgradeProposal(title, description string, plan Plan) gov.Content {