From 49bc189df1d44b80153c3b8a77aec0f31da4d92b Mon Sep 17 00:00:00 2001 From: winniehere Date: Wed, 17 Jul 2024 19:52:06 +0800 Subject: [PATCH] chore: fix functions' comments (#20974) --- api/cosmos/base/node/v1beta1/query.pulsar.go | 2 +- api/cosmos/circuit/v1/query.pulsar.go | 2 +- api/cosmos/circuit/v1/query_grpc.pb.go | 4 ++-- api/cosmos/nft/v1beta1/query.pulsar.go | 2 +- client/grpc/node/query.pb.go | 2 +- docs/architecture/adr-043-nft-module.md | 2 +- proto/cosmos/base/node/v1beta1/query.proto | 2 +- store/iavl/store.go | 2 +- x/auth/keeper/deterministic_test.go | 2 +- x/auth/vesting/types/codec.go | 2 +- x/bank/simulation/genesis_test.go | 2 +- x/circuit/keeper/query.go | 2 +- x/circuit/proto/cosmos/circuit/v1/query.proto | 4 ++-- x/circuit/types/query.pb.go | 6 +++--- x/distribution/simulation/genesis_test.go | 2 +- x/gov/simulation/genesis_test.go | 2 +- x/mint/simulation/genesis_test.go | 2 +- x/nft/proto/cosmos/nft/v1beta1/query.proto | 2 +- x/nft/query.pb.go | 2 +- x/slashing/simulation/genesis_test.go | 2 +- x/staking/keeper/migrations.go | 2 +- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/api/cosmos/base/node/v1beta1/query.pulsar.go b/api/cosmos/base/node/v1beta1/query.pulsar.go index f79e565e18..dcec17ddc2 100644 --- a/api/cosmos/base/node/v1beta1/query.pulsar.go +++ b/api/cosmos/base/node/v1beta1/query.pulsar.go @@ -2086,7 +2086,7 @@ func (x *ConfigResponse) GetHaltHeight() uint64 { return 0 } -// StateRequest defines the request structure for the status of a node. +// StatusRequest defines the request structure for the status of a node. type StatusRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/circuit/v1/query.pulsar.go b/api/cosmos/circuit/v1/query.pulsar.go index 20e4721372..77fa017581 100644 --- a/api/cosmos/circuit/v1/query.pulsar.go +++ b/api/cosmos/circuit/v1/query.pulsar.go @@ -2881,7 +2881,7 @@ func (x *AccountsResponse) GetPagination() *v1beta1.PageResponse { return nil } -// QueryDisableListRequest is the request type for the Query/DisabledList RPC method. +// QueryDisabledListRequest is the request type for the Query/DisabledList RPC method. type QueryDisabledListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/circuit/v1/query_grpc.pb.go b/api/cosmos/circuit/v1/query_grpc.pb.go index 6218b68d8b..06712054ae 100644 --- a/api/cosmos/circuit/v1/query_grpc.pb.go +++ b/api/cosmos/circuit/v1/query_grpc.pb.go @@ -30,7 +30,7 @@ const ( type QueryClient interface { // Account returns account permissions. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*AccountResponse, error) - // Account returns account permissions. + // Accounts returns multiple accounts permissions. Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*AccountsResponse, error) // DisabledList returns a list of disabled message urls DisabledList(ctx context.Context, in *QueryDisabledListRequest, opts ...grpc.CallOption) (*DisabledListResponse, error) @@ -77,7 +77,7 @@ func (c *queryClient) DisabledList(ctx context.Context, in *QueryDisabledListReq type QueryServer interface { // Account returns account permissions. Account(context.Context, *QueryAccountRequest) (*AccountResponse, error) - // Account returns account permissions. + // Accounts returns multiple accounts permissions. Accounts(context.Context, *QueryAccountsRequest) (*AccountsResponse, error) // DisabledList returns a list of disabled message urls DisabledList(context.Context, *QueryDisabledListRequest) (*DisabledListResponse, error) diff --git a/api/cosmos/nft/v1beta1/query.pulsar.go b/api/cosmos/nft/v1beta1/query.pulsar.go index 156e61668d..7c3cb4c065 100644 --- a/api/cosmos/nft/v1beta1/query.pulsar.go +++ b/api/cosmos/nft/v1beta1/query.pulsar.go @@ -11432,7 +11432,7 @@ func (x *QuerySupplyByQueryStringResponse) GetAmount() uint64 { return 0 } -// QueryNFTstRequest is the request type for the Query/NFTs RPC method +// QueryNFTsRequest is the request type for the Query/NFTs RPC method type QueryNFTsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/client/grpc/node/query.pb.go b/client/grpc/node/query.pb.go index a2c96dc1ec..e355560356 100644 --- a/client/grpc/node/query.pb.go +++ b/client/grpc/node/query.pb.go @@ -139,7 +139,7 @@ func (m *ConfigResponse) GetHaltHeight() uint64 { return 0 } -// StateRequest defines the request structure for the status of a node. +// StatusRequest defines the request structure for the status of a node. type StatusRequest struct { } diff --git a/docs/architecture/adr-043-nft-module.md b/docs/architecture/adr-043-nft-module.md index 85d439f7ef..5968eb1305 100644 --- a/docs/architecture/adr-043-nft-module.md +++ b/docs/architecture/adr-043-nft-module.md @@ -253,7 +253,7 @@ message QuerySupplyResponse { uint64 amount = 1; } -// QueryNFTstRequest is the request type for the Query/NFTs RPC method +// QueryNFTsRequest is the request type for the Query/NFTs RPC method message QueryNFTsRequest { string class_id = 1; string owner = 2; diff --git a/proto/cosmos/base/node/v1beta1/query.proto b/proto/cosmos/base/node/v1beta1/query.proto index 95df568f11..999eddc9c0 100644 --- a/proto/cosmos/base/node/v1beta1/query.proto +++ b/proto/cosmos/base/node/v1beta1/query.proto @@ -30,7 +30,7 @@ message ConfigResponse { uint64 halt_height = 4; } -// StateRequest defines the request structure for the status of a node. +// StatusRequest defines the request structure for the status of a node. message StatusRequest {} // StateResponse defines the response structure for the status of a node. diff --git a/store/iavl/store.go b/store/iavl/store.go index d97995b05e..04d170b73e 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -163,7 +163,7 @@ func (st *Store) SetPruning(_ pruningtypes.PruningOptions) { panic("cannot set pruning options on an initialized IAVL store") } -// SetPruning panics as pruning options should be provided at initialization +// GetPruning panics as pruning options should be provided at initialization // since IAVl accepts pruning options directly. func (st *Store) GetPruning() pruningtypes.PruningOptions { panic("cannot get pruning options on an initialized IAVL store") diff --git a/x/auth/keeper/deterministic_test.go b/x/auth/keeper/deterministic_test.go index 75057368fb..2cb86751b6 100644 --- a/x/auth/keeper/deterministic_test.go +++ b/x/auth/keeper/deterministic_test.go @@ -107,7 +107,7 @@ func (suite *DeterministicTestSuite) SetupTest() { suite.accountNumberLanes = 1 } -// createAndSetAccount creates a random account and sets to the keeper store. +// createAndSetAccounts creates a random account and sets to the keeper store. func (suite *DeterministicTestSuite) createAndSetAccounts(t *rapid.T, count int) []sdk.AccountI { accs := make([]sdk.AccountI, 0, count) diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index 99246287c3..9ebc5a2c46 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -26,7 +26,7 @@ func RegisterLegacyAminoCodec(cdc corelegacy.Amino) { legacy.RegisterAminoMsg(cdc, &MsgCreatePeriodicVestingAccount{}, "cosmos-sdk/MsgCreatePeriodVestAccount") } -// RegisterInterface associates protoName with AccountI and VestingAccount +// RegisterInterfaces associates protoName with AccountI and VestingAccount // Interfaces and creates a registry of it's concrete implementations func RegisterInterfaces(registrar registry.InterfaceRegistrar) { registrar.RegisterInterface( diff --git a/x/bank/simulation/genesis_test.go b/x/bank/simulation/genesis_test.go index 19556a2b76..f5e93943d7 100644 --- a/x/bank/simulation/genesis_test.go +++ b/x/bank/simulation/genesis_test.go @@ -59,7 +59,7 @@ func TestRandomizedGenState(t *testing.T) { } } -// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. +// TestRandomizedGenState1 tests abnormal scenarios of applying RandomizedGenState. func TestRandomizedGenState1(t *testing.T) { interfaceRegistry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) diff --git a/x/circuit/keeper/query.go b/x/circuit/keeper/query.go index a8b39e4d4a..34d331c1ef 100644 --- a/x/circuit/keeper/query.go +++ b/x/circuit/keeper/query.go @@ -35,7 +35,7 @@ func (qs QueryServer) Account(ctx context.Context, req *types.QueryAccountReques return &types.AccountResponse{Permission: &perms}, nil } -// Account returns account permissions. +// Accounts returns multiple accounts permissions. func (qs QueryServer) Accounts(ctx context.Context, req *types.QueryAccountsRequest) (*types.AccountsResponse, error) { results, pageRes, err := query.CollectionPaginate( ctx, diff --git a/x/circuit/proto/cosmos/circuit/v1/query.proto b/x/circuit/proto/cosmos/circuit/v1/query.proto index 0115d335f4..35949819cf 100644 --- a/x/circuit/proto/cosmos/circuit/v1/query.proto +++ b/x/circuit/proto/cosmos/circuit/v1/query.proto @@ -16,7 +16,7 @@ service Query { option (google.api.http).get = "/cosmos/circuit/v1/accounts/{address}"; } - // Account returns account permissions. + // Accounts returns multiple accounts permissions. rpc Accounts(QueryAccountsRequest) returns (AccountsResponse) { option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/circuit/v1/accounts"; @@ -52,7 +52,7 @@ message AccountsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryDisableListRequest is the request type for the Query/DisabledList RPC method. +// QueryDisabledListRequest is the request type for the Query/DisabledList RPC method. message QueryDisabledListRequest {} // DisabledListResponse is the response type for the Query/DisabledList RPC method. diff --git a/x/circuit/types/query.pb.go b/x/circuit/types/query.pb.go index 3933e44326..c327a4bae9 100644 --- a/x/circuit/types/query.pb.go +++ b/x/circuit/types/query.pb.go @@ -219,7 +219,7 @@ func (m *AccountsResponse) GetPagination() *query.PageResponse { return nil } -// QueryDisableListRequest is the request type for the Query/DisabledList RPC method. +// QueryDisabledListRequest is the request type for the Query/DisabledList RPC method. type QueryDisabledListRequest struct { } @@ -363,7 +363,7 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Account returns account permissions. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*AccountResponse, error) - // Account returns account permissions. + // Accounts returns multiple accounts permissions. Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*AccountsResponse, error) // DisabledList returns a list of disabled message urls DisabledList(ctx context.Context, in *QueryDisabledListRequest, opts ...grpc.CallOption) (*DisabledListResponse, error) @@ -408,7 +408,7 @@ func (c *queryClient) DisabledList(ctx context.Context, in *QueryDisabledListReq type QueryServer interface { // Account returns account permissions. Account(context.Context, *QueryAccountRequest) (*AccountResponse, error) - // Account returns account permissions. + // Accounts returns multiple accounts permissions. Accounts(context.Context, *QueryAccountsRequest) (*AccountsResponse, error) // DisabledList returns a list of disabled message urls DisabledList(context.Context, *QueryDisabledListRequest) (*DisabledListResponse, error) diff --git a/x/distribution/simulation/genesis_test.go b/x/distribution/simulation/genesis_test.go index 0448d66909..6c74a5e2bf 100644 --- a/x/distribution/simulation/genesis_test.go +++ b/x/distribution/simulation/genesis_test.go @@ -53,7 +53,7 @@ func TestRandomizedGenState(t *testing.T) { require.Len(t, distrGenesis.ValidatorSlashEvents, 0) } -// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. +// TestRandomizedGenState1 tests abnormal scenarios of applying RandomizedGenState. func TestRandomizedGenState1(t *testing.T) { interfaceRegistry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index ce0a2c45ac..215225085d 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -77,7 +77,7 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, []*v1.Proposal{}, govGenesis.Proposals) } -// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. +// TestRandomizedGenState1 tests abnormal scenarios of applying RandomizedGenState. func TestRandomizedGenState1(t *testing.T) { interfaceRegistry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) diff --git a/x/mint/simulation/genesis_test.go b/x/mint/simulation/genesis_test.go index 784f910e32..ba31c32e4b 100644 --- a/x/mint/simulation/genesis_test.go +++ b/x/mint/simulation/genesis_test.go @@ -62,7 +62,7 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, "0.000000000000000000", mintGenesis.Minter.AnnualProvisions.String()) } -// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. +// TestRandomizedGenState1 tests abnormal scenarios of applying RandomizedGenState. func TestRandomizedGenState1(t *testing.T) { encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, mint.AppModule{}) diff --git a/x/nft/proto/cosmos/nft/v1beta1/query.proto b/x/nft/proto/cosmos/nft/v1beta1/query.proto index 3b32094e6d..e0646c61fe 100644 --- a/x/nft/proto/cosmos/nft/v1beta1/query.proto +++ b/x/nft/proto/cosmos/nft/v1beta1/query.proto @@ -171,7 +171,7 @@ message QuerySupplyByQueryStringResponse { uint64 amount = 1; } -// QueryNFTstRequest is the request type for the Query/NFTs RPC method +// QueryNFTsRequest is the request type for the Query/NFTs RPC method message QueryNFTsRequest { // class_id associated with the nft string class_id = 1; diff --git a/x/nft/query.pb.go b/x/nft/query.pb.go index 0188d40d5f..c815738d61 100644 --- a/x/nft/query.pb.go +++ b/x/nft/query.pb.go @@ -618,7 +618,7 @@ func (m *QuerySupplyByQueryStringResponse) GetAmount() uint64 { return 0 } -// QueryNFTstRequest is the request type for the Query/NFTs RPC method +// QueryNFTsRequest is the request type for the Query/NFTs RPC method type QueryNFTsRequest struct { // class_id associated with the nft ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` diff --git a/x/slashing/simulation/genesis_test.go b/x/slashing/simulation/genesis_test.go index b1bed6f6f8..1748645ec2 100644 --- a/x/slashing/simulation/genesis_test.go +++ b/x/slashing/simulation/genesis_test.go @@ -59,7 +59,7 @@ func TestRandomizedGenState(t *testing.T) { require.Len(t, slashingGenesis.SigningInfos, 0) } -// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. +// TestRandomizedGenState1 tests abnormal scenarios of applying RandomizedGenState. func TestRandomizedGenState1(t *testing.T) { interfaceRegistry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) diff --git a/x/staking/keeper/migrations.go b/x/staking/keeper/migrations.go index 576b3fbd5b..1bcf07a1da 100644 --- a/x/staking/keeper/migrations.go +++ b/x/staking/keeper/migrations.go @@ -42,7 +42,7 @@ func (m Migrator) Migrate4to5(ctx context.Context) error { return v5.MigrateStore(ctx, store, m.keeper.cdc, m.keeper.Logger) } -// Migrate4to5 migrates x/staking state from consensus version 5 to 6. +// Migrate5to6 migrates x/staking state from consensus version 5 to 6. func (m Migrator) Migrate5to6(ctx context.Context) error { store := runtime.KVStoreAdapter(m.keeper.KVStoreService.OpenKVStore(ctx)) return v6.MigrateStore(ctx, store, m.keeper.cdc)