From 3c0a9034b1c4d7f801215e653e200f4043984fe2 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 9 Sep 2024 23:01:51 +0200 Subject: [PATCH 1/3] fix(x/accounts/lockup): prevent double withdraw --- x/accounts/defaults/lockup/lockup.go | 7 +++++++ .../defaults/lockup/periodic_locking_account_test.go | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 826f51c5a9a3..81e3b4c6a56f 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -5,6 +5,7 @@ import ( "context" "errors" "fmt" + "maps" "time" "github.com/cosmos/gogoproto/proto" @@ -302,7 +303,13 @@ func (bva *BaseLockup) WithdrawUnlockedCoins( amount := sdk.Coins{} + // deduplicate the denoms + denoms := make(map[string]struct{}) for _, denom := range msg.Denoms { + denoms[denom] = struct{}{} + } + + for denom := range maps.Keys(denoms) { balance, err := bva.getBalance(ctx, fromAddress, denom) if err != nil { return nil, err diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index 809fe33757d0..8ff7ee001461 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -231,12 +231,16 @@ func TestPeriodicAccountWithdrawUnlockedCoins(t *testing.T) { Time: startTime.Add(time.Minute * 1), }) - _, err = acc.WithdrawUnlockedCoins(sdkCtx, &lockuptypes.MsgWithdraw{ + // withdraw unlocked token + resp, err := acc.WithdrawUnlockedCoins(sdkCtx, &lockuptypes.MsgWithdraw{ Withdrawer: "owner", ToAddress: "receiver", - Denoms: []string{"test"}, + Denoms: []string{"test", "test"}, // duplicate tokens should be ignored }) require.NoError(t, err) + require.Equal(t, resp.AmountReceived.Len(), 1) + require.Equal(t, resp.AmountReceived, sdk.NewCoins(sdk.NewCoin("test", math.NewInt(5)))) + require.Equal(t, resp.Receiver, "receiver") } func TestPeriodicAccountGetLockCoinInfo(t *testing.T) { From b0584cdee08e06ebda22ccbedd2f50af25f8d387 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 10 Sep 2024 09:12:36 +0200 Subject: [PATCH 2/3] updates --- x/accounts/defaults/lockup/lockup.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 81e3b4c6a56f..fb21b170eab9 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "maps" + "slices" "time" "github.com/cosmos/gogoproto/proto" @@ -295,21 +296,21 @@ func (bva *BaseLockup) WithdrawUnlockedCoins( return nil, err } - hs := bva.headerService.HeaderInfo(ctx) - lockedCoins, err := getLockedCoinsFunc(ctx, hs.Time, msg.Denoms...) - if err != nil { - return nil, err - } - - amount := sdk.Coins{} - // deduplicate the denoms denoms := make(map[string]struct{}) for _, denom := range msg.Denoms { denoms[denom] = struct{}{} } + uniqueDenoms := slices.Collect(maps.Keys(denoms)) - for denom := range maps.Keys(denoms) { + hs := bva.headerService.HeaderInfo(ctx) + lockedCoins, err := getLockedCoinsFunc(ctx, hs.Time, uniqueDenoms...) + if err != nil { + return nil, err + } + + amount := sdk.Coins{} + for _, denom := range uniqueDenoms { balance, err := bva.getBalance(ctx, fromAddress, denom) if err != nil { return nil, err From 3be15d26fb0224966f1429aa8973e5e5abd12b13 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 10 Sep 2024 12:26:42 +0200 Subject: [PATCH 3/3] updates --- .../defaults/multisig/v1/multisig.pulsar.go | 91 ++++++++------- x/accounts/defaults/lockup/lockup.go | 4 + .../defaults/multisig/v1/multisig.pb.go | 105 ++++++++++-------- .../defaults/multisig/v1/multisig.proto | 20 +++- 4 files changed, 131 insertions(+), 89 deletions(-) diff --git a/api/cosmos/accounts/defaults/multisig/v1/multisig.pulsar.go b/api/cosmos/accounts/defaults/multisig/v1/multisig.pulsar.go index 06bd8e5d4ac3..aa0dcb30b6d9 100644 --- a/api/cosmos/accounts/defaults/multisig/v1/multisig.pulsar.go +++ b/api/cosmos/accounts/defaults/multisig/v1/multisig.pulsar.go @@ -69,14 +69,14 @@ func (x *_MsgInit_1_list) IsValid() bool { var ( md_MsgInit protoreflect.MessageDescriptor fd_MsgInit_members protoreflect.FieldDescriptor - fd_MsgInit_Config protoreflect.FieldDescriptor + fd_MsgInit_config protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_defaults_multisig_v1_multisig_proto_init() md_MsgInit = File_cosmos_accounts_defaults_multisig_v1_multisig_proto.Messages().ByName("MsgInit") fd_MsgInit_members = md_MsgInit.Fields().ByName("members") - fd_MsgInit_Config = md_MsgInit.Fields().ByName("Config") + fd_MsgInit_config = md_MsgInit.Fields().ByName("config") } var _ protoreflect.Message = (*fastReflection_MsgInit)(nil) @@ -152,7 +152,7 @@ func (x *fastReflection_MsgInit) Range(f func(protoreflect.FieldDescriptor, prot } if x.Config != nil { value := protoreflect.ValueOfMessage(x.Config.ProtoReflect()) - if !f(fd_MsgInit_Config, value) { + if !f(fd_MsgInit_config, value) { return } } @@ -173,7 +173,7 @@ func (x *fastReflection_MsgInit) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "cosmos.accounts.defaults.multisig.v1.MsgInit.members": return len(x.Members) != 0 - case "cosmos.accounts.defaults.multisig.v1.MsgInit.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgInit.config": return x.Config != nil default: if fd.IsExtension() { @@ -193,7 +193,7 @@ func (x *fastReflection_MsgInit) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "cosmos.accounts.defaults.multisig.v1.MsgInit.members": x.Members = nil - case "cosmos.accounts.defaults.multisig.v1.MsgInit.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgInit.config": x.Config = nil default: if fd.IsExtension() { @@ -217,7 +217,7 @@ func (x *fastReflection_MsgInit) Get(descriptor protoreflect.FieldDescriptor) pr } listValue := &_MsgInit_1_list{list: &x.Members} return protoreflect.ValueOfList(listValue) - case "cosmos.accounts.defaults.multisig.v1.MsgInit.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgInit.config": value := x.Config return protoreflect.ValueOfMessage(value.ProtoReflect()) default: @@ -244,7 +244,7 @@ func (x *fastReflection_MsgInit) Set(fd protoreflect.FieldDescriptor, value prot lv := value.List() clv := lv.(*_MsgInit_1_list) x.Members = *clv.list - case "cosmos.accounts.defaults.multisig.v1.MsgInit.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgInit.config": x.Config = value.Message().Interface().(*Config) default: if fd.IsExtension() { @@ -272,7 +272,7 @@ func (x *fastReflection_MsgInit) Mutable(fd protoreflect.FieldDescriptor) protor } value := &_MsgInit_1_list{list: &x.Members} return protoreflect.ValueOfList(value) - case "cosmos.accounts.defaults.multisig.v1.MsgInit.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgInit.config": if x.Config == nil { x.Config = new(Config) } @@ -293,7 +293,7 @@ func (x *fastReflection_MsgInit) NewField(fd protoreflect.FieldDescriptor) proto case "cosmos.accounts.defaults.multisig.v1.MsgInit.members": list := []*Member{} return protoreflect.ValueOfList(&_MsgInit_1_list{list: &list}) - case "cosmos.accounts.defaults.multisig.v1.MsgInit.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgInit.config": m := new(Config) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -3543,14 +3543,14 @@ func (x *_MsgUpdateConfig_1_list) IsValid() bool { var ( md_MsgUpdateConfig protoreflect.MessageDescriptor fd_MsgUpdateConfig_update_members protoreflect.FieldDescriptor - fd_MsgUpdateConfig_Config protoreflect.FieldDescriptor + fd_MsgUpdateConfig_config protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_defaults_multisig_v1_multisig_proto_init() md_MsgUpdateConfig = File_cosmos_accounts_defaults_multisig_v1_multisig_proto.Messages().ByName("MsgUpdateConfig") fd_MsgUpdateConfig_update_members = md_MsgUpdateConfig.Fields().ByName("update_members") - fd_MsgUpdateConfig_Config = md_MsgUpdateConfig.Fields().ByName("Config") + fd_MsgUpdateConfig_config = md_MsgUpdateConfig.Fields().ByName("config") } var _ protoreflect.Message = (*fastReflection_MsgUpdateConfig)(nil) @@ -3626,7 +3626,7 @@ func (x *fastReflection_MsgUpdateConfig) Range(f func(protoreflect.FieldDescript } if x.Config != nil { value := protoreflect.ValueOfMessage(x.Config.ProtoReflect()) - if !f(fd_MsgUpdateConfig_Config, value) { + if !f(fd_MsgUpdateConfig_config, value) { return } } @@ -3647,7 +3647,7 @@ func (x *fastReflection_MsgUpdateConfig) Has(fd protoreflect.FieldDescriptor) bo switch fd.FullName() { case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.update_members": return len(x.UpdateMembers) != 0 - case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.config": return x.Config != nil default: if fd.IsExtension() { @@ -3667,7 +3667,7 @@ func (x *fastReflection_MsgUpdateConfig) Clear(fd protoreflect.FieldDescriptor) switch fd.FullName() { case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.update_members": x.UpdateMembers = nil - case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.config": x.Config = nil default: if fd.IsExtension() { @@ -3691,7 +3691,7 @@ func (x *fastReflection_MsgUpdateConfig) Get(descriptor protoreflect.FieldDescri } listValue := &_MsgUpdateConfig_1_list{list: &x.UpdateMembers} return protoreflect.ValueOfList(listValue) - case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.config": value := x.Config return protoreflect.ValueOfMessage(value.ProtoReflect()) default: @@ -3718,7 +3718,7 @@ func (x *fastReflection_MsgUpdateConfig) Set(fd protoreflect.FieldDescriptor, va lv := value.List() clv := lv.(*_MsgUpdateConfig_1_list) x.UpdateMembers = *clv.list - case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.config": x.Config = value.Message().Interface().(*Config) default: if fd.IsExtension() { @@ -3746,7 +3746,7 @@ func (x *fastReflection_MsgUpdateConfig) Mutable(fd protoreflect.FieldDescriptor } value := &_MsgUpdateConfig_1_list{list: &x.UpdateMembers} return protoreflect.ValueOfList(value) - case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.config": if x.Config == nil { x.Config = new(Config) } @@ -3767,7 +3767,7 @@ func (x *fastReflection_MsgUpdateConfig) NewField(fd protoreflect.FieldDescripto case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.update_members": list := []*Member{} return protoreflect.ValueOfList(&_MsgUpdateConfig_1_list{list: &list}) - case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.Config": + case "cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.config": m := new(Config) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -7382,14 +7382,14 @@ func (x *_QueryConfigResponse_1_list) IsValid() bool { var ( md_QueryConfigResponse protoreflect.MessageDescriptor fd_QueryConfigResponse_members protoreflect.FieldDescriptor - fd_QueryConfigResponse_Config protoreflect.FieldDescriptor + fd_QueryConfigResponse_config protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_defaults_multisig_v1_multisig_proto_init() md_QueryConfigResponse = File_cosmos_accounts_defaults_multisig_v1_multisig_proto.Messages().ByName("QueryConfigResponse") fd_QueryConfigResponse_members = md_QueryConfigResponse.Fields().ByName("members") - fd_QueryConfigResponse_Config = md_QueryConfigResponse.Fields().ByName("Config") + fd_QueryConfigResponse_config = md_QueryConfigResponse.Fields().ByName("config") } var _ protoreflect.Message = (*fastReflection_QueryConfigResponse)(nil) @@ -7465,7 +7465,7 @@ func (x *fastReflection_QueryConfigResponse) Range(f func(protoreflect.FieldDesc } if x.Config != nil { value := protoreflect.ValueOfMessage(x.Config.ProtoReflect()) - if !f(fd_QueryConfigResponse_Config, value) { + if !f(fd_QueryConfigResponse_config, value) { return } } @@ -7486,7 +7486,7 @@ func (x *fastReflection_QueryConfigResponse) Has(fd protoreflect.FieldDescriptor switch fd.FullName() { case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.members": return len(x.Members) != 0 - case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.Config": + case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.config": return x.Config != nil default: if fd.IsExtension() { @@ -7506,7 +7506,7 @@ func (x *fastReflection_QueryConfigResponse) Clear(fd protoreflect.FieldDescript switch fd.FullName() { case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.members": x.Members = nil - case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.Config": + case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.config": x.Config = nil default: if fd.IsExtension() { @@ -7530,7 +7530,7 @@ func (x *fastReflection_QueryConfigResponse) Get(descriptor protoreflect.FieldDe } listValue := &_QueryConfigResponse_1_list{list: &x.Members} return protoreflect.ValueOfList(listValue) - case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.Config": + case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.config": value := x.Config return protoreflect.ValueOfMessage(value.ProtoReflect()) default: @@ -7557,7 +7557,7 @@ func (x *fastReflection_QueryConfigResponse) Set(fd protoreflect.FieldDescriptor lv := value.List() clv := lv.(*_QueryConfigResponse_1_list) x.Members = *clv.list - case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.Config": + case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.config": x.Config = value.Message().Interface().(*Config) default: if fd.IsExtension() { @@ -7585,7 +7585,7 @@ func (x *fastReflection_QueryConfigResponse) Mutable(fd protoreflect.FieldDescri } value := &_QueryConfigResponse_1_list{list: &x.Members} return protoreflect.ValueOfList(value) - case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.Config": + case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.config": if x.Config == nil { x.Config = new(Config) } @@ -7606,7 +7606,7 @@ func (x *fastReflection_QueryConfigResponse) NewField(fd protoreflect.FieldDescr case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.members": list := []*Member{} return protoreflect.ValueOfList(&_QueryConfigResponse_1_list{list: &list}) - case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.Config": + case "cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.config": m := new(Config) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -8874,7 +8874,7 @@ type MsgInit struct { unknownFields protoimpl.UnknownFields Members []*Member `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` - Config *Config `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` } func (x *MsgInit) Reset() { @@ -8938,6 +8938,7 @@ func (*MsgInitResponse) Descriptor() ([]byte, []int) { return file_cosmos_accounts_defaults_multisig_v1_multisig_proto_rawDescGZIP(), []int{1} } +// MsgCreateProposal creates a new proposal. type MsgCreateProposal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -8973,6 +8974,7 @@ func (x *MsgCreateProposal) GetProposal() *Proposal { return nil } +// MsgCreateProposalResponse is the response returned after creating a proposal. type MsgCreateProposalResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9008,6 +9010,7 @@ func (x *MsgCreateProposalResponse) GetProposalId() uint64 { return 0 } +// MsgVote is used to vote on a proposal. type MsgVote struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9051,6 +9054,7 @@ func (x *MsgVote) GetVote() VoteOption { return VoteOption_VOTE_OPTION_UNSPECIFIED } +// MsgVoteResponse is the response returned after voting on a proposal. type MsgVoteResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9077,6 +9081,7 @@ func (*MsgVoteResponse) Descriptor() ([]byte, []int) { return file_cosmos_accounts_defaults_multisig_v1_multisig_proto_rawDescGZIP(), []int{5} } +// MsgExecuteProposal is used to execute a proposal. type MsgExecuteProposal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9112,6 +9117,7 @@ func (x *MsgExecuteProposal) GetProposalId() uint64 { return 0 } +// MsgExecuteProposalResponse is the response returned after executing a proposal. type MsgExecuteProposalResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9156,7 +9162,7 @@ type MsgUpdateConfig struct { // only the members that are changing are required, if their weight is 0, they are removed. UpdateMembers []*Member `protobuf:"bytes,1,rep,name=update_members,json=updateMembers,proto3" json:"update_members,omitempty"` // not all fields from Config can be changed - Config *Config `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` } func (x *MsgUpdateConfig) Reset() { @@ -9193,6 +9199,7 @@ func (x *MsgUpdateConfig) GetConfig() *Config { return nil } +// MsgUpdateConfigResponse is the response returned after updating the config. type MsgUpdateConfigResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9219,6 +9226,7 @@ func (*MsgUpdateConfigResponse) Descriptor() ([]byte, []int) { return file_cosmos_accounts_defaults_multisig_v1_multisig_proto_rawDescGZIP(), []int{9} } +// Member defines the member of the multisig account. type Member struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9262,6 +9270,7 @@ func (x *Member) GetWeight() uint64 { return 0 } +// Config defines the configuration of the multisig account. type Config struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9332,6 +9341,7 @@ func (x *Config) GetEarlyExecution() bool { return false } +// Proposal defines the structure of a proposal. type Proposal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9464,6 +9474,7 @@ func (x *QuerySequenceResponse) GetSequence() uint64 { return 0 } +// QueryConfig is the request for the account config. type QueryConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9497,7 +9508,7 @@ type QueryConfigResponse struct { unknownFields protoimpl.UnknownFields Members []*Member `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` - Config *Config `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` } func (x *QueryConfigResponse) Reset() { @@ -9534,6 +9545,7 @@ func (x *QueryConfigResponse) GetConfig() *Config { return nil } +// QueryProposal is the request for a proposal. type QueryProposal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9569,6 +9581,7 @@ func (x *QueryProposal) GetProposalId() uint64 { return 0 } +// QueryProposalResponse returns the proposal. type QueryProposalResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9623,10 +9636,10 @@ var file_cosmos_accounts_defaults_multisig_v1_multisig_proto_rawDesc = []byte{ 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x44, - 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, + 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, - 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x43, 0x6f, + 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x4a, 0x0a, 0x08, @@ -9662,10 +9675,10 @@ var file_cosmos_accounts_defaults_multisig_v1_multisig_proto_rawDesc = []byte{ 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, - 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, - 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x43, 0x6f, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x54, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, @@ -9709,11 +9722,11 @@ var file_cosmos_accounts_defaults_multisig_v1_multisig_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x06, 0x43, 0x6f, 0x6e, + 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, + 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x30, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, @@ -9801,16 +9814,16 @@ var file_cosmos_accounts_defaults_multisig_v1_multisig_proto_goTypes = []interfa } var file_cosmos_accounts_defaults_multisig_v1_multisig_proto_depIdxs = []int32{ 12, // 0: cosmos.accounts.defaults.multisig.v1.MsgInit.members:type_name -> cosmos.accounts.defaults.multisig.v1.Member - 13, // 1: cosmos.accounts.defaults.multisig.v1.MsgInit.Config:type_name -> cosmos.accounts.defaults.multisig.v1.Config + 13, // 1: cosmos.accounts.defaults.multisig.v1.MsgInit.config:type_name -> cosmos.accounts.defaults.multisig.v1.Config 14, // 2: cosmos.accounts.defaults.multisig.v1.MsgCreateProposal.proposal:type_name -> cosmos.accounts.defaults.multisig.v1.Proposal 1, // 3: cosmos.accounts.defaults.multisig.v1.MsgVote.vote:type_name -> cosmos.accounts.defaults.multisig.v1.VoteOption 21, // 4: cosmos.accounts.defaults.multisig.v1.MsgExecuteProposalResponse.responses:type_name -> google.protobuf.Any 12, // 5: cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.update_members:type_name -> cosmos.accounts.defaults.multisig.v1.Member - 13, // 6: cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.Config:type_name -> cosmos.accounts.defaults.multisig.v1.Config + 13, // 6: cosmos.accounts.defaults.multisig.v1.MsgUpdateConfig.config:type_name -> cosmos.accounts.defaults.multisig.v1.Config 21, // 7: cosmos.accounts.defaults.multisig.v1.Proposal.messages:type_name -> google.protobuf.Any 0, // 8: cosmos.accounts.defaults.multisig.v1.Proposal.status:type_name -> cosmos.accounts.defaults.multisig.v1.ProposalStatus 12, // 9: cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.members:type_name -> cosmos.accounts.defaults.multisig.v1.Member - 13, // 10: cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.Config:type_name -> cosmos.accounts.defaults.multisig.v1.Config + 13, // 10: cosmos.accounts.defaults.multisig.v1.QueryConfigResponse.config:type_name -> cosmos.accounts.defaults.multisig.v1.Config 14, // 11: cosmos.accounts.defaults.multisig.v1.QueryProposalResponse.proposal:type_name -> cosmos.accounts.defaults.multisig.v1.Proposal 12, // [12:12] is the sub-list for method output_type 12, // [12:12] is the sub-list for method input_type diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index fb21b170eab9..c6abf92981ac 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -256,6 +256,10 @@ func (bva *BaseLockup) SendCoins( hs := bva.headerService.HeaderInfo(ctx) + if err := msg.Amount.Validate(); err != nil { + return nil, err + } + lockedCoins, err := getLockedCoinsFunc(ctx, hs.Time, msg.Amount.Denoms()...) if err != nil { return nil, err diff --git a/x/accounts/defaults/multisig/v1/multisig.pb.go b/x/accounts/defaults/multisig/v1/multisig.pb.go index e8c19ffe6689..64466eebcb22 100644 --- a/x/accounts/defaults/multisig/v1/multisig.pb.go +++ b/x/accounts/defaults/multisig/v1/multisig.pb.go @@ -100,7 +100,7 @@ func (VoteOption) EnumDescriptor() ([]byte, []int) { // MsgInit is used to initialize a multisig account. type MsgInit struct { Members []*Member `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` - Config *Config `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` } func (m *MsgInit) Reset() { *m = MsgInit{} } @@ -187,6 +187,7 @@ func (m *MsgInitResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInitResponse proto.InternalMessageInfo +// MsgCreateProposal creates a new proposal. type MsgCreateProposal struct { Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` } @@ -231,6 +232,7 @@ func (m *MsgCreateProposal) GetProposal() *Proposal { return nil } +// MsgCreateProposalResponse is the response returned after creating a proposal. type MsgCreateProposalResponse struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` } @@ -275,6 +277,7 @@ func (m *MsgCreateProposalResponse) GetProposalId() uint64 { return 0 } +// MsgVote is used to vote on a proposal. type MsgVote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` Vote VoteOption `protobuf:"varint,2,opt,name=vote,proto3,enum=cosmos.accounts.defaults.multisig.v1.VoteOption" json:"vote,omitempty"` @@ -327,6 +330,7 @@ func (m *MsgVote) GetVote() VoteOption { return VoteOption_VOTE_OPTION_UNSPECIFIED } +// MsgVoteResponse is the response returned after voting on a proposal. type MsgVoteResponse struct { } @@ -363,6 +367,7 @@ func (m *MsgVoteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo +// MsgExecuteProposal is used to execute a proposal. type MsgExecuteProposal struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` } @@ -407,6 +412,7 @@ func (m *MsgExecuteProposal) GetProposalId() uint64 { return 0 } +// MsgExecuteProposalResponse is the response returned after executing a proposal. type MsgExecuteProposalResponse struct { Responses []*any.Any `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` } @@ -456,7 +462,7 @@ type MsgUpdateConfig struct { // only the members that are changing are required, if their weight is 0, they are removed. UpdateMembers []*Member `protobuf:"bytes,1,rep,name=update_members,json=updateMembers,proto3" json:"update_members,omitempty"` // not all fields from Config can be changed - Config *Config `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` } func (m *MsgUpdateConfig) Reset() { *m = MsgUpdateConfig{} } @@ -506,6 +512,7 @@ func (m *MsgUpdateConfig) GetConfig() *Config { return nil } +// MsgUpdateConfigResponse is the response returned after updating the config. type MsgUpdateConfigResponse struct { } @@ -542,6 +549,7 @@ func (m *MsgUpdateConfigResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateConfigResponse proto.InternalMessageInfo +// Member defines the member of the multisig account. type Member struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Weight uint64 `protobuf:"varint,2,opt,name=weight,proto3" json:"weight,omitempty"` @@ -594,6 +602,7 @@ func (m *Member) GetWeight() uint64 { return 0 } +// Config defines the configuration of the multisig account. type Config struct { Threshold int64 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"` Quorum int64 `protobuf:"varint,2,opt,name=quorum,proto3" json:"quorum,omitempty"` @@ -673,6 +682,7 @@ func (m *Config) GetEarlyExecution() bool { return false } +// Proposal defines the structure of a proposal. type Proposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` @@ -833,6 +843,7 @@ func (m *QuerySequenceResponse) GetSequence() uint64 { return 0 } +// QueryConfig is the request for the account config. type QueryConfig struct { } @@ -872,7 +883,7 @@ var xxx_messageInfo_QueryConfig proto.InternalMessageInfo // QueryConfigResponse returns the config of the account. type QueryConfigResponse struct { Members []*Member `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` - Config *Config `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` } func (m *QueryConfigResponse) Reset() { *m = QueryConfigResponse{} } @@ -922,6 +933,7 @@ func (m *QueryConfigResponse) GetConfig() *Config { return nil } +// QueryProposal is the request for a proposal. type QueryProposal struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` } @@ -966,6 +978,7 @@ func (m *QueryProposal) GetProposalId() uint64 { return 0 } +// QueryProposalResponse returns the proposal. type QueryProposalResponse struct { Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` } @@ -1039,7 +1052,7 @@ func init() { } var fileDescriptor_e6da8796717704d7 = []byte{ - // 865 bytes of a gzipped FileDescriptorProto + // 867 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x6f, 0xe3, 0x44, 0x14, 0xaf, 0x9b, 0x6e, 0x9a, 0xbe, 0xd2, 0x24, 0x9d, 0x96, 0xad, 0x9b, 0x5d, 0xb2, 0xc5, 0x20, 0xb1, 0xaa, 0x16, 0xa7, 0x9b, 0xc2, 0x8d, 0x4b, 0xda, 0xb8, 0x28, 0xab, 0x4d, 0x6c, 0xc6, 0x69, @@ -1053,48 +1066,48 @@ var fileDescriptor_e6da8796717704d7 = []byte{ 0x4d, 0x32, 0x82, 0xc6, 0x96, 0xac, 0x1a, 0xb2, 0x8c, 0x9e, 0x49, 0xe6, 0xc6, 0x76, 0x16, 0x70, 0x84, 0xd5, 0x92, 0x65, 0x84, 0xa1, 0xfd, 0xa4, 0xc0, 0x72, 0x9f, 0xf9, 0xbd, 0x28, 0xe0, 0xe8, 0x08, 0x96, 0x43, 0x12, 0x9e, 0x92, 0x84, 0xa9, 0xca, 0x4e, 0xe9, 0xe9, 0x6a, 0xfb, 0x99, 0x3e, - 0x8f, 0x24, 0xbd, 0x2f, 0x40, 0x38, 0x07, 0xa3, 0x2e, 0x94, 0x0f, 0x69, 0x74, 0x16, 0xf8, 0xea, - 0xe2, 0x8e, 0x32, 0x3f, 0x4d, 0x86, 0xc1, 0x12, 0xab, 0xad, 0x43, 0x4d, 0x0a, 0xc3, 0x84, 0xc5, - 0x34, 0x62, 0x44, 0x73, 0x60, 0xbd, 0xcf, 0xfc, 0xc3, 0x84, 0xb8, 0x9c, 0x58, 0x09, 0x8d, 0x29, - 0x73, 0xc7, 0xe8, 0x05, 0x54, 0x62, 0xf9, 0xad, 0x2a, 0xa2, 0x9e, 0x3e, 0x5f, 0xbd, 0x9c, 0x01, - 0x17, 0x78, 0xed, 0x2b, 0xd8, 0xbe, 0x53, 0x20, 0xaf, 0x8e, 0x9e, 0xc0, 0x6a, 0x9e, 0xe8, 0x04, - 0x9e, 0xa8, 0xb5, 0x84, 0x21, 0x77, 0xf5, 0x3c, 0x2d, 0x16, 0xad, 0x3c, 0xa1, 0xfc, 0xfd, 0xb9, - 0xa8, 0x0b, 0x4b, 0x17, 0x94, 0x13, 0xd1, 0xa1, 0x6a, 0x7b, 0x6f, 0x3e, 0xc5, 0xd7, 0xd4, 0x66, - 0xcc, 0x03, 0x1a, 0x61, 0x81, 0x96, 0x3d, 0xba, 0x76, 0x17, 0x3d,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, + 0x31, 0x87, 0x86, 0x63, 0x5a, 0xc3, 0x9e, 0x39, 0x98, 0xd1, 0xb1, 0x01, 0xb5, 0xe9, 0xe0, 0xb7, + 0x86, 0x5d, 0x57, 0xd0, 0x16, 0x6c, 0x4c, 0x3b, 0x3b, 0x07, 0xf6, 0xb0, 0xd3, 0x1b, 0xd4, 0x17, + 0x11, 0x82, 0xea, 0x74, 0x60, 0x60, 0xd6, 0x4b, 0x07, 0x47, 0xbf, 0x5f, 0x36, 0x95, 0xb7, 0x97, + 0x4d, 0xe5, 0xaf, 0xcb, 0xa6, 0xf2, 0xe3, 0x55, 0x73, 0xe1, 0xed, 0x55, 0x73, 0xe1, 0xcf, 0xab, + 0xe6, 0xc2, 0x77, 0xcf, 0xb2, 0x86, 0x32, 0xef, 0x95, 0x1e, 0xd0, 0xd6, 0x9b, 0x77, 0xff, 0x65, + 0x9c, 0x96, 0xc5, 0x4b, 0xdb, 0xff, 0x27, 0x00, 0x00, 0xff, 0xff, 0x70, 0x44, 0x04, 0xfe, 0x94, + 0x08, 0x00, 0x00, } func (m *MsgInit) Marshal() (dAtA []byte, err error) { diff --git a/x/accounts/proto/cosmos/accounts/defaults/multisig/v1/multisig.proto b/x/accounts/proto/cosmos/accounts/defaults/multisig/v1/multisig.proto index cd14b116e3b6..0d4a51e4dfe9 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/multisig/v1/multisig.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/multisig/v1/multisig.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package cosmos.accounts.defaults.multisig.v1; import "google/protobuf/any.proto"; -import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; option go_package = "cosmossdk.io/x/accounts/defaults/multisig/v1"; @@ -11,31 +10,37 @@ option go_package = "cosmossdk.io/x/accounts/defaults/multisig/v1"; // MsgInit is used to initialize a multisig account. message MsgInit { repeated Member members = 1; - Config Config = 2; + Config config = 2; } // MsgInitResponse is the response returned after account initialization. message MsgInitResponse {} +// MsgCreateProposal creates a new proposal. message MsgCreateProposal { Proposal proposal = 1; } +// MsgCreateProposalResponse is the response returned after creating a proposal. message MsgCreateProposalResponse { uint64 proposal_id = 1; } +// MsgVote is used to vote on a proposal. message MsgVote { uint64 proposal_id = 1; VoteOption vote = 2; } +// MsgVoteResponse is the response returned after voting on a proposal. message MsgVoteResponse {} +// MsgExecuteProposal is used to execute a proposal. message MsgExecuteProposal { uint64 proposal_id = 1; } +// MsgExecuteProposalResponse is the response returned after executing a proposal. message MsgExecuteProposalResponse { repeated google.protobuf.Any responses = 1; } @@ -46,11 +51,13 @@ message MsgUpdateConfig { repeated Member update_members = 1; // not all fields from Config can be changed - Config Config = 2; + Config config = 2; } +// MsgUpdateConfigResponse is the response returned after updating the config. message MsgUpdateConfigResponse {} +// Member defines the member of the multisig account. message Member { string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; uint64 weight = 2; @@ -59,6 +66,7 @@ message Member { // when aggregating on-chain I can only use the address // off-chain would send a tx directly, won't create a proposal. +// Config defines the configuration of the multisig account. message Config { int64 threshold = 1; @@ -74,6 +82,7 @@ message Config { bool early_execution = 5; } +// Proposal defines the structure of a proposal. message Proposal { string title = 1; string summary = 2; @@ -94,19 +103,22 @@ message QuerySequenceResponse { uint64 sequence = 1; } +// QueryConfig is the request for the account config. message QueryConfig {} // QueryConfigResponse returns the config of the account. message QueryConfigResponse { repeated Member members = 1; - Config Config = 2; + Config config = 2; } +// QueryProposal is the request for a proposal. message QueryProposal { uint64 proposal_id = 1; } +// QueryProposalResponse returns the proposal. message QueryProposalResponse { Proposal proposal = 1; }