diff --git a/.golangci.yml b/.golangci.yml index fb4b6d6a57..1dfaf42cc4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -127,7 +127,7 @@ linters-settings: gofumpt: extra-rules: true dogsled: - max-blank-identifiers: 5 + max-blank-identifiers: 6 maligned: suggest-new: true nolintlint: diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 8400965738..0e64759822 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -7333,7 +7333,7 @@ type Vote struct { Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` // options is the weighted vote options. Options []*WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` - // metadata is any arbitrary metadata to attached to the vote. + // metadata is any arbitrary metadata attached to the vote. // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 Metadata string `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` } diff --git a/api/cosmos/gov/v1/query_grpc.pb.go b/api/cosmos/gov/v1/query_grpc.pb.go index 95e53b86a1..9ca690fcf0 100644 --- a/api/cosmos/gov/v1/query_grpc.pb.go +++ b/api/cosmos/gov/v1/query_grpc.pb.go @@ -48,7 +48,7 @@ type QueryClient interface { Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) @@ -161,7 +161,7 @@ type QueryServer interface { Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 89edabdeb4..1f4fd832f9 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7036,7 +7036,7 @@ type MsgSubmitProposal struct { // // Since: cosmos-sdk 0.47 Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` - // expedided defines if the proposal is expedited or not + // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` @@ -7574,8 +7574,10 @@ type MsgCancelProposal struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` } func (x *MsgCancelProposal) Reset() { @@ -7621,6 +7623,7 @@ type MsgCancelProposalResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` // canceled_time is the time when proposal is canceled. CanceledTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=canceled_time,json=canceledTime,proto3" json:"canceled_time,omitempty"` diff --git a/api/cosmos/gov/v1beta1/genesis.pulsar.go b/api/cosmos/gov/v1beta1/genesis.pulsar.go index b66ffd18f9..73e35955d3 100644 --- a/api/cosmos/gov/v1beta1/genesis.pulsar.go +++ b/api/cosmos/gov/v1beta1/genesis.pulsar.go @@ -1096,11 +1096,11 @@ type GenesisState struct { Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` // proposals defines all the proposals present at genesis. Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` - // params defines all the parameters of related to deposit. + // deposit_params defines all the parameters related to deposit. DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` - // params defines all the parameters of related to voting. + // voting_params defines all the parameters related to voting. VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` - // params defines all the parameters of related to tally. + // tally_params defines all the parameters related to tally. TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` } diff --git a/api/cosmos/gov/v1beta1/query_grpc.pb.go b/api/cosmos/gov/v1beta1/query_grpc.pb.go index 807c4893cf..7d6753ce06 100644 --- a/api/cosmos/gov/v1beta1/query_grpc.pb.go +++ b/api/cosmos/gov/v1beta1/query_grpc.pb.go @@ -43,7 +43,7 @@ type QueryClient interface { Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) @@ -145,7 +145,7 @@ type QueryServer interface { Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 9edd903b98..71fed22daf 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -151,7 +151,7 @@ message Vote { // options is the weighted vote options. repeated WeightedVoteOption options = 4; - // metadata is any arbitrary metadata to attached to the vote. + // metadata is any arbitrary metadata attached to the vote. // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 string metadata = 5; } diff --git a/proto/cosmos/gov/v1/query.proto b/proto/cosmos/gov/v1/query.proto index ce308c7db2..006d12fd61 100644 --- a/proto/cosmos/gov/v1/query.proto +++ b/proto/cosmos/gov/v1/query.proto @@ -1,4 +1,3 @@ - // Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.gov.v1; @@ -42,7 +41,7 @@ service Query { option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; } - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; } diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 57a062602b..b8cdc7133d 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -78,7 +78,7 @@ message MsgSubmitProposal { // Since: cosmos-sdk 0.47 string summary = 6; - // expedided defines if the proposal is expedited or not + // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 bool expedited = 7; @@ -193,7 +193,9 @@ message MsgUpdateParamsResponse {} message MsgCancelProposal { option (cosmos.msg.v1.signer) = "proposer"; + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // proposer is the account address of the proposer. string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } @@ -202,6 +204,7 @@ message MsgCancelProposal { // // Since: cosmos-sdk 0.50 message MsgCancelProposalResponse { + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; // canceled_time is the time when proposal is canceled. google.protobuf.Timestamp canceled_time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; diff --git a/proto/cosmos/gov/v1beta1/genesis.proto b/proto/cosmos/gov/v1beta1/genesis.proto index a680590ca5..f0c679a318 100644 --- a/proto/cosmos/gov/v1beta1/genesis.proto +++ b/proto/cosmos/gov/v1beta1/genesis.proto @@ -21,10 +21,10 @@ message GenesisState { // proposals defines all the proposals present at genesis. repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to deposit. + // deposit_params defines all the parameters related to deposit. DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to voting. + // voting_params defines all the parameters related to voting. VotingParams voting_params = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to tally. + // tally_params defines all the parameters related to tally. TallyParams tally_params = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/gov/v1beta1/query.proto b/proto/cosmos/gov/v1beta1/query.proto index f225a0f650..28352ed40c 100644 --- a/proto/cosmos/gov/v1beta1/query.proto +++ b/proto/cosmos/gov/v1beta1/query.proto @@ -37,7 +37,7 @@ service Query { option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; } - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; } diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto index 24795ab3b4..9de763be36 100644 --- a/proto/cosmos/gov/v1beta1/tx.proto +++ b/proto/cosmos/gov/v1beta1/tx.proto @@ -11,7 +11,7 @@ import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; -// Msg defines the bank Msg service. +// Msg defines the gov Msg service. service Msg { option (cosmos.msg.v1.service) = true; diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 6d240a135e..74247f7b57 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -110,6 +110,8 @@ func setupGovKeeper(t *testing.T) ( govKeeper.SetLegacyRouter(govRouter) err := govKeeper.Params.Set(ctx, v1.DefaultParams()) require.NoError(t, err) + err = govKeeper.Constitution.Set(ctx, "constitution") + require.NoError(t, err) // Register all handlers for the MegServiceRouter. msr.SetInterfaceRegistry(encCfg.InterfaceRegistry) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 5103f3b8cd..9419b2148e 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -86,6 +86,17 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { } } +func (suite *KeeperTestSuite) TestGRPCQueryConstitution() { + suite.reset() + queryClient := suite.queryClient + + expRes := &v1.QueryConstitutionResponse{Constitution: "constitution"} + + constitution, err := queryClient.Constitution(gocontext.Background(), &v1.QueryConstitutionRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(expRes, constitution) +} + func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { suite.reset() ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 3f7b65b32d..51e8737f0c 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -132,6 +132,26 @@ func TestProposalQueues(t *testing.T) { require.True(t, has) } +func TestSetHooks(t *testing.T) { + govKeeper, _, _, _, _, _, _ := setupGovKeeper(t) + require.Empty(t, govKeeper.Hooks()) + + govHooksReceiver := MockGovHooksReceiver{} + govKeeper.SetHooks(types.NewMultiGovHooks(&govHooksReceiver)) + require.NotNil(t, govKeeper.Hooks()) + require.Panics(t, func() { + govKeeper.SetHooks(&govHooksReceiver) + }) +} + +func TestGetGovGovernanceAndModuleAccountAddress(t *testing.T) { + govKeeper, authKeeper, _, _, _, _, ctx := setupGovKeeper(t) + mAcc := authKeeper.GetModuleAccount(ctx, "gov") + require.Equal(t, mAcc, govKeeper.GetGovernanceAccount(ctx)) + mAddr := authKeeper.GetModuleAddress("gov") + require.Equal(t, mAddr, govKeeper.ModuleAccountAddress()) +} + func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index c495b15da7..6f19007c04 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -56,7 +56,7 @@ func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr s return nil } -// deleteVotes deletes the all votes from a given proposalID. +// deleteVotes deletes all the votes from a given proposalID. func (keeper Keeper) deleteVotes(ctx context.Context, proposalID uint64) error { rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposalID) err := keeper.Votes.Clear(ctx, rng) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 198b81c375..7d65f39512 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -497,7 +497,7 @@ type Vote struct { Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` // options is the weighted vote options. Options []*WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` - // metadata is any arbitrary metadata to attached to the vote. + // metadata is any arbitrary metadata attached to the vote. // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 Metadata string `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` } diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 552fe559f5..facfbfa9c2 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -55,12 +55,6 @@ func (m *MsgSubmitProposal) SetMsgs(msgs []sdk.Msg) error { return nil } -// GetSigners returns the expected signers for a MsgSubmitProposal. -func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress { - proposer, _ := sdk.AccAddressFromBech32(m.Proposer) - return []sdk.AccAddress{proposer} -} - // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { return sdktx.UnpackInterfaces(unpacker, m.Messages) @@ -71,34 +65,16 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins return &MsgDeposit{proposalID, depositor.String(), amount} } -// GetSigners returns the expected signers for a MsgDeposit. -func (msg MsgDeposit) GetSigners() []sdk.AccAddress { - depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) - return []sdk.AccAddress{depositor} -} - // NewMsgVote creates a message to cast a vote on an active proposal func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption, metadata string) *MsgVote { return &MsgVote{proposalID, voter.String(), option, metadata} } -// GetSigners returns the expected signers for a MsgVote. -func (msg MsgVote) GetSigners() []sdk.AccAddress { - voter, _ := sdk.AccAddressFromBech32(msg.Voter) - return []sdk.AccAddress{voter} -} - // NewMsgVoteWeighted creates a message to cast a vote on an active proposal func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions, metadata string) *MsgVoteWeighted { return &MsgVoteWeighted{proposalID, voter.String(), options, metadata} } -// GetSigners returns the expected signers for a MsgVoteWeighted. -func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { - voter, _ := sdk.AccAddressFromBech32(msg.Voter) - return []sdk.AccAddress{voter} -} - // NewMsgExecLegacyContent creates a new MsgExecLegacyContent instance. func NewMsgExecLegacyContent(content *codectypes.Any, authority string) *MsgExecLegacyContent { return &MsgExecLegacyContent{ @@ -107,12 +83,6 @@ func NewMsgExecLegacyContent(content *codectypes.Any, authority string) *MsgExec } } -// GetSigners returns the expected signers for a MsgExecLegacyContent. -func (c MsgExecLegacyContent) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(c.Authority) - return []sdk.AccAddress{authority} -} - // ValidateBasic implements the sdk.Msg interface. func (c MsgExecLegacyContent) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(c.Authority) @@ -129,12 +99,6 @@ func (c MsgExecLegacyContent) UnpackInterfaces(unpacker codectypes.AnyUnpacker) return unpacker.UnpackAny(c.Content, &content) } -// GetSigners returns the expected signers for a MsgUpdateParams. -func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} - // NewMsgCancelProposal creates a new MsgCancelProposal instance. func NewMsgCancelProposal(proposalID uint64, proposer string) *MsgCancelProposal { return &MsgCancelProposal{ @@ -142,9 +106,3 @@ func NewMsgCancelProposal(proposalID uint64, proposer string) *MsgCancelProposal Proposer: proposer, } } - -// GetSigners implements Msg -func (msg MsgCancelProposal) GetSigners() []sdk.AccAddress { - proposer, _ := sdk.AccAddressFromBech32(msg.Proposer) - return []sdk.AccAddress{proposer} -} diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index 099611e21d..7233129c6a 100644 --- a/x/gov/types/v1/query.pb.go +++ b/x/gov/types/v1/query.pb.go @@ -1090,7 +1090,7 @@ type QueryClient interface { Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) @@ -1201,7 +1201,7 @@ type QueryServer interface { Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 5a57a0f2af..6a37c7c031 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -57,7 +57,7 @@ type MsgSubmitProposal struct { // // Since: cosmos-sdk 0.47 Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` - // expedided defines if the proposal is expedited or not + // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` @@ -708,8 +708,10 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // // Since: cosmos-sdk 0.50 type MsgCancelProposal struct { + // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` - Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` } func (m *MsgCancelProposal) Reset() { *m = MsgCancelProposal{} } @@ -764,6 +766,7 @@ func (m *MsgCancelProposal) GetProposer() string { // // Since: cosmos-sdk 0.50 type MsgCancelProposalResponse struct { + // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` // canceled_time is the time when proposal is canceled. CanceledTime time.Time `protobuf:"bytes,2,opt,name=canceled_time,json=canceledTime,proto3,stdtime" json:"canceled_time"` diff --git a/x/gov/types/v1beta1/genesis.pb.go b/x/gov/types/v1beta1/genesis.pb.go index d40095e982..2e765d2fb3 100644 --- a/x/gov/types/v1beta1/genesis.pb.go +++ b/x/gov/types/v1beta1/genesis.pb.go @@ -34,11 +34,11 @@ type GenesisState struct { Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` // proposals defines all the proposals present at genesis. Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` - // params defines all the parameters of related to deposit. + // deposit_params defines all the parameters related to deposit. DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` - // params defines all the parameters of related to voting. + // voting_params defines all the parameters related to voting. VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` - // params defines all the parameters of related to tally. + // tally_params defines all the parameters related to tally. TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` } diff --git a/x/gov/types/v1beta1/msgs.go b/x/gov/types/v1beta1/msgs.go index 182e877846..ddcce3ed64 100644 --- a/x/gov/types/v1beta1/msgs.go +++ b/x/gov/types/v1beta1/msgs.go @@ -78,12 +78,6 @@ func (m *MsgSubmitProposal) SetContent(content Content) error { return nil } -// GetSigners returns the expected signers for a MsgSubmitProposal. -func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress { - proposer, _ := sdk.AccAddressFromBech32(m.Proposer) - return []sdk.AccAddress{proposer} -} - // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { var content Content @@ -95,30 +89,12 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins return &MsgDeposit{proposalID, depositor.String(), amount} } -// GetSigners returns the expected signers for a MsgDeposit. -func (msg MsgDeposit) GetSigners() []sdk.AccAddress { - depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) - return []sdk.AccAddress{depositor} -} - // NewMsgVote creates a message to cast a vote on an active proposal func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *MsgVote { return &MsgVote{proposalID, voter.String(), option} } -// GetSigners returns the expected signers for a MsgVote. -func (msg MsgVote) GetSigners() []sdk.AccAddress { - voter, _ := sdk.AccAddressFromBech32(msg.Voter) - return []sdk.AccAddress{voter} -} - // NewMsgVoteWeighted creates a message to cast a vote on an active proposal. func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions) *MsgVoteWeighted { return &MsgVoteWeighted{proposalID, voter.String(), options} } - -// GetSigners returns the expected signers for a MsgVoteWeighted. -func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { - voter, _ := sdk.AccAddressFromBech32(msg.Voter) - return []sdk.AccAddress{voter} -} diff --git a/x/gov/types/v1beta1/query.pb.go b/x/gov/types/v1beta1/query.pb.go index 39597345ce..36b0cd1933 100644 --- a/x/gov/types/v1beta1/query.pb.go +++ b/x/gov/types/v1beta1/query.pb.go @@ -932,7 +932,7 @@ type QueryClient interface { Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) @@ -1032,7 +1032,7 @@ type QueryServer interface { Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error)