From dd1464b9178c8ea611649e5927b60b8c6a963d8c Mon Sep 17 00:00:00 2001 From: Alexander Kirii Date: Thu, 19 Dec 2024 10:52:29 +0500 Subject: [PATCH] Add vote meta info for vote validation --- go.mod | 1 - internal/vote/dto.go | 6 + internal/vote/server.go | 6 + internal/vote/service.go | 17 ++ protocol/storagepb/base.pb.go | 2 +- protocol/storagepb/dao.pb.go | 2 +- protocol/storagepb/delegate.pb.go | 2 +- protocol/storagepb/ens.pb.go | 2 +- protocol/storagepb/proposal.pb.go | 2 +- protocol/storagepb/stats.pb.go | 2 +- protocol/storagepb/vote.pb.go | 320 ++++++++++++++++++------------ protocol/storagepb/vote.proto | 6 + 12 files changed, 237 insertions(+), 131 deletions(-) diff --git a/go.mod b/go.mod index ce114d6..4f8cf09 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,6 @@ require ( ) require ( - cloud.google.com/go/compute/metadata v0.5.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/internal/vote/dto.go b/internal/vote/dto.go index 89db59a..92943b7 100644 --- a/internal/vote/dto.go +++ b/internal/vote/dto.go @@ -12,6 +12,12 @@ type ValidateResponse struct { VotingPower float64 ValidationError *ValidationError + VoteStatus VoteStatus +} + +type VoteStatus struct { + Voted bool + Choice json.RawMessage } type ValidationError struct { diff --git a/internal/vote/server.go b/internal/vote/server.go index 9dde24d..a55a24d 100644 --- a/internal/vote/server.go +++ b/internal/vote/server.go @@ -111,6 +111,12 @@ func (s *Server) Validate(ctx context.Context, req *storagepb.ValidateRequest) ( Ok: validateResp.OK, VotingPower: validateResp.VotingPower, ValidationError: validationError, + VoteStatus: &storagepb.VoteStatus{ + Voted: validateResp.VoteStatus.Voted, + Choice: &protoany.Any{ + Value: validateResp.VoteStatus.Choice, + }, + }, }, nil } diff --git a/internal/vote/service.go b/internal/vote/service.go index e3a84ac..6744969 100644 --- a/internal/vote/service.go +++ b/internal/vote/service.go @@ -126,10 +126,27 @@ func (s *Service) Validate(ctx context.Context, req ValidateRequest) (ValidateRe } } + voted, err := s.repo.GetByFilters([]Filter{ + VoterFilter{Voter: req.Voter}, + ProposalIDsFilter{ProposalIDs: []string{req.Proposal}}, + }, 1, 0, "") + if err != nil { + return ValidateResponse{}, fmt.Errorf("get by filters: %w", err) + } + + var votedStatus VoteStatus + if len(voted.Votes) > 0 { + votedStatus = VoteStatus{ + Voted: true, + Choice: voted.Votes[0].Choice, + } + } + return ValidateResponse{ OK: resp.GetOk(), VotingPower: resp.GetVotingPower(), ValidationError: validationError, + VoteStatus: votedStatus, }, nil } diff --git a/protocol/storagepb/base.pb.go b/protocol/storagepb/base.pb.go index 72bc998..f8be4d2 100644 --- a/protocol/storagepb/base.pb.go +++ b/protocol/storagepb/base.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v5.28.3 // source: storagepb/base.proto diff --git a/protocol/storagepb/dao.pb.go b/protocol/storagepb/dao.pb.go index 80feb10..07c6164 100644 --- a/protocol/storagepb/dao.pb.go +++ b/protocol/storagepb/dao.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v5.28.3 // source: storagepb/dao.proto diff --git a/protocol/storagepb/delegate.pb.go b/protocol/storagepb/delegate.pb.go index b91be98..b53d086 100644 --- a/protocol/storagepb/delegate.pb.go +++ b/protocol/storagepb/delegate.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v5.28.3 // source: storagepb/delegate.proto diff --git a/protocol/storagepb/ens.pb.go b/protocol/storagepb/ens.pb.go index 0d998a4..f2e96ec 100644 --- a/protocol/storagepb/ens.pb.go +++ b/protocol/storagepb/ens.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v5.28.3 // source: storagepb/ens.proto diff --git a/protocol/storagepb/proposal.pb.go b/protocol/storagepb/proposal.pb.go index 2bc33cc..a6914c5 100644 --- a/protocol/storagepb/proposal.pb.go +++ b/protocol/storagepb/proposal.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v5.28.3 // source: storagepb/proposal.proto diff --git a/protocol/storagepb/stats.pb.go b/protocol/storagepb/stats.pb.go index 47f0e11..4e36e02 100644 --- a/protocol/storagepb/stats.pb.go +++ b/protocol/storagepb/stats.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v5.28.3 // source: storagepb/stats.proto diff --git a/protocol/storagepb/vote.pb.go b/protocol/storagepb/vote.pb.go index f312f3b..e2f973e 100644 --- a/protocol/storagepb/vote.pb.go +++ b/protocol/storagepb/vote.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v5.28.3 // source: storagepb/vote.proto @@ -377,6 +377,7 @@ type ValidateResponse struct { Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` VotingPower float64 `protobuf:"fixed64,2,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` ValidationError *ValidationError `protobuf:"bytes,3,opt,name=validation_error,json=validationError,proto3,oneof" json:"validation_error,omitempty"` + VoteStatus *VoteStatus `protobuf:"bytes,4,opt,name=vote_status,json=voteStatus,proto3" json:"vote_status,omitempty"` } func (x *ValidateResponse) Reset() { @@ -430,6 +431,66 @@ func (x *ValidateResponse) GetValidationError() *ValidationError { return nil } +func (x *ValidateResponse) GetVoteStatus() *VoteStatus { + if x != nil { + return x.VoteStatus + } + return nil +} + +type VoteStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Voted bool `protobuf:"varint,1,opt,name=voted,proto3" json:"voted,omitempty"` + Choice *anypb.Any `protobuf:"bytes,2,opt,name=choice,proto3" json:"choice,omitempty"` +} + +func (x *VoteStatus) Reset() { + *x = VoteStatus{} + mi := &file_storagepb_vote_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VoteStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoteStatus) ProtoMessage() {} + +func (x *VoteStatus) ProtoReflect() protoreflect.Message { + mi := &file_storagepb_vote_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VoteStatus.ProtoReflect.Descriptor instead. +func (*VoteStatus) Descriptor() ([]byte, []int) { + return file_storagepb_vote_proto_rawDescGZIP(), []int{5} +} + +func (x *VoteStatus) GetVoted() bool { + if x != nil { + return x.Voted + } + return false +} + +func (x *VoteStatus) GetChoice() *anypb.Any { + if x != nil { + return x.Choice + } + return nil +} + type ValidationError struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -441,7 +502,7 @@ type ValidationError struct { func (x *ValidationError) Reset() { *x = ValidationError{} - mi := &file_storagepb_vote_proto_msgTypes[5] + mi := &file_storagepb_vote_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -453,7 +514,7 @@ func (x *ValidationError) String() string { func (*ValidationError) ProtoMessage() {} func (x *ValidationError) ProtoReflect() protoreflect.Message { - mi := &file_storagepb_vote_proto_msgTypes[5] + mi := &file_storagepb_vote_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -466,7 +527,7 @@ func (x *ValidationError) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidationError.ProtoReflect.Descriptor instead. func (*ValidationError) Descriptor() ([]byte, []int) { - return file_storagepb_vote_proto_rawDescGZIP(), []int{5} + return file_storagepb_vote_proto_rawDescGZIP(), []int{6} } func (x *ValidationError) GetMessage() string { @@ -496,7 +557,7 @@ type PrepareRequest struct { func (x *PrepareRequest) Reset() { *x = PrepareRequest{} - mi := &file_storagepb_vote_proto_msgTypes[6] + mi := &file_storagepb_vote_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -508,7 +569,7 @@ func (x *PrepareRequest) String() string { func (*PrepareRequest) ProtoMessage() {} func (x *PrepareRequest) ProtoReflect() protoreflect.Message { - mi := &file_storagepb_vote_proto_msgTypes[6] + mi := &file_storagepb_vote_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -521,7 +582,7 @@ func (x *PrepareRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PrepareRequest.ProtoReflect.Descriptor instead. func (*PrepareRequest) Descriptor() ([]byte, []int) { - return file_storagepb_vote_proto_rawDescGZIP(), []int{6} + return file_storagepb_vote_proto_rawDescGZIP(), []int{7} } func (x *PrepareRequest) GetVoter() string { @@ -563,7 +624,7 @@ type PrepareResponse struct { func (x *PrepareResponse) Reset() { *x = PrepareResponse{} - mi := &file_storagepb_vote_proto_msgTypes[7] + mi := &file_storagepb_vote_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -575,7 +636,7 @@ func (x *PrepareResponse) String() string { func (*PrepareResponse) ProtoMessage() {} func (x *PrepareResponse) ProtoReflect() protoreflect.Message { - mi := &file_storagepb_vote_proto_msgTypes[7] + mi := &file_storagepb_vote_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -588,7 +649,7 @@ func (x *PrepareResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PrepareResponse.ProtoReflect.Descriptor instead. func (*PrepareResponse) Descriptor() ([]byte, []int) { - return file_storagepb_vote_proto_rawDescGZIP(), []int{7} + return file_storagepb_vote_proto_rawDescGZIP(), []int{8} } func (x *PrepareResponse) GetId() string { @@ -616,7 +677,7 @@ type VoteRequest struct { func (x *VoteRequest) Reset() { *x = VoteRequest{} - mi := &file_storagepb_vote_proto_msgTypes[8] + mi := &file_storagepb_vote_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -628,7 +689,7 @@ func (x *VoteRequest) String() string { func (*VoteRequest) ProtoMessage() {} func (x *VoteRequest) ProtoReflect() protoreflect.Message { - mi := &file_storagepb_vote_proto_msgTypes[8] + mi := &file_storagepb_vote_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -641,7 +702,7 @@ func (x *VoteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VoteRequest.ProtoReflect.Descriptor instead. func (*VoteRequest) Descriptor() ([]byte, []int) { - return file_storagepb_vote_proto_rawDescGZIP(), []int{8} + return file_storagepb_vote_proto_rawDescGZIP(), []int{9} } func (x *VoteRequest) GetId() string { @@ -671,7 +732,7 @@ type VoteResponse struct { func (x *VoteResponse) Reset() { *x = VoteResponse{} - mi := &file_storagepb_vote_proto_msgTypes[9] + mi := &file_storagepb_vote_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -683,7 +744,7 @@ func (x *VoteResponse) String() string { func (*VoteResponse) ProtoMessage() {} func (x *VoteResponse) ProtoReflect() protoreflect.Message { - mi := &file_storagepb_vote_proto_msgTypes[9] + mi := &file_storagepb_vote_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -696,7 +757,7 @@ func (x *VoteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VoteResponse.ProtoReflect.Descriptor instead. func (*VoteResponse) Descriptor() ([]byte, []int) { - return file_storagepb_vote_proto_rawDescGZIP(), []int{9} + return file_storagepb_vote_proto_rawDescGZIP(), []int{10} } func (x *VoteResponse) GetId() string { @@ -738,7 +799,7 @@ type Relayer struct { func (x *Relayer) Reset() { *x = Relayer{} - mi := &file_storagepb_vote_proto_msgTypes[10] + mi := &file_storagepb_vote_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -750,7 +811,7 @@ func (x *Relayer) String() string { func (*Relayer) ProtoMessage() {} func (x *Relayer) ProtoReflect() protoreflect.Message { - mi := &file_storagepb_vote_proto_msgTypes[10] + mi := &file_storagepb_vote_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -763,7 +824,7 @@ func (x *Relayer) ProtoReflect() protoreflect.Message { // Deprecated: Use Relayer.ProtoReflect.Descriptor instead. func (*Relayer) Descriptor() ([]byte, []int) { - return file_storagepb_vote_proto_rawDescGZIP(), []int{10} + return file_storagepb_vote_proto_rawDescGZIP(), []int{11} } func (x *Relayer) GetAddress() string { @@ -790,7 +851,7 @@ type DaosVotedInRequest struct { func (x *DaosVotedInRequest) Reset() { *x = DaosVotedInRequest{} - mi := &file_storagepb_vote_proto_msgTypes[11] + mi := &file_storagepb_vote_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -802,7 +863,7 @@ func (x *DaosVotedInRequest) String() string { func (*DaosVotedInRequest) ProtoMessage() {} func (x *DaosVotedInRequest) ProtoReflect() protoreflect.Message { - mi := &file_storagepb_vote_proto_msgTypes[11] + mi := &file_storagepb_vote_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -815,7 +876,7 @@ func (x *DaosVotedInRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DaosVotedInRequest.ProtoReflect.Descriptor instead. func (*DaosVotedInRequest) Descriptor() ([]byte, []int) { - return file_storagepb_vote_proto_rawDescGZIP(), []int{11} + return file_storagepb_vote_proto_rawDescGZIP(), []int{12} } func (x *DaosVotedInRequest) GetVoter() string { @@ -836,7 +897,7 @@ type DaosVotedInResponse struct { func (x *DaosVotedInResponse) Reset() { *x = DaosVotedInResponse{} - mi := &file_storagepb_vote_proto_msgTypes[12] + mi := &file_storagepb_vote_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -848,7 +909,7 @@ func (x *DaosVotedInResponse) String() string { func (*DaosVotedInResponse) ProtoMessage() {} func (x *DaosVotedInResponse) ProtoReflect() protoreflect.Message { - mi := &file_storagepb_vote_proto_msgTypes[12] + mi := &file_storagepb_vote_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -861,7 +922,7 @@ func (x *DaosVotedInResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DaosVotedInResponse.ProtoReflect.Descriptor instead. func (*DaosVotedInResponse) Descriptor() ([]byte, []int) { - return file_storagepb_vote_proto_rawDescGZIP(), []int{12} + return file_storagepb_vote_proto_rawDescGZIP(), []int{13} } func (x *DaosVotedInResponse) GetDaoIds() []string { @@ -938,7 +999,7 @@ var file_storagepb_vote_proto_rawDesc = []byte{ 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x22, 0xa6, 0x01, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x61, 0x6c, 0x22, 0xde, 0x01, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x76, @@ -947,73 +1008,81 @@ var file_storagepb_vote_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3f, 0x0a, 0x0f, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x98, 0x01, 0x0a, - 0x0e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x12, 0x2c, 0x0a, 0x06, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x12, - 0x1b, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, - 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x40, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x70, 0x61, - 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x79, - 0x70, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x74, 0x79, 0x70, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x22, 0x2f, 0x0a, 0x0b, 0x56, 0x6f, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x67, 0x22, 0x81, 0x01, 0x0a, 0x0c, 0x56, - 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, - 0x70, 0x66, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x70, 0x66, 0x73, 0x12, - 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1f, 0x0a, - 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x3d, - 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x22, 0x2a, 0x0a, - 0x12, 0x44, 0x61, 0x6f, 0x73, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x22, 0x4f, 0x0a, 0x13, 0x44, 0x61, 0x6f, - 0x73, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x17, 0x0a, 0x07, 0x64, 0x61, 0x6f, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x06, 0x64, 0x61, 0x6f, 0x49, 0x64, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xe2, 0x02, 0x0a, 0x04, 0x56, - 0x6f, 0x74, 0x65, 0x12, 0x49, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, - 0x1d, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, - 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x73, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, - 0x0a, 0x08, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x70, 0x62, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x19, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, - 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, - 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x6f, 0x73, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x49, 0x6e, - 0x12, 0x1d, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x6f, - 0x73, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x6f, 0x73, - 0x56, 0x6f, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x0d, 0x5a, 0x0b, 0x2e, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x0b, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x13, + 0x0a, 0x11, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x22, 0x50, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x63, 0x68, 0x6f, 0x69, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x63, + 0x68, 0x6f, 0x69, 0x63, 0x65, 0x22, 0x3f, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x65, 0x70, 0x61, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x2c, 0x0a, 0x06, 0x63, + 0x68, 0x6f, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x06, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x22, 0x40, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x79, 0x70, 0x65, 0x64, 0x44, + 0x61, 0x74, 0x61, 0x22, 0x2f, 0x0a, 0x0b, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x73, 0x69, 0x67, 0x22, 0x81, 0x01, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x70, 0x66, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x70, 0x66, 0x73, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x07, + 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x22, 0x2a, 0x0a, 0x12, 0x44, 0x61, 0x6f, 0x73, 0x56, + 0x6f, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x6f, + 0x74, 0x65, 0x72, 0x22, 0x4f, 0x0a, 0x13, 0x44, 0x61, 0x6f, 0x73, 0x56, 0x6f, 0x74, 0x65, 0x64, + 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x61, + 0x6f, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x61, 0x6f, + 0x49, 0x64, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xe2, 0x02, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x49, 0x0a, + 0x08, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x08, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, + 0x07, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, + 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x37, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x17, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, + 0x61, 0x6f, 0x73, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x12, 0x1d, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x56, 0x6f, 0x74, 0x65, 0x64, + 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x49, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x3b, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1028,44 +1097,47 @@ func file_storagepb_vote_proto_rawDescGZIP() []byte { return file_storagepb_vote_proto_rawDescData } -var file_storagepb_vote_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_storagepb_vote_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_storagepb_vote_proto_goTypes = []any{ (*VotesFilterRequest)(nil), // 0: storagepb.VotesFilterRequest (*VoteInfo)(nil), // 1: storagepb.VoteInfo (*VotesFilterResponse)(nil), // 2: storagepb.VotesFilterResponse (*ValidateRequest)(nil), // 3: storagepb.ValidateRequest (*ValidateResponse)(nil), // 4: storagepb.ValidateResponse - (*ValidationError)(nil), // 5: storagepb.ValidationError - (*PrepareRequest)(nil), // 6: storagepb.PrepareRequest - (*PrepareResponse)(nil), // 7: storagepb.PrepareResponse - (*VoteRequest)(nil), // 8: storagepb.VoteRequest - (*VoteResponse)(nil), // 9: storagepb.VoteResponse - (*Relayer)(nil), // 10: storagepb.Relayer - (*DaosVotedInRequest)(nil), // 11: storagepb.DaosVotedInRequest - (*DaosVotedInResponse)(nil), // 12: storagepb.DaosVotedInResponse - (*anypb.Any)(nil), // 13: google.protobuf.Any + (*VoteStatus)(nil), // 5: storagepb.VoteStatus + (*ValidationError)(nil), // 6: storagepb.ValidationError + (*PrepareRequest)(nil), // 7: storagepb.PrepareRequest + (*PrepareResponse)(nil), // 8: storagepb.PrepareResponse + (*VoteRequest)(nil), // 9: storagepb.VoteRequest + (*VoteResponse)(nil), // 10: storagepb.VoteResponse + (*Relayer)(nil), // 11: storagepb.Relayer + (*DaosVotedInRequest)(nil), // 12: storagepb.DaosVotedInRequest + (*DaosVotedInResponse)(nil), // 13: storagepb.DaosVotedInResponse + (*anypb.Any)(nil), // 14: google.protobuf.Any } var file_storagepb_vote_proto_depIdxs = []int32{ - 13, // 0: storagepb.VoteInfo.choice:type_name -> google.protobuf.Any + 14, // 0: storagepb.VoteInfo.choice:type_name -> google.protobuf.Any 1, // 1: storagepb.VotesFilterResponse.votes:type_name -> storagepb.VoteInfo - 5, // 2: storagepb.ValidateResponse.validation_error:type_name -> storagepb.ValidationError - 13, // 3: storagepb.PrepareRequest.choice:type_name -> google.protobuf.Any - 10, // 4: storagepb.VoteResponse.relayer:type_name -> storagepb.Relayer - 0, // 5: storagepb.Vote.GetVotes:input_type -> storagepb.VotesFilterRequest - 3, // 6: storagepb.Vote.Validate:input_type -> storagepb.ValidateRequest - 6, // 7: storagepb.Vote.Prepare:input_type -> storagepb.PrepareRequest - 8, // 8: storagepb.Vote.Vote:input_type -> storagepb.VoteRequest - 11, // 9: storagepb.Vote.GetDaosVotedIn:input_type -> storagepb.DaosVotedInRequest - 2, // 10: storagepb.Vote.GetVotes:output_type -> storagepb.VotesFilterResponse - 4, // 11: storagepb.Vote.Validate:output_type -> storagepb.ValidateResponse - 7, // 12: storagepb.Vote.Prepare:output_type -> storagepb.PrepareResponse - 9, // 13: storagepb.Vote.Vote:output_type -> storagepb.VoteResponse - 12, // 14: storagepb.Vote.GetDaosVotedIn:output_type -> storagepb.DaosVotedInResponse - 10, // [10:15] is the sub-list for method output_type - 5, // [5:10] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 6, // 2: storagepb.ValidateResponse.validation_error:type_name -> storagepb.ValidationError + 5, // 3: storagepb.ValidateResponse.vote_status:type_name -> storagepb.VoteStatus + 14, // 4: storagepb.VoteStatus.choice:type_name -> google.protobuf.Any + 14, // 5: storagepb.PrepareRequest.choice:type_name -> google.protobuf.Any + 11, // 6: storagepb.VoteResponse.relayer:type_name -> storagepb.Relayer + 0, // 7: storagepb.Vote.GetVotes:input_type -> storagepb.VotesFilterRequest + 3, // 8: storagepb.Vote.Validate:input_type -> storagepb.ValidateRequest + 7, // 9: storagepb.Vote.Prepare:input_type -> storagepb.PrepareRequest + 9, // 10: storagepb.Vote.Vote:input_type -> storagepb.VoteRequest + 12, // 11: storagepb.Vote.GetDaosVotedIn:input_type -> storagepb.DaosVotedInRequest + 2, // 12: storagepb.Vote.GetVotes:output_type -> storagepb.VotesFilterResponse + 4, // 13: storagepb.Vote.Validate:output_type -> storagepb.ValidateResponse + 8, // 14: storagepb.Vote.Prepare:output_type -> storagepb.PrepareResponse + 10, // 15: storagepb.Vote.Vote:output_type -> storagepb.VoteResponse + 13, // 16: storagepb.Vote.GetDaosVotedIn:output_type -> storagepb.DaosVotedInResponse + 12, // [12:17] is the sub-list for method output_type + 7, // [7:12] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_storagepb_vote_proto_init() } @@ -1075,14 +1147,14 @@ func file_storagepb_vote_proto_init() { } file_storagepb_vote_proto_msgTypes[0].OneofWrappers = []any{} file_storagepb_vote_proto_msgTypes[4].OneofWrappers = []any{} - file_storagepb_vote_proto_msgTypes[6].OneofWrappers = []any{} + file_storagepb_vote_proto_msgTypes[7].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_storagepb_vote_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, diff --git a/protocol/storagepb/vote.proto b/protocol/storagepb/vote.proto index 74575e6..72ef28a 100644 --- a/protocol/storagepb/vote.proto +++ b/protocol/storagepb/vote.proto @@ -56,6 +56,12 @@ message ValidateResponse { double voting_power = 2; optional ValidationError validation_error = 3; + VoteStatus vote_status = 4; +} + +message VoteStatus { + bool voted = 1; + google.protobuf.Any choice = 2; } message ValidationError {