From 2a83ffd5f8a73220cb7654d81ca4ad8b3637e7f4 Mon Sep 17 00:00:00 2001 From: Artur Abliazimov Date: Thu, 5 Sep 2024 13:32:38 +0300 Subject: [PATCH 1/8] Add MsgVote handling --- warden/x/act/keeper/actions.go | 67 +++++++++++++++++++ .../act/keeper/msg_server_vote_for_action.go | 35 +++++++++- warden/x/act/types/v1beta1/action.go | 33 +++++++++ warden/x/act/types/v1beta1/errors.go | 1 + 4 files changed, 135 insertions(+), 1 deletion(-) diff --git a/warden/x/act/keeper/actions.go b/warden/x/act/keeper/actions.go index 54720bec3..211c25189 100644 --- a/warden/x/act/keeper/actions.go +++ b/warden/x/act/keeper/actions.go @@ -30,6 +30,73 @@ func (approvers ApproversEnv) Get(name string) (object.Object, bool) { var _ shield.Environment = ApproversEnv{} +// ActionApprovedVotesEnv is an environment that resolves action positive votes addresses to true. +type ActionApprovedVotesEnv []*types.ActionVote + +// Get implements positive action vote evaluator.Environment. +func (votes ActionApprovedVotesEnv) Get(name string) (object.Object, bool) { + for _, s := range votes { + if s.Participant == name && s.Vote == types.ActionVoteType_VOTE_TYPE_APPROVED { + return object.TRUE, true + } + } + return object.FALSE, true +} + +var _ shield.Environment = ActionApprovedVotesEnv{} + +// ActionRejectedVotesEnv is an environment that resolves action negative votes addresses to true. +type ActionRejectedVotesEnv []*types.ActionVote + +// Get implements negative action vote evaluator.Environment. +func (votes ActionRejectedVotesEnv) Get(name string) (object.Object, bool) { + for _, s := range votes { + if s.Participant == name && s.Vote == types.ActionVoteType_VOTE_TYPE_REJECTED { + return object.TRUE, true + } + } + return object.FALSE, true +} + +var _ shield.Environment = ActionRejectedVotesEnv{} + +// TryExecuteVotedAction checks if the action's intent is satisfied and stores the +// result in the database. +func (k Keeper) TryExecuteVotedAction(ctx context.Context, act *types.Action) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + approved, err := act.Rule.Eval(ctx, ActionApprovedVotesEnv(act.Votes)) + + if err != nil { + return err + } + + if approved { + if err := k.executeAction(ctx, act); err != nil { + return err + } + + return nil + } + + rejected, err := act.Rule.Eval(ctx, ActionRejectedVotesEnv(act.Votes)) + + if err != nil { + return err + } + + if rejected { + if err := act.SetStatus(sdkCtx, types.ActionStatus_ACTION_STATUS_REVOKED); err != nil { + return err + } + if err := k.ActionKeeper.Set(ctx, *act); err != nil { + return err + } + } + + return nil +} + // TryExecuteAction checks if the action's intent is satisfied and stores the // result in the database. func (k Keeper) TryExecuteAction(ctx context.Context, act *types.Action) error { diff --git a/warden/x/act/keeper/msg_server_vote_for_action.go b/warden/x/act/keeper/msg_server_vote_for_action.go index 3102d431d..e1a49f397 100644 --- a/warden/x/act/keeper/msg_server_vote_for_action.go +++ b/warden/x/act/keeper/msg_server_vote_for_action.go @@ -2,10 +2,43 @@ package keeper import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" types "github.com/warden-protocol/wardenprotocol/warden/x/act/types/v1beta1" ) func (k msgServer) VoteForAction(goCtx context.Context, msg *types.MsgVoteForAction) (*types.MsgVoteForActionResponse, error) { - panic("VoteForAction not implemented") + ctx := sdk.UnwrapSDKContext(goCtx) + act, err := k.ActionKeeper.Get(ctx, msg.ActionId) + + if err != nil { + return nil, err + } + + if act.TimeoutHeight > 0 && act.TimeoutHeight < uint64(ctx.BlockHeight()) { + if err := act.SetStatus(ctx, types.ActionStatus_ACTION_STATUS_TIMEOUT); err != nil { + return nil, err + } + if err := k.ActionKeeper.Set(ctx, act); err != nil { + return nil, err + } + + return &types.MsgVoteForActionResponse{ + Status: act.Status.String(), + }, nil + } + + if err := act.AddVote(ctx, msg.Participant, msg.Vote); err != nil { + return nil, err + } + + if err := k.ActionKeeper.Set(ctx, act); err != nil { + return nil, err + } + + if err := k.TryExecuteVotedAction(ctx, &act); err != nil { + return nil, err + } + + return &types.MsgVoteForActionResponse{Status: act.Status.String()}, nil } diff --git a/warden/x/act/types/v1beta1/action.go b/warden/x/act/types/v1beta1/action.go index 63607438b..e69ff3b19 100644 --- a/warden/x/act/types/v1beta1/action.go +++ b/warden/x/act/types/v1beta1/action.go @@ -15,6 +15,14 @@ func NewApprover(address string, timestamp time.Time) *Approver { } } +func NewVote(participant string, vote ActionVoteType, timestamp time.Time) *ActionVote { + return &ActionVote{ + Participant: participant, + VotedAt: timestamp, + Vote: vote, + } +} + func (a *Action) SetId(id uint64) { a.Id = id } func (a *Action) SetResult(ctx sdk.Context, result *codectypes.Any) error { @@ -63,3 +71,28 @@ func (a *Action) AddApprover(ctx sdk.Context, address string) error { return nil } + +func (a *Action) AddVote(ctx sdk.Context, participant string, vote ActionVoteType) error { + if a.Status != ActionStatus_ACTION_STATUS_PENDING { + return errors.Wrapf(ErrInvalidActionStatus, "can't add a vote to an action that's not pending") + } + + for _, v := range a.Votes { + if v.Participant == participant { + return ErrActionVoteAlreadyExists + } + } + + a.UpdatedAt = ctx.BlockTime() + a.Votes = append(a.Votes, NewVote(participant, vote, a.UpdatedAt)) + + if err := ctx.EventManager().EmitTypedEvent(&EventActionVoted{ + Id: a.Id, + Participant: participant, + Vote: vote, + }); err != nil { + return err + } + + return nil +} diff --git a/warden/x/act/types/v1beta1/errors.go b/warden/x/act/types/v1beta1/errors.go index c7fa0615d..a7e71bd18 100644 --- a/warden/x/act/types/v1beta1/errors.go +++ b/warden/x/act/types/v1beta1/errors.go @@ -23,4 +23,5 @@ var ( ErrInvalidRuleDefinition = sdkerrors.Register(ModuleName, 1112, "invalid rule definition") ErrInvalidRevoker = sdkerrors.Register(ModuleName, 1113, "this account can't revoke this action") ErrInvalidUpdateRuleAccount = sdkerrors.Register(ModuleName, 1114, "this account can't update this rule") + ErrActionVoteAlreadyExists = sdkerrors.Register(ModuleName, 1115, "vote already exists") ) From 2a2be8dd5328ec1274374724c8a97a4bc1c05566 Mon Sep 17 00:00:00 2001 From: Artur Abliazimov Date: Thu, 5 Sep 2024 15:09:24 +0300 Subject: [PATCH 2/8] Fixes and core refactoring --- api/warden/act/v1beta1/action_vote.pulsar.go | 107 +++++----- api/warden/act/v1beta1/events.pulsar.go | 125 ++++++------ api/warden/act/v1beta1/tx.pulsar.go | 188 +++++++++--------- proto/warden/act/v1beta1/action_vote.proto | 2 +- proto/warden/act/v1beta1/events.proto | 2 +- proto/warden/act/v1beta1/tx.proto | 2 +- warden/x/act/keeper/actions.go | 30 ++- .../act/keeper/msg_server_vote_for_action.go | 2 +- warden/x/act/types/v1beta1/action.go | 14 +- warden/x/act/types/v1beta1/action_vote.pb.go | 47 ++--- warden/x/act/types/v1beta1/errors.go | 32 +-- warden/x/act/types/v1beta1/events.pb.go | 72 +++---- warden/x/act/types/v1beta1/tx.pb.go | 126 ++++++------ warden/x/warden/types/v1beta3/keychain.pb.go | 2 +- warden/x/warden/types/v1beta3/tx.pb.go | 64 ++---- 15 files changed, 395 insertions(+), 420 deletions(-) diff --git a/api/warden/act/v1beta1/action_vote.pulsar.go b/api/warden/act/v1beta1/action_vote.pulsar.go index 0ba3b3e52..745835f2d 100644 --- a/api/warden/act/v1beta1/action_vote.pulsar.go +++ b/api/warden/act/v1beta1/action_vote.pulsar.go @@ -19,7 +19,7 @@ var ( md_ActionVote protoreflect.MessageDescriptor fd_ActionVote_participant protoreflect.FieldDescriptor fd_ActionVote_voted_at protoreflect.FieldDescriptor - fd_ActionVote_vote protoreflect.FieldDescriptor + fd_ActionVote_vote_type protoreflect.FieldDescriptor ) func init() { @@ -27,7 +27,7 @@ func init() { md_ActionVote = File_warden_act_v1beta1_action_vote_proto.Messages().ByName("ActionVote") fd_ActionVote_participant = md_ActionVote.Fields().ByName("participant") fd_ActionVote_voted_at = md_ActionVote.Fields().ByName("voted_at") - fd_ActionVote_vote = md_ActionVote.Fields().ByName("vote") + fd_ActionVote_vote_type = md_ActionVote.Fields().ByName("vote_type") } var _ protoreflect.Message = (*fastReflection_ActionVote)(nil) @@ -107,9 +107,9 @@ func (x *fastReflection_ActionVote) Range(f func(protoreflect.FieldDescriptor, p return } } - if x.Vote != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Vote)) - if !f(fd_ActionVote_vote, value) { + if x.VoteType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.VoteType)) + if !f(fd_ActionVote_vote_type, value) { return } } @@ -132,8 +132,8 @@ func (x *fastReflection_ActionVote) Has(fd protoreflect.FieldDescriptor) bool { return x.Participant != "" case "warden.act.v1beta1.ActionVote.voted_at": return x.VotedAt != nil - case "warden.act.v1beta1.ActionVote.vote": - return x.Vote != 0 + case "warden.act.v1beta1.ActionVote.vote_type": + return x.VoteType != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.ActionVote")) @@ -154,8 +154,8 @@ func (x *fastReflection_ActionVote) Clear(fd protoreflect.FieldDescriptor) { x.Participant = "" case "warden.act.v1beta1.ActionVote.voted_at": x.VotedAt = nil - case "warden.act.v1beta1.ActionVote.vote": - x.Vote = 0 + case "warden.act.v1beta1.ActionVote.vote_type": + x.VoteType = 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.ActionVote")) @@ -178,8 +178,8 @@ func (x *fastReflection_ActionVote) Get(descriptor protoreflect.FieldDescriptor) case "warden.act.v1beta1.ActionVote.voted_at": value := x.VotedAt return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "warden.act.v1beta1.ActionVote.vote": - value := x.Vote + case "warden.act.v1beta1.ActionVote.vote_type": + value := x.VoteType return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) default: if descriptor.IsExtension() { @@ -205,8 +205,8 @@ func (x *fastReflection_ActionVote) Set(fd protoreflect.FieldDescriptor, value p x.Participant = value.Interface().(string) case "warden.act.v1beta1.ActionVote.voted_at": x.VotedAt = value.Message().Interface().(*timestamppb.Timestamp) - case "warden.act.v1beta1.ActionVote.vote": - x.Vote = (ActionVoteType)(value.Enum()) + case "warden.act.v1beta1.ActionVote.vote_type": + x.VoteType = (ActionVoteType)(value.Enum()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.ActionVote")) @@ -234,8 +234,8 @@ func (x *fastReflection_ActionVote) Mutable(fd protoreflect.FieldDescriptor) pro return protoreflect.ValueOfMessage(x.VotedAt.ProtoReflect()) case "warden.act.v1beta1.ActionVote.participant": panic(fmt.Errorf("field participant of message warden.act.v1beta1.ActionVote is not mutable")) - case "warden.act.v1beta1.ActionVote.vote": - panic(fmt.Errorf("field vote of message warden.act.v1beta1.ActionVote is not mutable")) + case "warden.act.v1beta1.ActionVote.vote_type": + panic(fmt.Errorf("field vote_type of message warden.act.v1beta1.ActionVote is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.ActionVote")) @@ -254,7 +254,7 @@ func (x *fastReflection_ActionVote) NewField(fd protoreflect.FieldDescriptor) pr case "warden.act.v1beta1.ActionVote.voted_at": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "warden.act.v1beta1.ActionVote.vote": + case "warden.act.v1beta1.ActionVote.vote_type": return protoreflect.ValueOfEnum(0) default: if fd.IsExtension() { @@ -333,8 +333,8 @@ func (x *fastReflection_ActionVote) ProtoMethods() *protoiface.Methods { l = options.Size(x.VotedAt) n += 1 + l + runtime.Sov(uint64(l)) } - if x.Vote != 0 { - n += 1 + runtime.Sov(uint64(x.Vote)) + if x.VoteType != 0 { + n += 1 + runtime.Sov(uint64(x.VoteType)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -365,8 +365,8 @@ func (x *fastReflection_ActionVote) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Vote != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Vote)) + if x.VoteType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.VoteType)) i-- dAtA[i] = 0x18 } @@ -510,9 +510,9 @@ func (x *fastReflection_ActionVote) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VoteType", wireType) } - x.Vote = 0 + x.VoteType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -522,7 +522,7 @@ func (x *fastReflection_ActionVote) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Vote |= ActionVoteType(b&0x7F) << shift + x.VoteType |= ActionVoteType(b&0x7F) << shift if b < 0x80 { break } @@ -638,7 +638,7 @@ type ActionVote struct { // voted_at is a timestamp specifying when the voter voted on the action. VotedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=voted_at,json=votedAt,proto3" json:"voted_at,omitempty"` // vote is the type of the vote. - Vote ActionVoteType `protobuf:"varint,3,opt,name=vote,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote,omitempty"` + VoteType ActionVoteType `protobuf:"varint,3,opt,name=vote_type,json=voteType,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote_type,omitempty"` } func (x *ActionVote) Reset() { @@ -675,9 +675,9 @@ func (x *ActionVote) GetVotedAt() *timestamppb.Timestamp { return nil } -func (x *ActionVote) GetVote() ActionVoteType { +func (x *ActionVote) GetVoteType() ActionVoteType { if x != nil { - return x.Vote + return x.VoteType } return ActionVoteType_VOTE_TYPE_UNSPECIFIED } @@ -693,38 +693,39 @@ var file_warden_act_v1beta1_action_vote_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x01, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb5, 0x01, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x76, - 0x6f, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x77, 0x61, 0x72, 0x64, - 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x76, - 0x6f, 0x74, 0x65, 0x2a, 0x5b, 0x0a, 0x0e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x16, 0x0a, 0x12, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x50, - 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x4f, 0x54, 0x45, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, - 0x42, 0xe0, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, - 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0f, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, - 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, - 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x61, - 0x72, 0x64, 0x65, 0x6e, 0x2f, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x3b, 0x61, 0x63, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x57, 0x41, - 0x58, 0xaa, 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x2e, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x5c, - 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x57, 0x61, - 0x72, 0x64, 0x65, 0x6e, 0x5c, 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x57, - 0x61, 0x72, 0x64, 0x65, 0x6e, 0x3a, 0x3a, 0x41, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2a, 0x01, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3f, 0x0a, 0x09, 0x76, + 0x6f, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, + 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x2a, 0x5b, 0x0a, 0x0e, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, + 0x0a, 0x15, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x4f, 0x54, + 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, + 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, + 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x42, 0xe0, 0x01, 0x0a, 0x16, 0x63, 0x6f, + 0x6d, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x42, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2f, 0x61, 0x63, + 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x63, 0x74, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x57, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x57, 0x61, 0x72, + 0x64, 0x65, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, + 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x5c, 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x5c, 0x41, 0x63, + 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x3a, 0x3a, + 0x41, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -748,7 +749,7 @@ var file_warden_act_v1beta1_action_vote_proto_goTypes = []interface{}{ } var file_warden_act_v1beta1_action_vote_proto_depIdxs = []int32{ 2, // 0: warden.act.v1beta1.ActionVote.voted_at:type_name -> google.protobuf.Timestamp - 0, // 1: warden.act.v1beta1.ActionVote.vote:type_name -> warden.act.v1beta1.ActionVoteType + 0, // 1: warden.act.v1beta1.ActionVote.vote_type:type_name -> warden.act.v1beta1.ActionVoteType 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name diff --git a/api/warden/act/v1beta1/events.pulsar.go b/api/warden/act/v1beta1/events.pulsar.go index 2ac8871bf..f790fb625 100644 --- a/api/warden/act/v1beta1/events.pulsar.go +++ b/api/warden/act/v1beta1/events.pulsar.go @@ -1824,7 +1824,7 @@ var ( md_EventActionVoted protoreflect.MessageDescriptor fd_EventActionVoted_id protoreflect.FieldDescriptor fd_EventActionVoted_participant protoreflect.FieldDescriptor - fd_EventActionVoted_vote protoreflect.FieldDescriptor + fd_EventActionVoted_vote_type protoreflect.FieldDescriptor ) func init() { @@ -1832,7 +1832,7 @@ func init() { md_EventActionVoted = File_warden_act_v1beta1_events_proto.Messages().ByName("EventActionVoted") fd_EventActionVoted_id = md_EventActionVoted.Fields().ByName("id") fd_EventActionVoted_participant = md_EventActionVoted.Fields().ByName("participant") - fd_EventActionVoted_vote = md_EventActionVoted.Fields().ByName("vote") + fd_EventActionVoted_vote_type = md_EventActionVoted.Fields().ByName("vote_type") } var _ protoreflect.Message = (*fastReflection_EventActionVoted)(nil) @@ -1912,9 +1912,9 @@ func (x *fastReflection_EventActionVoted) Range(f func(protoreflect.FieldDescrip return } } - if x.Vote != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Vote)) - if !f(fd_EventActionVoted_vote, value) { + if x.VoteType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.VoteType)) + if !f(fd_EventActionVoted_vote_type, value) { return } } @@ -1937,8 +1937,8 @@ func (x *fastReflection_EventActionVoted) Has(fd protoreflect.FieldDescriptor) b return x.Id != uint64(0) case "warden.act.v1beta1.EventActionVoted.participant": return x.Participant != "" - case "warden.act.v1beta1.EventActionVoted.vote": - return x.Vote != 0 + case "warden.act.v1beta1.EventActionVoted.vote_type": + return x.VoteType != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.EventActionVoted")) @@ -1959,8 +1959,8 @@ func (x *fastReflection_EventActionVoted) Clear(fd protoreflect.FieldDescriptor) x.Id = uint64(0) case "warden.act.v1beta1.EventActionVoted.participant": x.Participant = "" - case "warden.act.v1beta1.EventActionVoted.vote": - x.Vote = 0 + case "warden.act.v1beta1.EventActionVoted.vote_type": + x.VoteType = 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.EventActionVoted")) @@ -1983,8 +1983,8 @@ func (x *fastReflection_EventActionVoted) Get(descriptor protoreflect.FieldDescr case "warden.act.v1beta1.EventActionVoted.participant": value := x.Participant return protoreflect.ValueOfString(value) - case "warden.act.v1beta1.EventActionVoted.vote": - value := x.Vote + case "warden.act.v1beta1.EventActionVoted.vote_type": + value := x.VoteType return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) default: if descriptor.IsExtension() { @@ -2010,8 +2010,8 @@ func (x *fastReflection_EventActionVoted) Set(fd protoreflect.FieldDescriptor, v x.Id = value.Uint() case "warden.act.v1beta1.EventActionVoted.participant": x.Participant = value.Interface().(string) - case "warden.act.v1beta1.EventActionVoted.vote": - x.Vote = (ActionVoteType)(value.Enum()) + case "warden.act.v1beta1.EventActionVoted.vote_type": + x.VoteType = (ActionVoteType)(value.Enum()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.EventActionVoted")) @@ -2036,8 +2036,8 @@ func (x *fastReflection_EventActionVoted) Mutable(fd protoreflect.FieldDescripto panic(fmt.Errorf("field id of message warden.act.v1beta1.EventActionVoted is not mutable")) case "warden.act.v1beta1.EventActionVoted.participant": panic(fmt.Errorf("field participant of message warden.act.v1beta1.EventActionVoted is not mutable")) - case "warden.act.v1beta1.EventActionVoted.vote": - panic(fmt.Errorf("field vote of message warden.act.v1beta1.EventActionVoted is not mutable")) + case "warden.act.v1beta1.EventActionVoted.vote_type": + panic(fmt.Errorf("field vote_type of message warden.act.v1beta1.EventActionVoted is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.EventActionVoted")) @@ -2055,7 +2055,7 @@ func (x *fastReflection_EventActionVoted) NewField(fd protoreflect.FieldDescript return protoreflect.ValueOfUint64(uint64(0)) case "warden.act.v1beta1.EventActionVoted.participant": return protoreflect.ValueOfString("") - case "warden.act.v1beta1.EventActionVoted.vote": + case "warden.act.v1beta1.EventActionVoted.vote_type": return protoreflect.ValueOfEnum(0) default: if fd.IsExtension() { @@ -2133,8 +2133,8 @@ func (x *fastReflection_EventActionVoted) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Vote != 0 { - n += 1 + runtime.Sov(uint64(x.Vote)) + if x.VoteType != 0 { + n += 1 + runtime.Sov(uint64(x.VoteType)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -2165,8 +2165,8 @@ func (x *fastReflection_EventActionVoted) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Vote != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Vote)) + if x.VoteType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.VoteType)) i-- dAtA[i] = 0x18 } @@ -2284,9 +2284,9 @@ func (x *fastReflection_EventActionVoted) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VoteType", wireType) } - x.Vote = 0 + x.VoteType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2296,7 +2296,7 @@ func (x *fastReflection_EventActionVoted) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Vote |= ActionVoteType(b&0x7F) << shift + x.VoteType |= ActionVoteType(b&0x7F) << shift if b < 0x80 { break } @@ -3439,7 +3439,7 @@ type EventActionVoted struct { // address of the account that participated in voting Participant string `protobuf:"bytes,2,opt,name=participant,proto3" json:"participant,omitempty"` // type of the vote - Vote ActionVoteType `protobuf:"varint,3,opt,name=vote,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote,omitempty"` + VoteType ActionVoteType `protobuf:"varint,3,opt,name=vote_type,json=voteType,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote_type,omitempty"` } func (x *EventActionVoted) Reset() { @@ -3476,9 +3476,9 @@ func (x *EventActionVoted) GetParticipant() string { return "" } -func (x *EventActionVoted) GetVote() ActionVoteType { +func (x *EventActionVoted) GetVoteType() ActionVoteType { if x != nil { - return x.Vote + return x.VoteType } return ActionVoteType_VOTE_TYPE_UNSPECIFIED } @@ -3600,43 +3600,44 @@ var file_warden_act_v1beta1_events_proto_rawDesc = []byte{ 0x76, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x22, 0x7c, 0x0a, - 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, - 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x22, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x76, 0x6f, 0x74, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x16, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x49, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x22, 0x85, 0x01, + 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, + 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, + 0x70, 0x61, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x09, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, + 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x76, 0x6f, 0x74, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x16, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x49, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x77, 0x61, 0x72, 0x64, + 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x6f, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3f, 0x0a, 0x0a, 0x6e, + 0x65, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x3f, 0x0a, 0x0a, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, - 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x23, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x42, 0xdc, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, - 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, - 0x72, 0x64, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x61, - 0x72, 0x64, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2f, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x3b, 0x61, 0x63, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x57, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x41, 0x63, - 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, - 0x65, 0x6e, 0x5c, 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, - 0x1e, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x5c, 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x14, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x3a, 0x3a, 0x41, 0x63, 0x74, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x23, 0x0a, 0x11, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x75, 0x6e, 0x65, + 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, + 0x64, 0x42, 0xdc, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, + 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, + 0x6e, 0x2f, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x63, + 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x57, 0x41, 0x58, 0xaa, 0x02, + 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xca, 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x5c, 0x41, 0x63, 0x74, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x57, 0x61, 0x72, 0x64, 0x65, + 0x6e, 0x5c, 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x57, 0x61, 0x72, 0x64, + 0x65, 0x6e, 0x3a, 0x3a, 0x41, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3664,7 +3665,7 @@ var file_warden_act_v1beta1_events_proto_goTypes = []interface{}{ (ActionStatus)(0), // 8: warden.act.v1beta1.ActionStatus } var file_warden_act_v1beta1_events_proto_depIdxs = []int32{ - 7, // 0: warden.act.v1beta1.EventActionVoted.vote:type_name -> warden.act.v1beta1.ActionVoteType + 7, // 0: warden.act.v1beta1.EventActionVoted.vote_type:type_name -> warden.act.v1beta1.ActionVoteType 8, // 1: warden.act.v1beta1.EventActionStateChange.previous_status:type_name -> warden.act.v1beta1.ActionStatus 8, // 2: warden.act.v1beta1.EventActionStateChange.new_status:type_name -> warden.act.v1beta1.ActionStatus 3, // [3:3] is the sub-list for method output_type diff --git a/api/warden/act/v1beta1/tx.pulsar.go b/api/warden/act/v1beta1/tx.pulsar.go index d8ad8bbfb..47714a03a 100644 --- a/api/warden/act/v1beta1/tx.pulsar.go +++ b/api/warden/act/v1beta1/tx.pulsar.go @@ -6331,7 +6331,7 @@ var ( md_MsgVoteForAction protoreflect.MessageDescriptor fd_MsgVoteForAction_participant protoreflect.FieldDescriptor fd_MsgVoteForAction_action_id protoreflect.FieldDescriptor - fd_MsgVoteForAction_vote protoreflect.FieldDescriptor + fd_MsgVoteForAction_vote_type protoreflect.FieldDescriptor ) func init() { @@ -6339,7 +6339,7 @@ func init() { md_MsgVoteForAction = File_warden_act_v1beta1_tx_proto.Messages().ByName("MsgVoteForAction") fd_MsgVoteForAction_participant = md_MsgVoteForAction.Fields().ByName("participant") fd_MsgVoteForAction_action_id = md_MsgVoteForAction.Fields().ByName("action_id") - fd_MsgVoteForAction_vote = md_MsgVoteForAction.Fields().ByName("vote") + fd_MsgVoteForAction_vote_type = md_MsgVoteForAction.Fields().ByName("vote_type") } var _ protoreflect.Message = (*fastReflection_MsgVoteForAction)(nil) @@ -6419,9 +6419,9 @@ func (x *fastReflection_MsgVoteForAction) Range(f func(protoreflect.FieldDescrip return } } - if x.Vote != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Vote)) - if !f(fd_MsgVoteForAction_vote, value) { + if x.VoteType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.VoteType)) + if !f(fd_MsgVoteForAction_vote_type, value) { return } } @@ -6444,8 +6444,8 @@ func (x *fastReflection_MsgVoteForAction) Has(fd protoreflect.FieldDescriptor) b return x.Participant != "" case "warden.act.v1beta1.MsgVoteForAction.action_id": return x.ActionId != uint64(0) - case "warden.act.v1beta1.MsgVoteForAction.vote": - return x.Vote != 0 + case "warden.act.v1beta1.MsgVoteForAction.vote_type": + return x.VoteType != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgVoteForAction")) @@ -6466,8 +6466,8 @@ func (x *fastReflection_MsgVoteForAction) Clear(fd protoreflect.FieldDescriptor) x.Participant = "" case "warden.act.v1beta1.MsgVoteForAction.action_id": x.ActionId = uint64(0) - case "warden.act.v1beta1.MsgVoteForAction.vote": - x.Vote = 0 + case "warden.act.v1beta1.MsgVoteForAction.vote_type": + x.VoteType = 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgVoteForAction")) @@ -6490,8 +6490,8 @@ func (x *fastReflection_MsgVoteForAction) Get(descriptor protoreflect.FieldDescr case "warden.act.v1beta1.MsgVoteForAction.action_id": value := x.ActionId return protoreflect.ValueOfUint64(value) - case "warden.act.v1beta1.MsgVoteForAction.vote": - value := x.Vote + case "warden.act.v1beta1.MsgVoteForAction.vote_type": + value := x.VoteType return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) default: if descriptor.IsExtension() { @@ -6517,8 +6517,8 @@ func (x *fastReflection_MsgVoteForAction) Set(fd protoreflect.FieldDescriptor, v x.Participant = value.Interface().(string) case "warden.act.v1beta1.MsgVoteForAction.action_id": x.ActionId = value.Uint() - case "warden.act.v1beta1.MsgVoteForAction.vote": - x.Vote = (ActionVoteType)(value.Enum()) + case "warden.act.v1beta1.MsgVoteForAction.vote_type": + x.VoteType = (ActionVoteType)(value.Enum()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgVoteForAction")) @@ -6543,8 +6543,8 @@ func (x *fastReflection_MsgVoteForAction) Mutable(fd protoreflect.FieldDescripto panic(fmt.Errorf("field participant of message warden.act.v1beta1.MsgVoteForAction is not mutable")) case "warden.act.v1beta1.MsgVoteForAction.action_id": panic(fmt.Errorf("field action_id of message warden.act.v1beta1.MsgVoteForAction is not mutable")) - case "warden.act.v1beta1.MsgVoteForAction.vote": - panic(fmt.Errorf("field vote of message warden.act.v1beta1.MsgVoteForAction is not mutable")) + case "warden.act.v1beta1.MsgVoteForAction.vote_type": + panic(fmt.Errorf("field vote_type of message warden.act.v1beta1.MsgVoteForAction is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgVoteForAction")) @@ -6562,7 +6562,7 @@ func (x *fastReflection_MsgVoteForAction) NewField(fd protoreflect.FieldDescript return protoreflect.ValueOfString("") case "warden.act.v1beta1.MsgVoteForAction.action_id": return protoreflect.ValueOfUint64(uint64(0)) - case "warden.act.v1beta1.MsgVoteForAction.vote": + case "warden.act.v1beta1.MsgVoteForAction.vote_type": return protoreflect.ValueOfEnum(0) default: if fd.IsExtension() { @@ -6640,8 +6640,8 @@ func (x *fastReflection_MsgVoteForAction) ProtoMethods() *protoiface.Methods { if x.ActionId != 0 { n += 1 + runtime.Sov(uint64(x.ActionId)) } - if x.Vote != 0 { - n += 1 + runtime.Sov(uint64(x.Vote)) + if x.VoteType != 0 { + n += 1 + runtime.Sov(uint64(x.VoteType)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -6672,8 +6672,8 @@ func (x *fastReflection_MsgVoteForAction) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Vote != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Vote)) + if x.VoteType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.VoteType)) i-- dAtA[i] = 0x18 } @@ -6791,9 +6791,9 @@ func (x *fastReflection_MsgVoteForAction) ProtoMethods() *protoiface.Methods { } case 3: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VoteType", wireType) } - x.Vote = 0 + x.VoteType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6803,7 +6803,7 @@ func (x *fastReflection_MsgVoteForAction) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Vote |= ActionVoteType(b&0x7F) << shift + x.VoteType |= ActionVoteType(b&0x7F) << shift if b < 0x80 { break } @@ -7843,7 +7843,7 @@ type MsgVoteForAction struct { Participant string `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"` ActionId uint64 `protobuf:"varint,2,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - Vote ActionVoteType `protobuf:"varint,3,opt,name=vote,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote,omitempty"` + VoteType ActionVoteType `protobuf:"varint,3,opt,name=vote_type,json=voteType,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote_type,omitempty"` } func (x *MsgVoteForAction) Reset() { @@ -7880,9 +7880,9 @@ func (x *MsgVoteForAction) GetActionId() uint64 { return 0 } -func (x *MsgVoteForAction) GetVote() ActionVoteType { +func (x *MsgVoteForAction) GetVoteType() ActionVoteType { if x != nil { - return x.Vote + return x.VoteType } return ActionVoteType_VOTE_TYPE_UNSPECIFIED } @@ -8008,83 +8008,83 @@ var file_warden_act_v1beta1_tx_proto_rawDesc = []byte{ 0x2a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x30, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x10, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x36, 0x0a, 0x04, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, + 0x3f, 0x0a, 0x09, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, + 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x22, 0x32, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x46, 0x6f, 0x72, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x81, 0x06, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, + 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, + 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x57, 0x0a, 0x09, 0x4e, 0x65, 0x77, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x04, 0x76, 0x6f, 0x74, 0x65, 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x32, 0x0a, 0x18, 0x4d, 0x73, 0x67, - 0x56, 0x6f, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x81, 0x06, - 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, - 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x77, 0x61, 0x72, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, + 0x28, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x41, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x4e, 0x65, 0x77, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, - 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x28, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, - 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, - 0x65, 0x77, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x63, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x24, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, - 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2c, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, - 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, - 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2a, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, - 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x07, 0x4e, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x12, - 0x1e, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x1a, - 0x26, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x21, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, - 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x1a, 0x29, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, + 0x4d, 0x73, 0x67, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x2c, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, + 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, + 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x1a, 0x2a, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, + 0x07, 0x4e, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0c, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, - 0x6b, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2b, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, + 0x67, 0x4e, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x1a, 0x26, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x56, 0x6f, 0x74, 0x65, 0x46, 0x6f, 0x72, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, - 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, - 0x6f, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2c, 0x2e, 0x77, + 0x67, 0x4e, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x5a, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x21, + 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x75, 0x6c, + 0x65, 0x1a, 0x29, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0c, + 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, - 0x01, 0x42, 0xd8, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, - 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2f, 0x61, 0x63, - 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x63, 0x74, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x57, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x57, 0x61, 0x72, - 0x64, 0x65, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, - 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x5c, 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x5c, 0x41, 0x63, - 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x3a, 0x3a, - 0x41, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x1a, 0x2b, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, + 0x0a, 0x0d, 0x56, 0x6f, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x24, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2c, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, + 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, + 0x74, 0x65, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xd8, 0x01, 0x0a, 0x16, 0x63, + 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x72, + 0x64, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x61, 0x72, + 0x64, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2f, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x3b, 0x61, 0x63, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, + 0x57, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x41, 0x63, 0x74, + 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x12, 0x57, 0x61, 0x72, 0x64, 0x65, + 0x6e, 0x5c, 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, + 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x5c, 0x41, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x14, 0x57, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x3a, 0x3a, 0x41, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8124,7 +8124,7 @@ var file_warden_act_v1beta1_tx_proto_goTypes = []interface{}{ var file_warden_act_v1beta1_tx_proto_depIdxs = []int32{ 16, // 0: warden.act.v1beta1.MsgUpdateParams.params:type_name -> warden.act.v1beta1.Params 17, // 1: warden.act.v1beta1.MsgNewAction.message:type_name -> google.protobuf.Any - 18, // 2: warden.act.v1beta1.MsgVoteForAction.vote:type_name -> warden.act.v1beta1.ActionVoteType + 18, // 2: warden.act.v1beta1.MsgVoteForAction.vote_type:type_name -> warden.act.v1beta1.ActionVoteType 0, // 3: warden.act.v1beta1.Msg.UpdateParams:input_type -> warden.act.v1beta1.MsgUpdateParams 2, // 4: warden.act.v1beta1.Msg.NewAction:input_type -> warden.act.v1beta1.MsgNewAction 4, // 5: warden.act.v1beta1.Msg.ApproveAction:input_type -> warden.act.v1beta1.MsgApproveAction diff --git a/proto/warden/act/v1beta1/action_vote.proto b/proto/warden/act/v1beta1/action_vote.proto index 79aac6a73..8942f9a29 100644 --- a/proto/warden/act/v1beta1/action_vote.proto +++ b/proto/warden/act/v1beta1/action_vote.proto @@ -16,7 +16,7 @@ message ActionVote { [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // vote is the type of the vote. - ActionVoteType vote = 3; + ActionVoteType vote_type = 3; } // Type of a vote. diff --git a/proto/warden/act/v1beta1/events.proto b/proto/warden/act/v1beta1/events.proto index 0d971b5f0..854af5da9 100644 --- a/proto/warden/act/v1beta1/events.proto +++ b/proto/warden/act/v1beta1/events.proto @@ -49,7 +49,7 @@ message EventActionVoted { string participant = 2; // type of the vote - ActionVoteType vote = 3; + ActionVoteType vote_type = 3; } // EventActionStateChange is emitted when an Action is in a new state diff --git a/proto/warden/act/v1beta1/tx.proto b/proto/warden/act/v1beta1/tx.proto index d466dfdb2..ac9f8792e 100644 --- a/proto/warden/act/v1beta1/tx.proto +++ b/proto/warden/act/v1beta1/tx.proto @@ -128,7 +128,7 @@ message MsgVoteForAction { option (cosmos.msg.v1.signer) = "participant"; string participant = 1; uint64 action_id = 2; - ActionVoteType vote = 3; + ActionVoteType vote_type = 3; } message MsgVoteForActionResponse { diff --git a/warden/x/act/keeper/actions.go b/warden/x/act/keeper/actions.go index 211c25189..0fcb2158a 100644 --- a/warden/x/act/keeper/actions.go +++ b/warden/x/act/keeper/actions.go @@ -3,13 +3,13 @@ package keeper import ( "context" "fmt" + "github.com/warden-protocol/wardenprotocol/shield" "runtime/debug" "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/baseapp" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/warden-protocol/wardenprotocol/shield" "github.com/warden-protocol/wardenprotocol/shield/object" "github.com/warden-protocol/wardenprotocol/warden/x/act/cosmoshield" types "github.com/warden-protocol/wardenprotocol/warden/x/act/types/v1beta1" @@ -28,59 +28,55 @@ func (approvers ApproversEnv) Get(name string) (object.Object, bool) { return object.FALSE, true } -var _ shield.Environment = ApproversEnv{} - // ActionApprovedVotesEnv is an environment that resolves action positive votes addresses to true. type ActionApprovedVotesEnv []*types.ActionVote // Get implements positive action vote evaluator.Environment. func (votes ActionApprovedVotesEnv) Get(name string) (object.Object, bool) { for _, s := range votes { - if s.Participant == name && s.Vote == types.ActionVoteType_VOTE_TYPE_APPROVED { + if s.Participant == name && s.VoteType == types.ActionVoteType_VOTE_TYPE_APPROVED { return object.TRUE, true } } return object.FALSE, true } -var _ shield.Environment = ActionApprovedVotesEnv{} - // ActionRejectedVotesEnv is an environment that resolves action negative votes addresses to true. type ActionRejectedVotesEnv []*types.ActionVote // Get implements negative action vote evaluator.Environment. func (votes ActionRejectedVotesEnv) Get(name string) (object.Object, bool) { for _, s := range votes { - if s.Participant == name && s.Vote == types.ActionVoteType_VOTE_TYPE_REJECTED { + if s.Participant == name && s.VoteType == types.ActionVoteType_VOTE_TYPE_REJECTED { return object.TRUE, true } } return object.FALSE, true } -var _ shield.Environment = ActionRejectedVotesEnv{} - // TryExecuteVotedAction checks if the action's intent is satisfied and stores the // result in the database. func (k Keeper) TryExecuteVotedAction(ctx context.Context, act *types.Action) error { sdkCtx := sdk.UnwrapSDKContext(ctx) - approved, err := act.Rule.Eval(ctx, ActionApprovedVotesEnv(act.Votes)) + evaluateVotes := func(env shield.Environment) (bool, error) { + ready, err := act.Rule.Eval(ctx, env) + if err != nil { + return false, fmt.Errorf("failed to evaluate votes: %w", err) + } + return ready, nil + } + approved, err := evaluateVotes(ActionApprovedVotesEnv(act.Votes)) if err != nil { return err } if approved { - if err := k.executeAction(ctx, act); err != nil { - return err - } - - return nil + return k.executeAction(ctx, act) } - rejected, err := act.Rule.Eval(ctx, ActionRejectedVotesEnv(act.Votes)) - + rejected, err := evaluateVotes(ActionRejectedVotesEnv(act.Votes)) if err != nil { return err } diff --git a/warden/x/act/keeper/msg_server_vote_for_action.go b/warden/x/act/keeper/msg_server_vote_for_action.go index e1a49f397..6c6fe0627 100644 --- a/warden/x/act/keeper/msg_server_vote_for_action.go +++ b/warden/x/act/keeper/msg_server_vote_for_action.go @@ -28,7 +28,7 @@ func (k msgServer) VoteForAction(goCtx context.Context, msg *types.MsgVoteForAct }, nil } - if err := act.AddVote(ctx, msg.Participant, msg.Vote); err != nil { + if err := act.AddVote(ctx, msg.Participant, msg.VoteType); err != nil { return nil, err } diff --git a/warden/x/act/types/v1beta1/action.go b/warden/x/act/types/v1beta1/action.go index e69ff3b19..8a357064c 100644 --- a/warden/x/act/types/v1beta1/action.go +++ b/warden/x/act/types/v1beta1/action.go @@ -1,7 +1,7 @@ package v1beta1 import ( - time "time" + "time" "cosmossdk.io/errors" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -15,11 +15,11 @@ func NewApprover(address string, timestamp time.Time) *Approver { } } -func NewVote(participant string, vote ActionVoteType, timestamp time.Time) *ActionVote { +func NewVote(participant string, voteType ActionVoteType, timestamp time.Time) *ActionVote { return &ActionVote{ Participant: participant, VotedAt: timestamp, - Vote: vote, + VoteType: voteType, } } @@ -72,24 +72,24 @@ func (a *Action) AddApprover(ctx sdk.Context, address string) error { return nil } -func (a *Action) AddVote(ctx sdk.Context, participant string, vote ActionVoteType) error { +func (a *Action) AddVote(ctx sdk.Context, participant string, voteType ActionVoteType) error { if a.Status != ActionStatus_ACTION_STATUS_PENDING { return errors.Wrapf(ErrInvalidActionStatus, "can't add a vote to an action that's not pending") } for _, v := range a.Votes { if v.Participant == participant { - return ErrActionVoteAlreadyExists + return ErrAlreadyParticipatedInVoting } } a.UpdatedAt = ctx.BlockTime() - a.Votes = append(a.Votes, NewVote(participant, vote, a.UpdatedAt)) + a.Votes = append(a.Votes, NewVote(participant, voteType, a.UpdatedAt)) if err := ctx.EventManager().EmitTypedEvent(&EventActionVoted{ Id: a.Id, Participant: participant, - Vote: vote, + VoteType: voteType, }); err != nil { return err } diff --git a/warden/x/act/types/v1beta1/action_vote.pb.go b/warden/x/act/types/v1beta1/action_vote.pb.go index 67522907e..e8c745f1e 100644 --- a/warden/x/act/types/v1beta1/action_vote.pb.go +++ b/warden/x/act/types/v1beta1/action_vote.pb.go @@ -66,7 +66,7 @@ type ActionVote struct { // voted_at is a timestamp specifying when the voter voted on the action. VotedAt time.Time `protobuf:"bytes,2,opt,name=voted_at,json=votedAt,proto3,stdtime" json:"voted_at"` // vote is the type of the vote. - Vote ActionVoteType `protobuf:"varint,3,opt,name=vote,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote,omitempty"` + VoteType ActionVoteType `protobuf:"varint,3,opt,name=vote_type,json=voteType,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote_type,omitempty"` } func (m *ActionVote) Reset() { *m = ActionVote{} } @@ -116,9 +116,9 @@ func (m *ActionVote) GetVotedAt() time.Time { return time.Time{} } -func (m *ActionVote) GetVote() ActionVoteType { +func (m *ActionVote) GetVoteType() ActionVoteType { if m != nil { - return m.Vote + return m.VoteType } return ActionVoteType_VOTE_TYPE_UNSPECIFIED } @@ -133,30 +133,31 @@ func init() { } var fileDescriptor_b33d294255f825be = []byte{ - // 364 bytes of a gzipped FileDescriptorProto + // 369 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x29, 0x4f, 0x2c, 0x4a, 0x49, 0xcd, 0xd3, 0x4f, 0x4c, 0x2e, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0x04, 0xb1, 0x33, 0xf3, 0xf3, 0xe2, 0xcb, 0xf2, 0x4b, 0x52, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x84, 0x20, 0xaa, 0xf4, 0x12, 0x93, 0x4b, 0xf4, 0xa0, 0xaa, 0xa4, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x99, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xbc, 0xa4, 0xd2, 0x34, 0xfd, 0x92, - 0xcc, 0xdc, 0xd4, 0xe2, 0x92, 0xc4, 0xdc, 0x02, 0x88, 0x02, 0xa5, 0x35, 0x8c, 0x5c, 0x5c, 0x8e, + 0xcc, 0xdc, 0xd4, 0xe2, 0x92, 0xc4, 0xdc, 0x02, 0x88, 0x02, 0xa5, 0xad, 0x8c, 0x5c, 0x5c, 0x8e, 0x60, 0x3b, 0xc3, 0xf2, 0x4b, 0x52, 0x85, 0x14, 0xb8, 0xb8, 0x0b, 0x12, 0x8b, 0x4a, 0x32, 0x93, 0x33, 0x0b, 0x12, 0xf3, 0x4a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x90, 0x85, 0x84, 0x5c, 0xb8, 0x38, 0x40, 0x8e, 0x4b, 0x89, 0x4f, 0x2c, 0x91, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd2, 0x83, 0x58, 0xa2, 0x07, 0xb3, 0x44, 0x2f, 0x04, 0x66, 0x89, 0x13, 0xef, 0x89, 0x7b, 0xf2, 0x0c, 0x13, 0xee, 0xcb, 0x33, 0xae, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x88, 0x1d, 0xac, 0xd5, 0xb1, - 0x44, 0xc8, 0x8c, 0x8b, 0x05, 0xc4, 0x94, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x33, 0x52, 0xd2, 0xc3, - 0xf4, 0xa3, 0x1e, 0xc2, 0x55, 0x21, 0x95, 0x05, 0xa9, 0x41, 0x60, 0xf5, 0x5a, 0xd1, 0x5c, 0x7c, - 0xa8, 0xe2, 0x42, 0x92, 0x5c, 0xa2, 0x61, 0xfe, 0x21, 0xae, 0xf1, 0x21, 0x91, 0x01, 0xae, 0xf1, - 0xa1, 0x7e, 0xc1, 0x01, 0xae, 0xce, 0x9e, 0x6e, 0x9e, 0xae, 0x2e, 0x02, 0x0c, 0x42, 0x62, 0x5c, - 0x42, 0x08, 0x29, 0xc7, 0x80, 0x80, 0x20, 0xff, 0x30, 0x57, 0x17, 0x01, 0x46, 0x54, 0xf1, 0x20, - 0x57, 0x2f, 0x57, 0xe7, 0x10, 0x57, 0x17, 0x01, 0x26, 0xa7, 0xb8, 0x13, 0x8f, 0xe4, 0x18, 0x2f, - 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, - 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x72, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, - 0xd5, 0x87, 0x38, 0x55, 0x17, 0xec, 0xd9, 0xe4, 0xfc, 0x1c, 0x28, 0x1f, 0x8d, 0xab, 0x5f, 0x01, - 0x8e, 0xd5, 0x92, 0xca, 0x82, 0xd4, 0x62, 0x58, 0xdc, 0x26, 0xb1, 0x81, 0x15, 0x19, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x83, 0xeb, 0xb2, 0xd4, 0xf8, 0x01, 0x00, 0x00, + 0x44, 0xc8, 0x9e, 0x8b, 0x13, 0xc4, 0x8c, 0x2f, 0xa9, 0x2c, 0x48, 0x95, 0x60, 0x56, 0x60, 0xd4, + 0xe0, 0x33, 0x52, 0xd2, 0xc3, 0xf4, 0xa8, 0x1e, 0xc2, 0x69, 0x21, 0x95, 0x05, 0xa9, 0x41, 0x60, + 0xab, 0x41, 0x2c, 0xad, 0x68, 0x2e, 0x3e, 0x54, 0x39, 0x21, 0x49, 0x2e, 0xd1, 0x30, 0xff, 0x10, + 0xd7, 0xf8, 0x90, 0xc8, 0x00, 0xd7, 0xf8, 0x50, 0xbf, 0xe0, 0x00, 0x57, 0x67, 0x4f, 0x37, 0x4f, + 0x57, 0x17, 0x01, 0x06, 0x21, 0x31, 0x2e, 0x21, 0x84, 0x94, 0x63, 0x40, 0x40, 0x90, 0x7f, 0x98, + 0xab, 0x8b, 0x00, 0x23, 0xaa, 0x78, 0x90, 0xab, 0x97, 0xab, 0x73, 0x88, 0xab, 0x8b, 0x00, 0x93, + 0x53, 0xdc, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, + 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xb9, 0xa4, 0x67, 0x96, + 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x43, 0x9c, 0xab, 0x0b, 0xf6, 0x75, 0x72, 0x7e, + 0x0e, 0x94, 0x8f, 0xc6, 0xd5, 0xaf, 0x00, 0x47, 0x2f, 0xc8, 0x9f, 0xc5, 0xb0, 0x48, 0x4e, 0x62, + 0x03, 0x2b, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x64, 0xe6, 0x0a, 0x01, 0x02, 0x00, + 0x00, } func (m *ActionVote) Marshal() (dAtA []byte, err error) { @@ -179,8 +180,8 @@ func (m *ActionVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Vote != 0 { - i = encodeVarintActionVote(dAtA, i, uint64(m.Vote)) + if m.VoteType != 0 { + i = encodeVarintActionVote(dAtA, i, uint64(m.VoteType)) i-- dAtA[i] = 0x18 } @@ -225,8 +226,8 @@ func (m *ActionVote) Size() (n int) { } l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotedAt) n += 1 + l + sovActionVote(uint64(l)) - if m.Vote != 0 { - n += 1 + sovActionVote(uint64(m.Vote)) + if m.VoteType != 0 { + n += 1 + sovActionVote(uint64(m.VoteType)) } return n } @@ -333,9 +334,9 @@ func (m *ActionVote) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VoteType", wireType) } - m.Vote = 0 + m.VoteType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowActionVote @@ -345,7 +346,7 @@ func (m *ActionVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Vote |= ActionVoteType(b&0x7F) << shift + m.VoteType |= ActionVoteType(b&0x7F) << shift if b < 0x80 { break } diff --git a/warden/x/act/types/v1beta1/errors.go b/warden/x/act/types/v1beta1/errors.go index a7e71bd18..1ecdae71b 100644 --- a/warden/x/act/types/v1beta1/errors.go +++ b/warden/x/act/types/v1beta1/errors.go @@ -8,20 +8,20 @@ import ( // x/act module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") - ErrInvalidActionMsgSigner = sdkerrors.Register(ModuleName, 1102, "expected x/act account as only signer for action message") - ErrInvalidActionStatus = sdkerrors.Register(ModuleName, 1103, "invalid action status") - ErrInvalidActionStatusChange = sdkerrors.Register(ModuleName, 1104, "invalid status change") - ErrApproverExists = sdkerrors.Register(ModuleName, 1105, "approver already exists") - ErrRuleEvaluationFailed = sdkerrors.Register(ModuleName, 1106, "rule evaluation failed") - ErrRuleNotBoolean = sdkerrors.Register(ModuleName, 1107, "rule must evaluate to a boolean") - ErrInvalidRule = sdkerrors.Register(ModuleName, 1108, "rule is invalid") - ErrInvalidActionMsg = sdkerrors.Register(ModuleName, 1109, "invalid action message") - ErrNoActionMsgHandler = sdkerrors.Register(ModuleName, 1110, "no action message handler registered for message type") - ErrNoRuleRegistryHandler = sdkerrors.Register(ModuleName, 1111, "no rule registry handler registered for message type") - ErrInvalidRuleDefinition = sdkerrors.Register(ModuleName, 1112, "invalid rule definition") - ErrInvalidRevoker = sdkerrors.Register(ModuleName, 1113, "this account can't revoke this action") - ErrInvalidUpdateRuleAccount = sdkerrors.Register(ModuleName, 1114, "this account can't update this rule") - ErrActionVoteAlreadyExists = sdkerrors.Register(ModuleName, 1115, "vote already exists") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") + ErrInvalidActionMsgSigner = sdkerrors.Register(ModuleName, 1102, "expected x/act account as only signer for action message") + ErrInvalidActionStatus = sdkerrors.Register(ModuleName, 1103, "invalid action status") + ErrInvalidActionStatusChange = sdkerrors.Register(ModuleName, 1104, "invalid status change") + ErrApproverExists = sdkerrors.Register(ModuleName, 1105, "approver already exists") + ErrRuleEvaluationFailed = sdkerrors.Register(ModuleName, 1106, "rule evaluation failed") + ErrRuleNotBoolean = sdkerrors.Register(ModuleName, 1107, "rule must evaluate to a boolean") + ErrInvalidRule = sdkerrors.Register(ModuleName, 1108, "rule is invalid") + ErrInvalidActionMsg = sdkerrors.Register(ModuleName, 1109, "invalid action message") + ErrNoActionMsgHandler = sdkerrors.Register(ModuleName, 1110, "no action message handler registered for message type") + ErrNoRuleRegistryHandler = sdkerrors.Register(ModuleName, 1111, "no rule registry handler registered for message type") + ErrInvalidRuleDefinition = sdkerrors.Register(ModuleName, 1112, "invalid rule definition") + ErrInvalidRevoker = sdkerrors.Register(ModuleName, 1113, "this account can't revoke this action") + ErrInvalidUpdateRuleAccount = sdkerrors.Register(ModuleName, 1114, "this account can't update this rule") + ErrAlreadyParticipatedInVoting = sdkerrors.Register(ModuleName, 1115, "account already participated in voting") ) diff --git a/warden/x/act/types/v1beta1/events.pb.go b/warden/x/act/types/v1beta1/events.pb.go index c529653b1..dab268a4f 100644 --- a/warden/x/act/types/v1beta1/events.pb.go +++ b/warden/x/act/types/v1beta1/events.pb.go @@ -240,7 +240,7 @@ type EventActionVoted struct { // address of the account that participated in voting Participant string `protobuf:"bytes,2,opt,name=participant,proto3" json:"participant,omitempty"` // type of the vote - Vote ActionVoteType `protobuf:"varint,3,opt,name=vote,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote,omitempty"` + VoteType ActionVoteType `protobuf:"varint,3,opt,name=vote_type,json=voteType,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote_type,omitempty"` } func (m *EventActionVoted) Reset() { *m = EventActionVoted{} } @@ -290,9 +290,9 @@ func (m *EventActionVoted) GetParticipant() string { return "" } -func (m *EventActionVoted) GetVote() ActionVoteType { +func (m *EventActionVoted) GetVoteType() ActionVoteType { if m != nil { - return m.Vote + return m.VoteType } return ActionVoteType_VOTE_TYPE_UNSPECIFIED } @@ -421,32 +421,32 @@ func init() { func init() { proto.RegisterFile("warden/act/v1beta1/events.proto", fileDescriptor_912b51dfb11e99b6) } var fileDescriptor_912b51dfb11e99b6 = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x4e, 0xdb, 0x40, - 0x1c, 0xc6, 0x73, 0x49, 0xd4, 0x36, 0x57, 0xc9, 0x69, 0x3d, 0x54, 0x56, 0x06, 0xd7, 0x75, 0x3b, - 0x64, 0xa9, 0xad, 0xa4, 0x52, 0x97, 0xaa, 0x6a, 0x43, 0x60, 0x60, 0x43, 0x0e, 0x30, 0x30, 0x10, - 0x5d, 0xec, 0x53, 0x62, 0x29, 0xdc, 0x9d, 0xce, 0x7f, 0x3b, 0x44, 0xe2, 0x21, 0x78, 0x18, 0x1e, - 0x82, 0x31, 0x23, 0x23, 0x4a, 0x5e, 0x04, 0xe5, 0xce, 0x86, 0x08, 0x63, 0x09, 0x36, 0x7f, 0xbe, - 0xef, 0xf7, 0x7d, 0xa7, 0xff, 0xfd, 0xf1, 0xd7, 0x05, 0x91, 0x11, 0x65, 0x3e, 0x09, 0xc1, 0xcf, - 0x7a, 0x13, 0x0a, 0xa4, 0xe7, 0xd3, 0x8c, 0x32, 0x48, 0x3c, 0x21, 0x39, 0x70, 0xd3, 0xd4, 0x06, - 0x8f, 0x84, 0xe0, 0xe5, 0x86, 0xce, 0x4b, 0x10, 0x09, 0x21, 0xe6, 0x4c, 0x43, 0x9d, 0x1f, 0x95, - 0x86, 0x71, 0xc6, 0x81, 0x6a, 0x97, 0xfb, 0x07, 0xb7, 0x0f, 0xb6, 0x55, 0x43, 0x49, 0x09, 0xd0, - 0x20, 0x9d, 0x53, 0xd3, 0xc0, 0xf5, 0x38, 0xb2, 0x90, 0x83, 0xba, 0xcd, 0xa0, 0x1e, 0x47, 0xa6, - 0x85, 0xdf, 0x87, 0xdb, 0x53, 0x2e, 0xad, 0xba, 0x83, 0xba, 0xad, 0xa0, 0x90, 0xee, 0x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, 0x7f, 0xaa, 0x6d, 0x0b, 0xf9, 0x3c, 0xd7, 0xcf, 0xa4, 0x7f, - 0xa9, 0xd6, 0x14, 0x96, 0x82, 0x26, 0xc5, 0xb2, 0x4e, 0xde, 0x29, 0xd3, 0xaf, 0x87, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x67, 0x98, 0x13, 0xcb, 0x1f, 0x03, 0x00, 0x00, + // 398 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xbf, 0x6e, 0xda, 0x40, + 0x18, 0xe7, 0xa0, 0x6a, 0xe1, 0x2a, 0x99, 0xd6, 0x43, 0x65, 0x31, 0xb8, 0xae, 0xdb, 0x81, 0xa5, + 0xb6, 0xa0, 0x63, 0x55, 0x51, 0x4a, 0x3b, 0x74, 0xab, 0x4c, 0x93, 0x21, 0x43, 0xd0, 0x61, 0x9f, + 0xc0, 0x12, 0xb9, 0x3b, 0x9d, 0x3f, 0x9b, 0xf0, 0x00, 0xd9, 0xf3, 0x30, 0x79, 0x88, 0x8c, 0x8c, + 0x19, 0x23, 0x78, 0x91, 0xc8, 0x77, 0x76, 0x82, 0xe2, 0x58, 0x4a, 0xb6, 0xfb, 0xdd, 0xfd, 0xfe, + 0x9c, 0x7e, 0xdf, 0x87, 0x3f, 0xae, 0x89, 0x8c, 0x28, 0xf3, 0x49, 0x08, 0x7e, 0x36, 0x98, 0x53, + 0x20, 0x03, 0x9f, 0x66, 0x94, 0x41, 0xe2, 0x09, 0xc9, 0x81, 0x9b, 0xa6, 0x26, 0x78, 0x24, 0x04, + 0xaf, 0x20, 0xf4, 0x9e, 0x12, 0x91, 0x10, 0x62, 0xce, 0xb4, 0xa8, 0xf7, 0xa5, 0x96, 0x30, 0xcb, + 0x38, 0x50, 0xcd, 0x72, 0xbf, 0xe3, 0xee, 0x9f, 0x3c, 0x6a, 0x22, 0x29, 0x01, 0x1a, 0xa4, 0x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ad, 0xef, 0xd7, 0xe9, 0xf5, 0xce, 0x46, 0xdb, 0x9d, 0x8d, + 0x6e, 0x77, 0x36, 0xba, 0xdc, 0xdb, 0x8d, 0xed, 0xde, 0x6e, 0xdc, 0xec, 0xed, 0xc6, 0xc9, 0xef, + 0x45, 0x0c, 0xcb, 0x74, 0xee, 0x85, 0xfc, 0xcc, 0xd7, 0xa9, 0x5f, 0xd5, 0xde, 0x85, 0x7c, 0x55, + 0xe0, 0x47, 0xd0, 0x3f, 0x57, 0x0b, 0x9b, 0xd7, 0x9c, 0x94, 0x6b, 0x3b, 0x7f, 0xad, 0x48, 0xdf, + 0xee, 0x02, 0x00, 0x00, 0xff, 0xff, 0x58, 0x29, 0xa6, 0x90, 0x29, 0x03, 0x00, 0x00, } func (m *EventCreateRule) Marshal() (dAtA []byte, err error) { @@ -602,8 +602,8 @@ func (m *EventActionVoted) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Vote != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Vote)) + if m.VoteType != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.VoteType)) i-- dAtA[i] = 0x18 } @@ -772,8 +772,8 @@ func (m *EventActionVoted) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } - if m.Vote != 0 { - n += 1 + sovEvents(uint64(m.Vote)) + if m.VoteType != 0 { + n += 1 + sovEvents(uint64(m.VoteType)) } return n } @@ -1268,9 +1268,9 @@ func (m *EventActionVoted) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VoteType", wireType) } - m.Vote = 0 + m.VoteType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -1280,7 +1280,7 @@ func (m *EventActionVoted) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Vote |= ActionVoteType(b&0x7F) << shift + m.VoteType |= ActionVoteType(b&0x7F) << shift if b < 0x80 { break } diff --git a/warden/x/act/types/v1beta1/tx.pb.go b/warden/x/act/types/v1beta1/tx.pb.go index 41af8c855..5d4f1495a 100644 --- a/warden/x/act/types/v1beta1/tx.pb.go +++ b/warden/x/act/types/v1beta1/tx.pb.go @@ -724,7 +724,7 @@ func (m *MsgCheckActionResponse) GetStatus() string { type MsgVoteForAction struct { Participant string `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"` ActionId uint64 `protobuf:"varint,2,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - Vote ActionVoteType `protobuf:"varint,3,opt,name=vote,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote,omitempty"` + VoteType ActionVoteType `protobuf:"varint,3,opt,name=vote_type,json=voteType,proto3,enum=warden.act.v1beta1.ActionVoteType" json:"vote_type,omitempty"` } func (m *MsgVoteForAction) Reset() { *m = MsgVoteForAction{} } @@ -774,9 +774,9 @@ func (m *MsgVoteForAction) GetActionId() uint64 { return 0 } -func (m *MsgVoteForAction) GetVote() ActionVoteType { +func (m *MsgVoteForAction) GetVoteType() ActionVoteType { if m != nil { - return m.Vote + return m.VoteType } return ActionVoteType_VOTE_TYPE_UNSPECIFIED } @@ -847,60 +847,60 @@ func init() { func init() { proto.RegisterFile("warden/act/v1beta1/tx.proto", fileDescriptor_f059980976488200) } var fileDescriptor_f059980976488200 = []byte{ - // 842 bytes of a gzipped FileDescriptorProto + // 848 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0x8f, 0xb3, 0x21, 0x4b, 0xde, 0xa6, 0x4b, 0x31, 0x69, 0x37, 0x75, 0x91, 0x1b, 0xcc, 0xaa, - 0x0a, 0x81, 0xda, 0x6c, 0x90, 0x7a, 0x58, 0x89, 0x43, 0x16, 0x84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xb1, 0xc4, 0xd3, 0xbc, 0x0e, 0xfb, 0x4b, 0x47, 0x0e, 0xa6, 0x31, + 0x89, 0x28, 0x36, 0x7f, 0x53, 0xa0, 0x39, 0xa4, 0xfe, 0x57, 0xf8, 0xc9, 0x80, 0xa7, 0xac, 0xb5, + 0x61, 0xc7, 0x4d, 0x30, 0x62, 0x24, 0x11, 0x19, 0x39, 0x99, 0xa8, 0x59, 0xb0, 0x13, 0x62, 0x4a, + 0x91, 0x8f, 0x25, 0xed, 0x96, 0x25, 0xaa, 0x6e, 0x65, 0x55, 0xb7, 0x06, 0xd1, 0xdc, 0xc9, 0x40, + 0x5a, 0x1f, 0xae, 0xca, 0x32, 0xb2, 0x20, 0xc4, 0x64, 0xca, 0x46, 0x13, 0x1c, 0xf8, 0x13, 0xd6, + 0xde, 0xea, 0x28, 0xdd, 0x86, 0xf3, 0xa6, 0x50, 0xde, 0x11, 0xba, 0x2f, 0xb8, 0xea, 0xa8, 0x99, + 0xa6, 0x96, 0x45, 0x34, 0x6f, 0x41, 0xab, 0xc8, 0x2d, 0x23, 0xad, 0xed, 0xc1, 0x66, 0xe0, 0x71, + 0x7a, 0x0d, 0x67, 0x33, 0xf0, 0xcc, 0xfb, 0x70, 0x65, 0x48, 0xfd, 0x41, 0x1c, 0x27, 0x64, 0x86, + 0x6b, 0xf3, 0xb8, 0x01, 0xaa, 0xe4, 0x15, 0x78, 0x3c, 0x93, 0x86, 0x73, 0x49, 0x1c, 0x7c, 0xe9, + 0x2d, 0x11, 0xe8, 0x43, 0x7b, 0xd9, 0x71, 0x4e, 0xe2, 0x1a, 0x6c, 0x53, 0x86, 0xd8, 0x94, 0x4a, + 0xff, 0x52, 0x32, 0x27, 0x00, 0x82, 0xb4, 0x33, 0x3d, 0xc1, 0x6b, 0x68, 0x68, 0xd0, 0x88, 0x50, + 0x28, 0x6a, 0xa9, 0x3a, 0xfc, 0x5b, 0x33, 0x00, 0x3c, 0xfc, 0x28, 0x88, 0x82, 0x34, 0x12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0e, 0x91, 0x3b, 0x76, 0xe1, 0x72, 0x79, 0x93, 0x1c, 0x54, 0x98, 0x96, 0x50, + 0xfa, 0xfb, 0x2f, 0x83, 0xca, 0x83, 0x7c, 0x07, 0xbb, 0xc5, 0x41, 0x34, 0x2b, 0x8c, 0x0b, 0x18, + 0xbd, 0x57, 0x8f, 0xc9, 0xdd, 0x7f, 0x03, 0x3b, 0xd9, 0x02, 0x32, 0xaa, 0x13, 0x4f, 0xf5, 0xfa, + 0xad, 0xf5, 0xfa, 0xdc, 0xe5, 0x03, 0x80, 0xc2, 0x0e, 0x79, 0x7b, 0x6d, 0xab, 0xb8, 0xe3, 0x77, + 0x6b, 0x21, 0xb9, 0xef, 0x87, 0xd0, 0x2c, 0x6d, 0x82, 0xaa, 0x69, 0x29, 0x82, 0x2a, 0xa7, 0x65, + 0xd5, 0xdd, 0x4f, 0x9b, 0x5a, 0xbe, 0x6e, 0x55, 0x4d, 0x2d, 0xa1, 0x2a, 0x9b, 0xba, 0xf2, 0x52, + 0xe8, 0xaf, 0xfd, 0x98, 0x3e, 0xd3, 0xc7, 0xdf, 0x3f, 0x3b, 0x33, 0x94, 0xe7, 0x67, 0x86, 0xf2, + 0xdf, 0x99, 0xa1, 0xfc, 0x7a, 0x6e, 0x6c, 0x3c, 0x3f, 0x37, 0x36, 0xfe, 0x39, 0x37, 0x36, 0x1e, + 0x7c, 0xe6, 0x07, 0x6c, 0x32, 0x1d, 0x5b, 0x2e, 0x09, 0x6d, 0xe1, 0xf8, 0x36, 0x7f, 0x3a, 0x5d, + 0x72, 0x22, 0xe5, 0x25, 0x51, 0xbe, 0xe7, 0xe9, 0xa5, 0xa6, 0xd9, 0x6f, 0x93, 0xf1, 0x36, 0x07, + 0x7d, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xe6, 0xa0, 0x24, 0x82, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1744,8 +1744,8 @@ func (m *MsgVoteForAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Vote != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Vote)) + if m.VoteType != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.VoteType)) i-- dAtA[i] = 0x18 } @@ -2023,8 +2023,8 @@ func (m *MsgVoteForAction) Size() (n int) { if m.ActionId != 0 { n += 1 + sovTx(uint64(m.ActionId)) } - if m.Vote != 0 { - n += 1 + sovTx(uint64(m.Vote)) + if m.VoteType != 0 { + n += 1 + sovTx(uint64(m.VoteType)) } return n } @@ -3448,9 +3448,9 @@ func (m *MsgVoteForAction) Unmarshal(dAtA []byte) error { } case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VoteType", wireType) } - m.Vote = 0 + m.VoteType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3460,7 +3460,7 @@ func (m *MsgVoteForAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Vote |= ActionVoteType(b&0x7F) << shift + m.VoteType |= ActionVoteType(b&0x7F) << shift if b < 0x80 { break } diff --git a/warden/x/warden/types/v1beta3/keychain.pb.go b/warden/x/warden/types/v1beta3/keychain.pb.go index b31944577..3547931ce 100644 --- a/warden/x/warden/types/v1beta3/keychain.pb.go +++ b/warden/x/warden/types/v1beta3/keychain.pb.go @@ -1185,4 +1185,4 @@ var ( ErrInvalidLengthKeychain = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowKeychain = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupKeychain = fmt.Errorf("proto: unexpected end of group") -) \ No newline at end of file +) diff --git a/warden/x/warden/types/v1beta3/tx.pb.go b/warden/x/warden/types/v1beta3/tx.pb.go index c31d2c68a..6ba50c257 100644 --- a/warden/x/warden/types/v1beta3/tx.pb.go +++ b/warden/x/warden/types/v1beta3/tx.pb.go @@ -512,23 +512,23 @@ func (m *MsgNewKeychain) GetKeychainFees() KeychainFees { return KeychainFees{} } -func (m *MsgNewKeychain) GetUrl() string { +func (m *MsgNewKeychain) GetDescription() string { if m != nil { - return m.Url + return m.Description } return "" } -func (m *MsgNewKeychain) GetKeybaseId() string { +func (m *MsgNewKeychain) GetUrl() string { if m != nil { - return m.KeybaseId + return m.Url } return "" } -func (m *MsgNewKeychain) GetDescription() string { +func (m *MsgNewKeychain) GetKeybaseId() string { if m != nil { - return m.Description + return m.KeybaseId } return "" } @@ -856,23 +856,23 @@ func (m *MsgUpdateKeychain) GetKeychainFees() KeychainFees { return KeychainFees{} } -func (m *MsgUpdateKeychain) GetUrl() string { +func (m *MsgUpdateKeychain) GetDescription() string { if m != nil { - return m.Url + return m.Description } return "" } -func (m *MsgUpdateKeychain) GetKeybaseId() string { +func (m *MsgUpdateKeychain) GetUrl() string { if m != nil { - return m.KeybaseId + return m.Url } return "" } -func (m *MsgUpdateKeychain) GetDescription() string { +func (m *MsgUpdateKeychain) GetKeybaseId() string { if m != nil { - return m.Description + return m.KeybaseId } return "" } @@ -2853,10 +2853,10 @@ func (m *MsgNewKeychain) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x2a } @@ -3087,10 +3087,10 @@ func (m *MsgUpdateKeychain) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x32 } @@ -3982,18 +3982,6 @@ func (m *MsgNewKeychain) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Url) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.KeybaseId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } return n } @@ -4103,18 +4091,6 @@ func (m *MsgUpdateKeychain) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Url) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.KeybaseId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } return n } From 31d05daf1ebca1be344198767bd668c2aa5da498 Mon Sep 17 00:00:00 2001 From: Archie Date: Thu, 5 Sep 2024 15:16:56 +0300 Subject: [PATCH 3/8] Update warden/x/act/keeper/actions.go Co-authored-by: Max Nabokov --- warden/x/act/keeper/actions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warden/x/act/keeper/actions.go b/warden/x/act/keeper/actions.go index 5dca24a2a..d0489b231 100644 --- a/warden/x/act/keeper/actions.go +++ b/warden/x/act/keeper/actions.go @@ -55,7 +55,7 @@ func (votes ActionRejectedVotesEnv) Get(name string) (object.Object, bool) { return object.FALSE, true } -// TryExecuteVotedAction checks if the action's intent is satisfied and stores the +// TryExecuteVotedAction checks if the action's expression is satisfied and stores the // result in the database. func (k Keeper) TryExecuteVotedAction(ctx context.Context, act *types.Action) error { sdkCtx := sdk.UnwrapSDKContext(ctx) From b46916f336c2cd1d10ed5290ddeace33e5230d7f Mon Sep 17 00:00:00 2001 From: Artur Abliazimov Date: Fri, 6 Sep 2024 14:43:22 +0300 Subject: [PATCH 4/8] Add TryRejectVotedAction --- warden/x/act/keeper/actions.go | 23 +++++++++---------- .../act/keeper/msg_server_vote_for_action.go | 10 ++++++-- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/warden/x/act/keeper/actions.go b/warden/x/act/keeper/actions.go index d0489b231..df9a83b8e 100644 --- a/warden/x/act/keeper/actions.go +++ b/warden/x/act/keeper/actions.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/warden-protocol/wardenprotocol/shield" "github.com/warden-protocol/wardenprotocol/shield/ast" "github.com/warden-protocol/wardenprotocol/shield/object" "github.com/warden-protocol/wardenprotocol/warden/x/act/cosmoshield" @@ -58,17 +57,8 @@ func (votes ActionRejectedVotesEnv) Get(name string) (object.Object, bool) { // TryExecuteVotedAction checks if the action's expression is satisfied and stores the // result in the database. func (k Keeper) TryExecuteVotedAction(ctx context.Context, act *types.Action) error { - sdkCtx := sdk.UnwrapSDKContext(ctx) + approved, err := act.Rule.Eval(ctx, ActionApprovedVotesEnv(act.Votes)) - evaluateVotes := func(env shield.Environment) (bool, error) { - ready, err := act.Rule.Eval(ctx, env) - if err != nil { - return false, fmt.Errorf("failed to evaluate votes: %w", err) - } - return ready, nil - } - - approved, err := evaluateVotes(ActionApprovedVotesEnv(act.Votes)) if err != nil { return err } @@ -77,7 +67,16 @@ func (k Keeper) TryExecuteVotedAction(ctx context.Context, act *types.Action) er return k.executeAction(ctx, act) } - rejected, err := evaluateVotes(ActionRejectedVotesEnv(act.Votes)) + return nil +} + +// TryRejectVotedAction checks if the action's reject expression is satisfied and updates its +// status revoked. +func (k Keeper) TryRejectVotedAction(ctx context.Context, act *types.Action) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + rejected, err := act.Rule.Eval(ctx, ActionRejectedVotesEnv(act.Votes)) + if err != nil { return err } diff --git a/warden/x/act/keeper/msg_server_vote_for_action.go b/warden/x/act/keeper/msg_server_vote_for_action.go index 6c6fe0627..17a162996 100644 --- a/warden/x/act/keeper/msg_server_vote_for_action.go +++ b/warden/x/act/keeper/msg_server_vote_for_action.go @@ -36,8 +36,14 @@ func (k msgServer) VoteForAction(goCtx context.Context, msg *types.MsgVoteForAct return nil, err } - if err := k.TryExecuteVotedAction(ctx, &act); err != nil { - return nil, err + if msg.VoteType == types.ActionVoteType_VOTE_TYPE_APPROVED { + if err := k.TryExecuteVotedAction(ctx, &act); err != nil { + return nil, err + } + } else if msg.VoteType == types.ActionVoteType_VOTE_TYPE_REJECTED { + if err := k.TryRejectVotedAction(ctx, &act); err != nil { + return nil, err + } } return &types.MsgVoteForActionResponse{Status: act.Status.String()}, nil From a4e861f34012b9776d80c27e12942bfdd09aab7e Mon Sep 17 00:00:00 2001 From: Artur Abliazimov Date: Mon, 9 Sep 2024 14:19:47 +0300 Subject: [PATCH 5/8] Add or update vote logic --- warden/x/act/keeper/actions.go | 2 +- .../act/keeper/msg_server_vote_for_action.go | 2 +- warden/x/act/types/v1beta1/action.go | 15 ++++++--- warden/x/act/types/v1beta1/errors.go | 31 +++++++++---------- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/warden/x/act/keeper/actions.go b/warden/x/act/keeper/actions.go index df9a83b8e..770644c40 100644 --- a/warden/x/act/keeper/actions.go +++ b/warden/x/act/keeper/actions.go @@ -239,7 +239,7 @@ func (k Keeper) AddAction(ctx context.Context, creator string, msg sdk.Msg, time // add initial approver sdkCtx := sdk.UnwrapSDKContext(ctx) - if err := act.AddApprover(sdkCtx, creator); err != nil { + if err := act.AddOrUpdateVote(sdkCtx, creator, types.ActionVoteType_VOTE_TYPE_APPROVED); err != nil { return nil, err } diff --git a/warden/x/act/keeper/msg_server_vote_for_action.go b/warden/x/act/keeper/msg_server_vote_for_action.go index 17a162996..a99ef2eb4 100644 --- a/warden/x/act/keeper/msg_server_vote_for_action.go +++ b/warden/x/act/keeper/msg_server_vote_for_action.go @@ -28,7 +28,7 @@ func (k msgServer) VoteForAction(goCtx context.Context, msg *types.MsgVoteForAct }, nil } - if err := act.AddVote(ctx, msg.Participant, msg.VoteType); err != nil { + if err := act.AddOrUpdateVote(ctx, msg.Participant, msg.VoteType); err != nil { return nil, err } diff --git a/warden/x/act/types/v1beta1/action.go b/warden/x/act/types/v1beta1/action.go index 8a357064c..afe0600b6 100644 --- a/warden/x/act/types/v1beta1/action.go +++ b/warden/x/act/types/v1beta1/action.go @@ -72,19 +72,26 @@ func (a *Action) AddApprover(ctx sdk.Context, address string) error { return nil } -func (a *Action) AddVote(ctx sdk.Context, participant string, voteType ActionVoteType) error { +func (a *Action) AddOrUpdateVote(ctx sdk.Context, participant string, voteType ActionVoteType) error { if a.Status != ActionStatus_ACTION_STATUS_PENDING { return errors.Wrapf(ErrInvalidActionStatus, "can't add a vote to an action that's not pending") } - for _, v := range a.Votes { + updated := false + + for i, v := range a.Votes { if v.Participant == participant { - return ErrAlreadyParticipatedInVoting + a.Votes[i].VoteType = voteType + updated = true + break } } + if !updated { + a.Votes = append(a.Votes, NewVote(participant, voteType, ctx.BlockTime())) + } + a.UpdatedAt = ctx.BlockTime() - a.Votes = append(a.Votes, NewVote(participant, voteType, a.UpdatedAt)) if err := ctx.EventManager().EmitTypedEvent(&EventActionVoted{ Id: a.Id, diff --git a/warden/x/act/types/v1beta1/errors.go b/warden/x/act/types/v1beta1/errors.go index 1ecdae71b..c7fa0615d 100644 --- a/warden/x/act/types/v1beta1/errors.go +++ b/warden/x/act/types/v1beta1/errors.go @@ -8,20 +8,19 @@ import ( // x/act module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") - ErrInvalidActionMsgSigner = sdkerrors.Register(ModuleName, 1102, "expected x/act account as only signer for action message") - ErrInvalidActionStatus = sdkerrors.Register(ModuleName, 1103, "invalid action status") - ErrInvalidActionStatusChange = sdkerrors.Register(ModuleName, 1104, "invalid status change") - ErrApproverExists = sdkerrors.Register(ModuleName, 1105, "approver already exists") - ErrRuleEvaluationFailed = sdkerrors.Register(ModuleName, 1106, "rule evaluation failed") - ErrRuleNotBoolean = sdkerrors.Register(ModuleName, 1107, "rule must evaluate to a boolean") - ErrInvalidRule = sdkerrors.Register(ModuleName, 1108, "rule is invalid") - ErrInvalidActionMsg = sdkerrors.Register(ModuleName, 1109, "invalid action message") - ErrNoActionMsgHandler = sdkerrors.Register(ModuleName, 1110, "no action message handler registered for message type") - ErrNoRuleRegistryHandler = sdkerrors.Register(ModuleName, 1111, "no rule registry handler registered for message type") - ErrInvalidRuleDefinition = sdkerrors.Register(ModuleName, 1112, "invalid rule definition") - ErrInvalidRevoker = sdkerrors.Register(ModuleName, 1113, "this account can't revoke this action") - ErrInvalidUpdateRuleAccount = sdkerrors.Register(ModuleName, 1114, "this account can't update this rule") - ErrAlreadyParticipatedInVoting = sdkerrors.Register(ModuleName, 1115, "account already participated in voting") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") + ErrInvalidActionMsgSigner = sdkerrors.Register(ModuleName, 1102, "expected x/act account as only signer for action message") + ErrInvalidActionStatus = sdkerrors.Register(ModuleName, 1103, "invalid action status") + ErrInvalidActionStatusChange = sdkerrors.Register(ModuleName, 1104, "invalid status change") + ErrApproverExists = sdkerrors.Register(ModuleName, 1105, "approver already exists") + ErrRuleEvaluationFailed = sdkerrors.Register(ModuleName, 1106, "rule evaluation failed") + ErrRuleNotBoolean = sdkerrors.Register(ModuleName, 1107, "rule must evaluate to a boolean") + ErrInvalidRule = sdkerrors.Register(ModuleName, 1108, "rule is invalid") + ErrInvalidActionMsg = sdkerrors.Register(ModuleName, 1109, "invalid action message") + ErrNoActionMsgHandler = sdkerrors.Register(ModuleName, 1110, "no action message handler registered for message type") + ErrNoRuleRegistryHandler = sdkerrors.Register(ModuleName, 1111, "no rule registry handler registered for message type") + ErrInvalidRuleDefinition = sdkerrors.Register(ModuleName, 1112, "invalid rule definition") + ErrInvalidRevoker = sdkerrors.Register(ModuleName, 1113, "this account can't revoke this action") + ErrInvalidUpdateRuleAccount = sdkerrors.Register(ModuleName, 1114, "this account can't update this rule") ) From 716a3c027417982b91e6cd5789d9f66611e8145b Mon Sep 17 00:00:00 2001 From: Archie Date: Mon, 9 Sep 2024 15:46:59 +0300 Subject: [PATCH 6/8] Update warden/x/act/types/v1beta1/action.go Co-authored-by: Antonio Pitasi --- warden/x/act/types/v1beta1/action.go | 1 + 1 file changed, 1 insertion(+) diff --git a/warden/x/act/types/v1beta1/action.go b/warden/x/act/types/v1beta1/action.go index afe0600b6..09d3f2f8b 100644 --- a/warden/x/act/types/v1beta1/action.go +++ b/warden/x/act/types/v1beta1/action.go @@ -82,6 +82,7 @@ func (a *Action) AddOrUpdateVote(ctx sdk.Context, participant string, voteType A for i, v := range a.Votes { if v.Participant == participant { a.Votes[i].VoteType = voteType + a.Votes[i].VotedAt = ctx.BlockTime() updated = true break } From bccb869d114c5f92c4f8ed25c5ede69a71c2fc85 Mon Sep 17 00:00:00 2001 From: Archie Date: Mon, 9 Sep 2024 18:43:10 +0300 Subject: [PATCH 7/8] Update warden/x/act/keeper/msg_server_vote_for_action.go Co-authored-by: Antonio Pitasi --- warden/x/act/keeper/msg_server_vote_for_action.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/warden/x/act/keeper/msg_server_vote_for_action.go b/warden/x/act/keeper/msg_server_vote_for_action.go index a99ef2eb4..30a7893b4 100644 --- a/warden/x/act/keeper/msg_server_vote_for_action.go +++ b/warden/x/act/keeper/msg_server_vote_for_action.go @@ -44,6 +44,8 @@ func (k msgServer) VoteForAction(goCtx context.Context, msg *types.MsgVoteForAct if err := k.TryRejectVotedAction(ctx, &act); err != nil { return nil, err } + } else { + return nil, fmt.Errorf("unhandled VoteType value: %v", msg.VoteType) } return &types.MsgVoteForActionResponse{Status: act.Status.String()}, nil From 5fd3439f1b585fe8f17141f8119e056b9f59706a Mon Sep 17 00:00:00 2001 From: Aleksandr Tretiakov Date: Mon, 9 Sep 2024 19:39:22 +0300 Subject: [PATCH 8/8] Missing import --- warden/x/act/keeper/msg_server_vote_for_action.go | 1 + 1 file changed, 1 insertion(+) diff --git a/warden/x/act/keeper/msg_server_vote_for_action.go b/warden/x/act/keeper/msg_server_vote_for_action.go index 30a7893b4..c20f30822 100644 --- a/warden/x/act/keeper/msg_server_vote_for_action.go +++ b/warden/x/act/keeper/msg_server_vote_for_action.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" types "github.com/warden-protocol/wardenprotocol/warden/x/act/types/v1beta1"