From ac956eeda3544af79dcdf78f106b602fef82a76a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:40:29 -0400 Subject: [PATCH] test: Dispute test update (#383) (#389) * notes * update SetVoterReporterStake * update vote and tally, claimReward * rewards * no rewards in executeVote * try tally in vote and preblock, handle failed dispute * auto execute disputes * cleanup unused * remove legacydec * implemented the change from Dec to Uint in slashing and jailing during disputes * started working on getting tests to pass but am just going to build and start chain * fixed test for TestEscrowReporterStakeUnbondingdelegations * fix autocli * test execute * tests * tests * test: some dispute module unit test (#384) * vote_test.go * vote.go test, tally.go test, dispute.go test * linting * fix msg_server_vote_test.go * fix dispute unit test, linting * comments * pushing up to check changes and progress * got TestDisputes2 passing in e2e_test.go * dispute keeper test * adjust stored delegations amounts by 1e6 * test * test * tests * test: execute_vote.go fixes (#387) * feat: add tip listener to daemon (#382) * added function to listen for tipped queries * added tip listening process to reporter daemon client and updated app.go so that it doesn't generate the config files every time but just reads them. Allowing users to just edit the config files to add pairs or remove sources * made some small changes to function names and added a check to make sure the query that was tipped is a spot price * made lint fixes * execute_test.go fix --------- Co-authored-by: CJPotter10 <91627020+CJPotter10@users.noreply.github.com> * Finished part of the dispute testing (#388) * updated Execute and tally votes to not return an error in the event of no votes existing and instead it creates a 0 initialized StakeHolderVoteCounts object so it returns 0 instead of an error * got TestExecuteVoteSupport passing * recommented a function out --------- Co-authored-by: tkernell * lint * remove prints --------- Co-authored-by: Cjpotter10 Co-authored-by: Dan F Co-authored-by: CJPotter10 <91627020+CJPotter10@users.noreply.github.com> (cherry picked from commit a991c38f0b4b9cc938d99b4f416a583d5cb0af04) Co-authored-by: tkernell --- api/layer/bridge/query_grpc.pb.go | 22 + api/layer/dispute/dispute.pulsar.go | 267 +- api/layer/dispute/tx.pulsar.go | 3391 ++++++----------- api/layer/dispute/tx_grpc.pb.go | 102 +- api/layer/dispute/vote.pulsar.go | 285 +- proto/layer/bridge/query.proto | 12 +- proto/layer/dispute/dispute.proto | 9 + proto/layer/dispute/tx.proto | 27 +- proto/layer/dispute/vote.proto | 11 + tests/e2e/basic_dispute_test.go | 20 +- tests/e2e/e2e_test.go | 13 +- tests/integration/dispute_keeper_test.go | 153 +- testutil/keeper/dispute.go | 2 +- types/global.go | 4 +- x/bridge/types/query.pb.go | 22 + x/dispute/abci.go | 45 +- x/dispute/abci_test.go | 6 +- x/dispute/autocli.go | 18 +- x/dispute/genesis.go | 2 +- x/dispute/keeper/claim_reward.go | 133 + x/dispute/keeper/dispute.go | 23 +- x/dispute/keeper/dispute_test.go | 11 +- x/dispute/keeper/execute.go | 179 +- x/dispute/keeper/execute_test.go | 170 +- x/dispute/keeper/indexes.go | 10 +- x/dispute/keeper/keeper.go | 7 +- x/dispute/keeper/msg_execute_dispute.go | 16 - x/dispute/keeper/msg_execute_dispute_test.go | 61 - x/dispute/keeper/msg_server.go | 81 - x/dispute/keeper/msg_server_claim_reward.go | 23 + x/dispute/keeper/msg_server_vote.go | 35 +- x/dispute/keeper/msg_server_vote_test.go | 9 +- .../keeper/msg_server_withdraw_fee_refund.go | 97 + x/dispute/keeper/msg_tally_vote.go | 16 - x/dispute/keeper/msg_tally_vote_test.go | 78 - x/dispute/keeper/tally.go | 192 +- x/dispute/keeper/tally_test.go | 557 ++- x/dispute/keeper/vote.go | 187 +- x/dispute/keeper/vote_test.go | 677 ++-- x/dispute/types/codec.go | 6 +- x/dispute/types/dispute.pb.go | 224 +- x/dispute/types/errors.go | 1 + x/dispute/types/keys.go | 2 + x/dispute/types/stakeholder_vote_counts.go | 32 + x/dispute/types/tx.pb.go | 1376 +++---- x/dispute/types/vote.pb.go | 209 +- x/oracle/keeper/cycle_list.go | 4 - x/reporter/keeper/distribution.go | 2 +- x/reporter/keeper/reporter.go | 3 +- x/reporter/keeper/withdraw.go | 88 +- x/reporter/keeper/withdraw_test.go | 15 +- 51 files changed, 4396 insertions(+), 4539 deletions(-) create mode 100644 x/dispute/keeper/claim_reward.go delete mode 100644 x/dispute/keeper/msg_execute_dispute.go delete mode 100644 x/dispute/keeper/msg_execute_dispute_test.go create mode 100644 x/dispute/keeper/msg_server_claim_reward.go create mode 100644 x/dispute/keeper/msg_server_withdraw_fee_refund.go delete mode 100644 x/dispute/keeper/msg_tally_vote.go delete mode 100644 x/dispute/keeper/msg_tally_vote_test.go create mode 100644 x/dispute/types/stakeholder_vote_counts.go diff --git a/api/layer/bridge/query_grpc.pb.go b/api/layer/bridge/query_grpc.pb.go index 6f7bb6e24..9f5c80eea 100644 --- a/api/layer/bridge/query_grpc.pb.go +++ b/api/layer/bridge/query_grpc.pb.go @@ -22,16 +22,27 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a list of GetEvmValidators items. GetEvmValidators(ctx context.Context, in *QueryGetEvmValidatorsRequest, opts ...grpc.CallOption) (*QueryGetEvmValidatorsResponse, error) + // Queries the latest validator checkpoint GetValidatorCheckpoint(ctx context.Context, in *QueryGetValidatorCheckpointRequest, opts ...grpc.CallOption) (*QueryGetValidatorCheckpointResponse, error) + // Queries the validator checkpoint params for a given timestamp GetValidatorCheckpointParams(ctx context.Context, in *QueryGetValidatorCheckpointParamsRequest, opts ...grpc.CallOption) (*QueryGetValidatorCheckpointParamsResponse, error) + // Queries the validator timestamp by index GetValidatorTimestampByIndex(ctx context.Context, in *QueryGetValidatorTimestampByIndexRequest, opts ...grpc.CallOption) (*QueryGetValidatorTimestampByIndexResponse, error) + // Queries the validator set signatures for a given timestamp GetValsetSigs(ctx context.Context, in *QueryGetValsetSigsRequest, opts ...grpc.CallOption) (*QueryGetValsetSigsResponse, error) + // Queries the evm address by validator address GetEvmAddressByValidatorAddress(ctx context.Context, in *QueryGetEvmAddressByValidatorAddressRequest, opts ...grpc.CallOption) (*QueryGetEvmAddressByValidatorAddressResponse, error) + // Queries the validator set by timestamp GetValsetByTimestamp(ctx context.Context, in *QueryGetValsetByTimestampRequest, opts ...grpc.CallOption) (*QueryGetValsetByTimestampResponse, error) + // Queries a list of snapshots by report query id and timestamp GetSnapshotsByReport(ctx context.Context, in *QueryGetSnapshotsByReportRequest, opts ...grpc.CallOption) (*QueryGetSnapshotsByReportResponse, error) + // Queries attestation data by snapshot GetAttestationDataBySnapshot(ctx context.Context, in *QueryGetAttestationDataBySnapshotRequest, opts ...grpc.CallOption) (*QueryGetAttestationDataBySnapshotResponse, error) + // Queries the set of attestations by snapshot GetAttestationsBySnapshot(ctx context.Context, in *QueryGetAttestationsBySnapshotRequest, opts ...grpc.CallOption) (*QueryGetAttestationsBySnapshotResponse, error) + // Queries the validator set index by timestamp GetValidatorSetIndexByTimestamp(ctx context.Context, in *QueryGetValidatorSetIndexByTimestampRequest, opts ...grpc.CallOption) (*QueryGetValidatorSetIndexByTimestampResponse, error) + // Queries the current validator set timestamp GetCurrentValidatorSetTimestamp(ctx context.Context, in *QueryGetCurrentValidatorSetTimestampRequest, opts ...grpc.CallOption) (*QueryGetCurrentValidatorSetTimestampResponse, error) } @@ -168,16 +179,27 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a list of GetEvmValidators items. GetEvmValidators(context.Context, *QueryGetEvmValidatorsRequest) (*QueryGetEvmValidatorsResponse, error) + // Queries the latest validator checkpoint GetValidatorCheckpoint(context.Context, *QueryGetValidatorCheckpointRequest) (*QueryGetValidatorCheckpointResponse, error) + // Queries the validator checkpoint params for a given timestamp GetValidatorCheckpointParams(context.Context, *QueryGetValidatorCheckpointParamsRequest) (*QueryGetValidatorCheckpointParamsResponse, error) + // Queries the validator timestamp by index GetValidatorTimestampByIndex(context.Context, *QueryGetValidatorTimestampByIndexRequest) (*QueryGetValidatorTimestampByIndexResponse, error) + // Queries the validator set signatures for a given timestamp GetValsetSigs(context.Context, *QueryGetValsetSigsRequest) (*QueryGetValsetSigsResponse, error) + // Queries the evm address by validator address GetEvmAddressByValidatorAddress(context.Context, *QueryGetEvmAddressByValidatorAddressRequest) (*QueryGetEvmAddressByValidatorAddressResponse, error) + // Queries the validator set by timestamp GetValsetByTimestamp(context.Context, *QueryGetValsetByTimestampRequest) (*QueryGetValsetByTimestampResponse, error) + // Queries a list of snapshots by report query id and timestamp GetSnapshotsByReport(context.Context, *QueryGetSnapshotsByReportRequest) (*QueryGetSnapshotsByReportResponse, error) + // Queries attestation data by snapshot GetAttestationDataBySnapshot(context.Context, *QueryGetAttestationDataBySnapshotRequest) (*QueryGetAttestationDataBySnapshotResponse, error) + // Queries the set of attestations by snapshot GetAttestationsBySnapshot(context.Context, *QueryGetAttestationsBySnapshotRequest) (*QueryGetAttestationsBySnapshotResponse, error) + // Queries the validator set index by timestamp GetValidatorSetIndexByTimestamp(context.Context, *QueryGetValidatorSetIndexByTimestampRequest) (*QueryGetValidatorSetIndexByTimestampResponse, error) + // Queries the current validator set timestamp GetCurrentValidatorSetTimestamp(context.Context, *QueryGetCurrentValidatorSetTimestampRequest) (*QueryGetCurrentValidatorSetTimestampResponse, error) mustEmbedUnimplementedQueryServer() } diff --git a/api/layer/dispute/dispute.pulsar.go b/api/layer/dispute/dispute.pulsar.go index b52256705..1427c3942 100644 --- a/api/layer/dispute/dispute.pulsar.go +++ b/api/layer/dispute/dispute.pulsar.go @@ -133,6 +133,8 @@ var ( fd_Dispute_block_number protoreflect.FieldDescriptor fd_Dispute_open protoreflect.FieldDescriptor fd_Dispute_additional_evidence protoreflect.FieldDescriptor + fd_Dispute_voter_reward protoreflect.FieldDescriptor + fd_Dispute_pending_execution protoreflect.FieldDescriptor ) func init() { @@ -155,6 +157,8 @@ func init() { fd_Dispute_block_number = md_Dispute.Fields().ByName("block_number") fd_Dispute_open = md_Dispute.Fields().ByName("open") fd_Dispute_additional_evidence = md_Dispute.Fields().ByName("additional_evidence") + fd_Dispute_voter_reward = md_Dispute.Fields().ByName("voter_reward") + fd_Dispute_pending_execution = md_Dispute.Fields().ByName("pending_execution") } var _ protoreflect.Message = (*fastReflection_Dispute)(nil) @@ -324,6 +328,18 @@ func (x *fastReflection_Dispute) Range(f func(protoreflect.FieldDescriptor, prot return } } + if x.VoterReward != "" { + value := protoreflect.ValueOfString(x.VoterReward) + if !f(fd_Dispute_voter_reward, value) { + return + } + } + if x.PendingExecution != false { + value := protoreflect.ValueOfBool(x.PendingExecution) + if !f(fd_Dispute_pending_execution, value) { + return + } + } } // Has reports whether a field is populated. @@ -373,6 +389,10 @@ func (x *fastReflection_Dispute) Has(fd protoreflect.FieldDescriptor) bool { return x.Open != false case "layer.dispute.Dispute.additional_evidence": return len(x.AdditionalEvidence) != 0 + case "layer.dispute.Dispute.voter_reward": + return x.VoterReward != "" + case "layer.dispute.Dispute.pending_execution": + return x.PendingExecution != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Dispute")) @@ -423,6 +443,10 @@ func (x *fastReflection_Dispute) Clear(fd protoreflect.FieldDescriptor) { x.Open = false case "layer.dispute.Dispute.additional_evidence": x.AdditionalEvidence = nil + case "layer.dispute.Dispute.voter_reward": + x.VoterReward = "" + case "layer.dispute.Dispute.pending_execution": + x.PendingExecution = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Dispute")) @@ -496,6 +520,12 @@ func (x *fastReflection_Dispute) Get(descriptor protoreflect.FieldDescriptor) pr } listValue := &_Dispute_17_list{list: &x.AdditionalEvidence} return protoreflect.ValueOfList(listValue) + case "layer.dispute.Dispute.voter_reward": + value := x.VoterReward + return protoreflect.ValueOfString(value) + case "layer.dispute.Dispute.pending_execution": + value := x.PendingExecution + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Dispute")) @@ -554,6 +584,10 @@ func (x *fastReflection_Dispute) Set(fd protoreflect.FieldDescriptor, value prot lv := value.List() clv := lv.(*_Dispute_17_list) x.AdditionalEvidence = *clv.list + case "layer.dispute.Dispute.voter_reward": + x.VoterReward = value.Interface().(string) + case "layer.dispute.Dispute.pending_execution": + x.PendingExecution = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Dispute")) @@ -625,6 +659,10 @@ func (x *fastReflection_Dispute) Mutable(fd protoreflect.FieldDescriptor) protor panic(fmt.Errorf("field block_number of message layer.dispute.Dispute is not mutable")) case "layer.dispute.Dispute.open": panic(fmt.Errorf("field open of message layer.dispute.Dispute is not mutable")) + case "layer.dispute.Dispute.voter_reward": + panic(fmt.Errorf("field voter_reward of message layer.dispute.Dispute is not mutable")) + case "layer.dispute.Dispute.pending_execution": + panic(fmt.Errorf("field pending_execution of message layer.dispute.Dispute is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Dispute")) @@ -677,6 +715,10 @@ func (x *fastReflection_Dispute) NewField(fd protoreflect.FieldDescriptor) proto case "layer.dispute.Dispute.additional_evidence": list := []*oracle.MicroReport{} return protoreflect.ValueOfList(&_Dispute_17_list{list: &list}) + case "layer.dispute.Dispute.voter_reward": + return protoreflect.ValueOfString("") + case "layer.dispute.Dispute.pending_execution": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Dispute")) @@ -812,6 +854,13 @@ func (x *fastReflection_Dispute) ProtoMethods() *protoiface.Methods { n += 2 + l + runtime.Sov(uint64(l)) } } + l = len(x.VoterReward) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + if x.PendingExecution { + n += 3 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -841,6 +890,27 @@ func (x *fastReflection_Dispute) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.PendingExecution { + i-- + if x.PendingExecution { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if len(x.VoterReward) > 0 { + i -= len(x.VoterReward) + copy(dAtA[i:], x.VoterReward) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VoterReward))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } if len(x.AdditionalEvidence) > 0 { for iNdEx := len(x.AdditionalEvidence) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.AdditionalEvidence[iNdEx]) @@ -1561,6 +1631,58 @@ func (x *fastReflection_Dispute) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 18: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VoterReward", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.VoterReward = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 19: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PendingExecution", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.PendingExecution = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2724,6 +2846,11 @@ type Dispute struct { BlockNumber uint64 `protobuf:"varint,15,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` Open bool `protobuf:"varint,16,opt,name=open,proto3" json:"open,omitempty"` AdditionalEvidence []*oracle.MicroReport `protobuf:"bytes,17,rep,name=additional_evidence,json=additionalEvidence,proto3" json:"additional_evidence,omitempty"` + // total tokens allocated to voters + VoterReward string `protobuf:"bytes,18,opt,name=voter_reward,json=voterReward,proto3" json:"voter_reward,omitempty"` + // pending execution is true if the dispute has reached quorum and is pending execution. + // however, if a new dispute round begins, this is set to false again + PendingExecution bool `protobuf:"varint,19,opt,name=pending_execution,json=pendingExecution,proto3" json:"pending_execution,omitempty"` } func (x *Dispute) Reset() { @@ -2865,6 +2992,20 @@ func (x *Dispute) GetAdditionalEvidence() []*oracle.MicroReport { return nil } +func (x *Dispute) GetVoterReward() string { + if x != nil { + return x.VoterReward + } + return "" +} + +func (x *Dispute) GetPendingExecution() bool { + if x != nil { + return x.PendingExecution + } + return false +} + // PayerInfo defines the payer info of a dispute // fee payer's info that was involved in paying the dispute fee in order to start the dispute type PayerInfo struct { @@ -2972,7 +3113,7 @@ var file_layer_dispute_dispute_proto_rawDesc = []byte{ 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xf9, 0x07, 0x0a, 0x07, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, + 0xf6, 0x08, 0x0a, 0x07, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, @@ -3035,64 +3176,72 @@ var file_layer_dispute_dispute_proto_rawDesc = []byte{ 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x12, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x6c, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x6d, 0x0a, 0x09, 0x50, - 0x61, 0x79, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, - 0x09, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x62, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x66, 0x72, 0x6f, 0x6d, 0x42, 0x6f, 0x6e, 0x64, 0x22, 0xbf, 0x01, 0x0a, 0x09, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5d, 0x0a, 0x14, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x53, 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0d, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x70, 0x73, 0x2a, 0xc3, 0x01, 0x0a, - 0x0f, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x12, 0x31, 0x0a, 0x1c, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x54, 0x45, - 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x1a, 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x55, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x18, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x43, - 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, - 0x01, 0x1a, 0x0b, 0x8a, 0x9d, 0x20, 0x07, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x25, - 0x0a, 0x16, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, - 0x52, 0x59, 0x5f, 0x4d, 0x49, 0x4e, 0x4f, 0x52, 0x10, 0x02, 0x1a, 0x09, 0x8a, 0x9d, 0x20, 0x05, - 0x4d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x16, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, - 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x10, - 0x03, 0x1a, 0x09, 0x8a, 0x9d, 0x20, 0x05, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x1a, 0x04, 0x88, 0xa3, - 0x1e, 0x00, 0x2a, 0xe6, 0x01, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x27, 0x0a, 0x16, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x45, 0x56, 0x4f, 0x54, 0x45, 0x10, 0x00, - 0x1a, 0x0b, 0x8a, 0x9d, 0x20, 0x07, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x12, 0x25, 0x0a, - 0x15, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x56, 0x6f, - 0x74, 0x69, 0x6e, 0x67, 0x12, 0x29, 0x0a, 0x17, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x10, - 0x02, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x12, - 0x2d, 0x0a, 0x19, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, - 0x53, 0x5f, 0x55, 0x4e, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x0e, - 0x8a, 0x9d, 0x20, 0x0a, 0x55, 0x6e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x12, 0x25, - 0x0a, 0x15, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x46, - 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0xa4, 0x01, 0x0a, 0x11, - 0x63, 0x6f, 0x6d, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, - 0x65, 0x42, 0x0c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, - 0x6c, 0x6c, 0x6f, 0x72, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xa2, - 0x02, 0x03, 0x4c, 0x44, 0x58, 0xaa, 0x02, 0x0d, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x44, 0x69, - 0x73, 0x70, 0x75, 0x74, 0x65, 0xca, 0x02, 0x0d, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, - 0x73, 0x70, 0x75, 0x74, 0x65, 0xe2, 0x02, 0x19, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, - 0x73, 0x70, 0x75, 0x74, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x0e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x70, 0x75, - 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x61, 0x6c, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x0c, 0x76, + 0x6f, 0x74, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0b, + 0x76, 0x6f, 0x74, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x70, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6d, 0x0a, 0x09, 0x50, 0x61, 0x79, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, + 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, + 0x6f, 0x6d, 0x5f, 0x62, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, + 0x72, 0x6f, 0x6d, 0x42, 0x6f, 0x6e, 0x64, 0x22, 0xbf, 0x01, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5d, 0x0a, 0x14, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, + 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, + 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x50, + 0x6f, 0x77, 0x65, 0x72, 0x12, 0x53, 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x74, 0x69, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, + 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0d, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x70, 0x73, 0x2a, 0xc3, 0x01, 0x0a, 0x0f, 0x44, 0x69, + 0x73, 0x70, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x31, 0x0a, + 0x1c, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, + 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, + 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x55, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x12, 0x29, 0x0a, 0x18, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x54, 0x45, + 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x1a, 0x0b, + 0x8a, 0x9d, 0x20, 0x07, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x16, 0x44, + 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, + 0x4d, 0x49, 0x4e, 0x4f, 0x52, 0x10, 0x02, 0x1a, 0x09, 0x8a, 0x9d, 0x20, 0x05, 0x4d, 0x69, 0x6e, + 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x16, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x43, 0x41, + 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x10, 0x03, 0x1a, 0x09, + 0x8a, 0x9d, 0x20, 0x05, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, + 0xe6, 0x01, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x27, 0x0a, 0x16, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x45, 0x56, 0x4f, 0x54, 0x45, 0x10, 0x00, 0x1a, 0x0b, 0x8a, + 0x9d, 0x20, 0x07, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x15, 0x44, 0x49, + 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, + 0x49, 0x4e, 0x47, 0x10, 0x01, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x56, 0x6f, 0x74, 0x69, 0x6e, + 0x67, 0x12, 0x29, 0x0a, 0x17, 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x10, 0x02, 0x1a, 0x0c, + 0x8a, 0x9d, 0x20, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x12, 0x2d, 0x0a, 0x19, + 0x44, 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, + 0x4e, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x0e, 0x8a, 0x9d, 0x20, + 0x0a, 0x55, 0x6e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x15, 0x44, + 0x49, 0x53, 0x50, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, + 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0xa4, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, + 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x42, 0x0c, + 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x6c, 0x6f, + 0x72, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xa2, 0x02, 0x03, 0x4c, + 0x44, 0x58, 0xaa, 0x02, 0x0d, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x75, + 0x74, 0x65, 0xca, 0x02, 0x0d, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, + 0x74, 0x65, 0xe2, 0x02, 0x19, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, + 0x74, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/layer/dispute/tx.pulsar.go b/api/layer/dispute/tx.pulsar.go index 0ed6cb92b..7e20aa1f7 100644 --- a/api/layer/dispute/tx.pulsar.go +++ b/api/layer/dispute/tx.pulsar.go @@ -1867,27 +1867,33 @@ func (x *fastReflection_MsgWithdrawFeeRefundResponse) ProtoMethods() *protoiface } var ( - md_MsgExecuteDispute protoreflect.MessageDescriptor - fd_MsgExecuteDispute_caller_address protoreflect.FieldDescriptor - fd_MsgExecuteDispute_dispute_id protoreflect.FieldDescriptor + md_MsgProposeDispute protoreflect.MessageDescriptor + fd_MsgProposeDispute_creator protoreflect.FieldDescriptor + fd_MsgProposeDispute_report protoreflect.FieldDescriptor + fd_MsgProposeDispute_dispute_category protoreflect.FieldDescriptor + fd_MsgProposeDispute_fee protoreflect.FieldDescriptor + fd_MsgProposeDispute_pay_from_bond protoreflect.FieldDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgExecuteDispute = File_layer_dispute_tx_proto.Messages().ByName("MsgExecuteDispute") - fd_MsgExecuteDispute_caller_address = md_MsgExecuteDispute.Fields().ByName("caller_address") - fd_MsgExecuteDispute_dispute_id = md_MsgExecuteDispute.Fields().ByName("dispute_id") + md_MsgProposeDispute = File_layer_dispute_tx_proto.Messages().ByName("MsgProposeDispute") + fd_MsgProposeDispute_creator = md_MsgProposeDispute.Fields().ByName("creator") + fd_MsgProposeDispute_report = md_MsgProposeDispute.Fields().ByName("report") + fd_MsgProposeDispute_dispute_category = md_MsgProposeDispute.Fields().ByName("dispute_category") + fd_MsgProposeDispute_fee = md_MsgProposeDispute.Fields().ByName("fee") + fd_MsgProposeDispute_pay_from_bond = md_MsgProposeDispute.Fields().ByName("pay_from_bond") } -var _ protoreflect.Message = (*fastReflection_MsgExecuteDispute)(nil) +var _ protoreflect.Message = (*fastReflection_MsgProposeDispute)(nil) -type fastReflection_MsgExecuteDispute MsgExecuteDispute +type fastReflection_MsgProposeDispute MsgProposeDispute -func (x *MsgExecuteDispute) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgExecuteDispute)(x) +func (x *MsgProposeDispute) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgProposeDispute)(x) } -func (x *MsgExecuteDispute) slowProtoReflect() protoreflect.Message { +func (x *MsgProposeDispute) slowProtoReflect() protoreflect.Message { mi := &file_layer_dispute_tx_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1899,43 +1905,43 @@ func (x *MsgExecuteDispute) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgExecuteDispute_messageType fastReflection_MsgExecuteDispute_messageType -var _ protoreflect.MessageType = fastReflection_MsgExecuteDispute_messageType{} +var _fastReflection_MsgProposeDispute_messageType fastReflection_MsgProposeDispute_messageType +var _ protoreflect.MessageType = fastReflection_MsgProposeDispute_messageType{} -type fastReflection_MsgExecuteDispute_messageType struct{} +type fastReflection_MsgProposeDispute_messageType struct{} -func (x fastReflection_MsgExecuteDispute_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgExecuteDispute)(nil) +func (x fastReflection_MsgProposeDispute_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgProposeDispute)(nil) } -func (x fastReflection_MsgExecuteDispute_messageType) New() protoreflect.Message { - return new(fastReflection_MsgExecuteDispute) +func (x fastReflection_MsgProposeDispute_messageType) New() protoreflect.Message { + return new(fastReflection_MsgProposeDispute) } -func (x fastReflection_MsgExecuteDispute_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgExecuteDispute +func (x fastReflection_MsgProposeDispute_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgProposeDispute } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgExecuteDispute) Descriptor() protoreflect.MessageDescriptor { - return md_MsgExecuteDispute +func (x *fastReflection_MsgProposeDispute) Descriptor() protoreflect.MessageDescriptor { + return md_MsgProposeDispute } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgExecuteDispute) Type() protoreflect.MessageType { - return _fastReflection_MsgExecuteDispute_messageType +func (x *fastReflection_MsgProposeDispute) Type() protoreflect.MessageType { + return _fastReflection_MsgProposeDispute_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgExecuteDispute) New() protoreflect.Message { - return new(fastReflection_MsgExecuteDispute) +func (x *fastReflection_MsgProposeDispute) New() protoreflect.Message { + return new(fastReflection_MsgProposeDispute) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgExecuteDispute) Interface() protoreflect.ProtoMessage { - return (*MsgExecuteDispute)(x) +func (x *fastReflection_MsgProposeDispute) Interface() protoreflect.ProtoMessage { + return (*MsgProposeDispute)(x) } // Range iterates over every populated field in an undefined order, @@ -1943,16 +1949,34 @@ func (x *fastReflection_MsgExecuteDispute) Interface() protoreflect.ProtoMessage // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgExecuteDispute) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.CallerAddress != "" { - value := protoreflect.ValueOfString(x.CallerAddress) - if !f(fd_MsgExecuteDispute_caller_address, value) { +func (x *fastReflection_MsgProposeDispute) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Creator != "" { + value := protoreflect.ValueOfString(x.Creator) + if !f(fd_MsgProposeDispute_creator, value) { return } } - if x.DisputeId != uint64(0) { - value := protoreflect.ValueOfUint64(x.DisputeId) - if !f(fd_MsgExecuteDispute_dispute_id, value) { + if x.Report != nil { + value := protoreflect.ValueOfMessage(x.Report.ProtoReflect()) + if !f(fd_MsgProposeDispute_report, value) { + return + } + } + if x.DisputeCategory != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.DisputeCategory)) + if !f(fd_MsgProposeDispute_dispute_category, value) { + return + } + } + if x.Fee != nil { + value := protoreflect.ValueOfMessage(x.Fee.ProtoReflect()) + if !f(fd_MsgProposeDispute_fee, value) { + return + } + } + if x.PayFromBond != false { + value := protoreflect.ValueOfBool(x.PayFromBond) + if !f(fd_MsgProposeDispute_pay_from_bond, value) { return } } @@ -1969,17 +1993,23 @@ func (x *fastReflection_MsgExecuteDispute) Range(f func(protoreflect.FieldDescri // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgExecuteDispute) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgProposeDispute) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "layer.dispute.MsgExecuteDispute.caller_address": - return x.CallerAddress != "" - case "layer.dispute.MsgExecuteDispute.dispute_id": - return x.DisputeId != uint64(0) + case "layer.dispute.MsgProposeDispute.creator": + return x.Creator != "" + case "layer.dispute.MsgProposeDispute.report": + return x.Report != nil + case "layer.dispute.MsgProposeDispute.dispute_category": + return x.DisputeCategory != 0 + case "layer.dispute.MsgProposeDispute.fee": + return x.Fee != nil + case "layer.dispute.MsgProposeDispute.pay_from_bond": + return x.PayFromBond != false default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) } } @@ -1989,17 +2019,23 @@ func (x *fastReflection_MsgExecuteDispute) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecuteDispute) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgProposeDispute) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "layer.dispute.MsgExecuteDispute.caller_address": - x.CallerAddress = "" - case "layer.dispute.MsgExecuteDispute.dispute_id": - x.DisputeId = uint64(0) + case "layer.dispute.MsgProposeDispute.creator": + x.Creator = "" + case "layer.dispute.MsgProposeDispute.report": + x.Report = nil + case "layer.dispute.MsgProposeDispute.dispute_category": + x.DisputeCategory = 0 + case "layer.dispute.MsgProposeDispute.fee": + x.Fee = nil + case "layer.dispute.MsgProposeDispute.pay_from_bond": + x.PayFromBond = false default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) } } @@ -2009,19 +2045,28 @@ func (x *fastReflection_MsgExecuteDispute) Clear(fd protoreflect.FieldDescriptor // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgExecuteDispute) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgProposeDispute) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "layer.dispute.MsgExecuteDispute.caller_address": - value := x.CallerAddress + case "layer.dispute.MsgProposeDispute.creator": + value := x.Creator return protoreflect.ValueOfString(value) - case "layer.dispute.MsgExecuteDispute.dispute_id": - value := x.DisputeId - return protoreflect.ValueOfUint64(value) + case "layer.dispute.MsgProposeDispute.report": + value := x.Report + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "layer.dispute.MsgProposeDispute.dispute_category": + value := x.DisputeCategory + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "layer.dispute.MsgProposeDispute.fee": + value := x.Fee + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "layer.dispute.MsgProposeDispute.pay_from_bond": + value := x.PayFromBond + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDispute does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", descriptor.FullName())) } } @@ -2035,17 +2080,23 @@ func (x *fastReflection_MsgExecuteDispute) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecuteDispute) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgProposeDispute) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "layer.dispute.MsgExecuteDispute.caller_address": - x.CallerAddress = value.Interface().(string) - case "layer.dispute.MsgExecuteDispute.dispute_id": - x.DisputeId = value.Uint() + case "layer.dispute.MsgProposeDispute.creator": + x.Creator = value.Interface().(string) + case "layer.dispute.MsgProposeDispute.report": + x.Report = value.Message().Interface().(*oracle.MicroReport) + case "layer.dispute.MsgProposeDispute.dispute_category": + x.DisputeCategory = (DisputeCategory)(value.Enum()) + case "layer.dispute.MsgProposeDispute.fee": + x.Fee = value.Message().Interface().(*v1beta1.Coin) + case "layer.dispute.MsgProposeDispute.pay_from_bond": + x.PayFromBond = value.Bool() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) } } @@ -2059,44 +2110,64 @@ func (x *fastReflection_MsgExecuteDispute) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecuteDispute) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgProposeDispute) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgExecuteDispute.caller_address": - panic(fmt.Errorf("field caller_address of message layer.dispute.MsgExecuteDispute is not mutable")) - case "layer.dispute.MsgExecuteDispute.dispute_id": - panic(fmt.Errorf("field dispute_id of message layer.dispute.MsgExecuteDispute is not mutable")) + case "layer.dispute.MsgProposeDispute.report": + if x.Report == nil { + x.Report = new(oracle.MicroReport) + } + return protoreflect.ValueOfMessage(x.Report.ProtoReflect()) + case "layer.dispute.MsgProposeDispute.fee": + if x.Fee == nil { + x.Fee = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Fee.ProtoReflect()) + case "layer.dispute.MsgProposeDispute.creator": + panic(fmt.Errorf("field creator of message layer.dispute.MsgProposeDispute is not mutable")) + case "layer.dispute.MsgProposeDispute.dispute_category": + panic(fmt.Errorf("field dispute_category of message layer.dispute.MsgProposeDispute is not mutable")) + case "layer.dispute.MsgProposeDispute.pay_from_bond": + panic(fmt.Errorf("field pay_from_bond of message layer.dispute.MsgProposeDispute is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgExecuteDispute) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgProposeDispute) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgExecuteDispute.caller_address": + case "layer.dispute.MsgProposeDispute.creator": return protoreflect.ValueOfString("") - case "layer.dispute.MsgExecuteDispute.dispute_id": - return protoreflect.ValueOfUint64(uint64(0)) + case "layer.dispute.MsgProposeDispute.report": + m := new(oracle.MicroReport) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "layer.dispute.MsgProposeDispute.dispute_category": + return protoreflect.ValueOfEnum(0) + case "layer.dispute.MsgProposeDispute.fee": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "layer.dispute.MsgProposeDispute.pay_from_bond": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgExecuteDispute) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgProposeDispute) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgExecuteDispute", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgProposeDispute", d.FullName())) } panic("unreachable") } @@ -2104,7 +2175,7 @@ func (x *fastReflection_MsgExecuteDispute) WhichOneof(d protoreflect.OneofDescri // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgExecuteDispute) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgProposeDispute) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2115,7 +2186,7 @@ func (x *fastReflection_MsgExecuteDispute) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecuteDispute) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgProposeDispute) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2127,7 +2198,7 @@ func (x *fastReflection_MsgExecuteDispute) SetUnknown(fields protoreflect.RawFie // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgExecuteDispute) IsValid() bool { +func (x *fastReflection_MsgProposeDispute) IsValid() bool { return x != nil } @@ -2137,9 +2208,9 @@ func (x *fastReflection_MsgExecuteDispute) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgExecuteDispute) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgExecuteDispute) + x := input.Message.Interface().(*MsgProposeDispute) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2151,12 +2222,23 @@ func (x *fastReflection_MsgExecuteDispute) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.CallerAddress) + l = len(x.Creator) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.DisputeId != 0 { - n += 1 + runtime.Sov(uint64(x.DisputeId)) + if x.Report != nil { + l = options.Size(x.Report) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.DisputeCategory != 0 { + n += 1 + runtime.Sov(uint64(x.DisputeCategory)) + } + if x.Fee != nil { + l = options.Size(x.Fee) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.PayFromBond { + n += 2 } if x.unknownFields != nil { n += len(x.unknownFields) @@ -2168,7 +2250,7 @@ func (x *fastReflection_MsgExecuteDispute) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgExecuteDispute) + x := input.Message.Interface().(*MsgProposeDispute) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2187,15 +2269,53 @@ func (x *fastReflection_MsgExecuteDispute) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.DisputeId != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.DisputeId)) + if x.PayFromBond { i-- - dAtA[i] = 0x10 + if x.PayFromBond { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 } - if len(x.CallerAddress) > 0 { - i -= len(x.CallerAddress) - copy(dAtA[i:], x.CallerAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CallerAddress))) + if x.Fee != nil { + encoded, err := options.Marshal(x.Fee) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x22 + } + if x.DisputeCategory != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DisputeCategory)) + i-- + dAtA[i] = 0x18 + } + if x.Report != nil { + encoded, err := options.Marshal(x.Report) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Creator) > 0 { + i -= len(x.Creator) + copy(dAtA[i:], x.Creator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Creator))) i-- dAtA[i] = 0xa } @@ -2210,7 +2330,7 @@ func (x *fastReflection_MsgExecuteDispute) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgExecuteDispute) + x := input.Message.Interface().(*MsgProposeDispute) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2242,15 +2362,15 @@ func (x *fastReflection_MsgExecuteDispute) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteDispute: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProposeDispute: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteDispute: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProposeDispute: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CallerAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2278,13 +2398,13 @@ func (x *fastReflection_MsgExecuteDispute) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.CallerAddress = string(dAtA[iNdEx:postIndex]) + x.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Report", wireType) } - x.DisputeId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2294,789 +2414,52 @@ func (x *fastReflection_MsgExecuteDispute) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.DisputeId |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgExecuteDisputeResponse protoreflect.MessageDescriptor -) - -func init() { - file_layer_dispute_tx_proto_init() - md_MsgExecuteDisputeResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgExecuteDisputeResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgExecuteDisputeResponse)(nil) - -type fastReflection_MsgExecuteDisputeResponse MsgExecuteDisputeResponse - -func (x *MsgExecuteDisputeResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgExecuteDisputeResponse)(x) -} - -func (x *MsgExecuteDisputeResponse) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgExecuteDisputeResponse_messageType fastReflection_MsgExecuteDisputeResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgExecuteDisputeResponse_messageType{} - -type fastReflection_MsgExecuteDisputeResponse_messageType struct{} - -func (x fastReflection_MsgExecuteDisputeResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgExecuteDisputeResponse)(nil) -} -func (x fastReflection_MsgExecuteDisputeResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgExecuteDisputeResponse) -} -func (x fastReflection_MsgExecuteDisputeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgExecuteDisputeResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgExecuteDisputeResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgExecuteDisputeResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgExecuteDisputeResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgExecuteDisputeResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgExecuteDisputeResponse) New() protoreflect.Message { - return new(fastReflection_MsgExecuteDisputeResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgExecuteDisputeResponse) Interface() protoreflect.ProtoMessage { - return (*MsgExecuteDisputeResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgExecuteDisputeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgExecuteDisputeResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDisputeResponse")) - } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDisputeResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecuteDisputeResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDisputeResponse")) - } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDisputeResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgExecuteDisputeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDisputeResponse")) - } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDisputeResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecuteDisputeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDisputeResponse")) - } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDisputeResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecuteDisputeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDisputeResponse")) - } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDisputeResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgExecuteDisputeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgExecuteDisputeResponse")) - } - panic(fmt.Errorf("message layer.dispute.MsgExecuteDisputeResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgExecuteDisputeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgExecuteDisputeResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgExecuteDisputeResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecuteDisputeResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgExecuteDisputeResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgExecuteDisputeResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgExecuteDisputeResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgExecuteDisputeResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgExecuteDisputeResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteDisputeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteDisputeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgTallyVote protoreflect.MessageDescriptor - fd_MsgTallyVote_caller_address protoreflect.FieldDescriptor - fd_MsgTallyVote_dispute_id protoreflect.FieldDescriptor -) - -func init() { - file_layer_dispute_tx_proto_init() - md_MsgTallyVote = File_layer_dispute_tx_proto.Messages().ByName("MsgTallyVote") - fd_MsgTallyVote_caller_address = md_MsgTallyVote.Fields().ByName("caller_address") - fd_MsgTallyVote_dispute_id = md_MsgTallyVote.Fields().ByName("dispute_id") -} - -var _ protoreflect.Message = (*fastReflection_MsgTallyVote)(nil) - -type fastReflection_MsgTallyVote MsgTallyVote - -func (x *MsgTallyVote) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgTallyVote)(x) -} - -func (x *MsgTallyVote) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgTallyVote_messageType fastReflection_MsgTallyVote_messageType -var _ protoreflect.MessageType = fastReflection_MsgTallyVote_messageType{} - -type fastReflection_MsgTallyVote_messageType struct{} - -func (x fastReflection_MsgTallyVote_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgTallyVote)(nil) -} -func (x fastReflection_MsgTallyVote_messageType) New() protoreflect.Message { - return new(fastReflection_MsgTallyVote) -} -func (x fastReflection_MsgTallyVote_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgTallyVote -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgTallyVote) Descriptor() protoreflect.MessageDescriptor { - return md_MsgTallyVote -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgTallyVote) Type() protoreflect.MessageType { - return _fastReflection_MsgTallyVote_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgTallyVote) New() protoreflect.Message { - return new(fastReflection_MsgTallyVote) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgTallyVote) Interface() protoreflect.ProtoMessage { - return (*MsgTallyVote)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgTallyVote) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.CallerAddress != "" { - value := protoreflect.ValueOfString(x.CallerAddress) - if !f(fd_MsgTallyVote_caller_address, value) { - return - } - } - if x.DisputeId != uint64(0) { - value := protoreflect.ValueOfUint64(x.DisputeId) - if !f(fd_MsgTallyVote_dispute_id, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgTallyVote) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "layer.dispute.MsgTallyVote.caller_address": - return x.CallerAddress != "" - case "layer.dispute.MsgTallyVote.dispute_id": - return x.DisputeId != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVote")) - } - panic(fmt.Errorf("message layer.dispute.MsgTallyVote does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTallyVote) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "layer.dispute.MsgTallyVote.caller_address": - x.CallerAddress = "" - case "layer.dispute.MsgTallyVote.dispute_id": - x.DisputeId = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVote")) - } - panic(fmt.Errorf("message layer.dispute.MsgTallyVote does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgTallyVote) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "layer.dispute.MsgTallyVote.caller_address": - value := x.CallerAddress - return protoreflect.ValueOfString(value) - case "layer.dispute.MsgTallyVote.dispute_id": - value := x.DisputeId - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVote")) - } - panic(fmt.Errorf("message layer.dispute.MsgTallyVote does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTallyVote) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "layer.dispute.MsgTallyVote.caller_address": - x.CallerAddress = value.Interface().(string) - case "layer.dispute.MsgTallyVote.dispute_id": - x.DisputeId = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVote")) - } - panic(fmt.Errorf("message layer.dispute.MsgTallyVote does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTallyVote) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "layer.dispute.MsgTallyVote.caller_address": - panic(fmt.Errorf("field caller_address of message layer.dispute.MsgTallyVote is not mutable")) - case "layer.dispute.MsgTallyVote.dispute_id": - panic(fmt.Errorf("field dispute_id of message layer.dispute.MsgTallyVote is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVote")) - } - panic(fmt.Errorf("message layer.dispute.MsgTallyVote does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgTallyVote) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "layer.dispute.MsgTallyVote.caller_address": - return protoreflect.ValueOfString("") - case "layer.dispute.MsgTallyVote.dispute_id": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVote")) - } - panic(fmt.Errorf("message layer.dispute.MsgTallyVote does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgTallyVote) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgTallyVote", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgTallyVote) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTallyVote) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgTallyVote) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgTallyVote) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgTallyVote) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.CallerAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.DisputeId != 0 { - n += 1 + runtime.Sov(uint64(x.DisputeId)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgTallyVote) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.DisputeId != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.DisputeId)) - i-- - dAtA[i] = 0x10 - } - if len(x.CallerAddress) > 0 { - i -= len(x.CallerAddress) - copy(dAtA[i:], x.CallerAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CallerAddress))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgTallyVote) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - if iNdEx >= l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if x.Report == nil { + x.Report = &oracle.MicroReport{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTallyVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTallyVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Report); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisputeCategory", wireType) + } + x.DisputeCategory = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.DisputeCategory |= DisputeCategory(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CallerAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3086,29 +2469,33 @@ func (x *fastReflection_MsgTallyVote) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.CallerAddress = string(dAtA[iNdEx:postIndex]) + if x.Fee == nil { + x.Fee = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Fee); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex - case 2: + case 5: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PayFromBond", wireType) } - x.DisputeId = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3118,11 +2505,12 @@ func (x *fastReflection_MsgTallyVote) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.DisputeId |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } + x.PayFromBond = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3159,24 +2547,24 @@ func (x *fastReflection_MsgTallyVote) ProtoMethods() *protoiface.Methods { } var ( - md_MsgTallyVoteResponse protoreflect.MessageDescriptor + md_MsgProposeDisputeResponse protoreflect.MessageDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgTallyVoteResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgTallyVoteResponse") + md_MsgProposeDisputeResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgProposeDisputeResponse") } -var _ protoreflect.Message = (*fastReflection_MsgTallyVoteResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgProposeDisputeResponse)(nil) -type fastReflection_MsgTallyVoteResponse MsgTallyVoteResponse +type fastReflection_MsgProposeDisputeResponse MsgProposeDisputeResponse -func (x *MsgTallyVoteResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgTallyVoteResponse)(x) +func (x *MsgProposeDisputeResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgProposeDisputeResponse)(x) } -func (x *MsgTallyVoteResponse) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[7] +func (x *MsgProposeDisputeResponse) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3187,43 +2575,43 @@ func (x *MsgTallyVoteResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgTallyVoteResponse_messageType fastReflection_MsgTallyVoteResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgTallyVoteResponse_messageType{} +var _fastReflection_MsgProposeDisputeResponse_messageType fastReflection_MsgProposeDisputeResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgProposeDisputeResponse_messageType{} -type fastReflection_MsgTallyVoteResponse_messageType struct{} +type fastReflection_MsgProposeDisputeResponse_messageType struct{} -func (x fastReflection_MsgTallyVoteResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgTallyVoteResponse)(nil) +func (x fastReflection_MsgProposeDisputeResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgProposeDisputeResponse)(nil) } -func (x fastReflection_MsgTallyVoteResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgTallyVoteResponse) +func (x fastReflection_MsgProposeDisputeResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgProposeDisputeResponse) } -func (x fastReflection_MsgTallyVoteResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgTallyVoteResponse +func (x fastReflection_MsgProposeDisputeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgProposeDisputeResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgTallyVoteResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgTallyVoteResponse +func (x *fastReflection_MsgProposeDisputeResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgProposeDisputeResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgTallyVoteResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgTallyVoteResponse_messageType +func (x *fastReflection_MsgProposeDisputeResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgProposeDisputeResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgTallyVoteResponse) New() protoreflect.Message { - return new(fastReflection_MsgTallyVoteResponse) +func (x *fastReflection_MsgProposeDisputeResponse) New() protoreflect.Message { + return new(fastReflection_MsgProposeDisputeResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgTallyVoteResponse) Interface() protoreflect.ProtoMessage { - return (*MsgTallyVoteResponse)(x) +func (x *fastReflection_MsgProposeDisputeResponse) Interface() protoreflect.ProtoMessage { + return (*MsgProposeDisputeResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -3231,7 +2619,7 @@ func (x *fastReflection_MsgTallyVoteResponse) Interface() protoreflect.ProtoMess // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgTallyVoteResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgProposeDisputeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -3245,13 +2633,13 @@ func (x *fastReflection_MsgTallyVoteResponse) Range(f func(protoreflect.FieldDes // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgTallyVoteResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgProposeDisputeResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgTallyVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) } } @@ -3261,13 +2649,13 @@ func (x *fastReflection_MsgTallyVoteResponse) Has(fd protoreflect.FieldDescripto // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTallyVoteResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgProposeDisputeResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgTallyVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) } } @@ -3277,13 +2665,13 @@ func (x *fastReflection_MsgTallyVoteResponse) Clear(fd protoreflect.FieldDescrip // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgTallyVoteResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgProposeDisputeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgTallyVoteResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", descriptor.FullName())) } } @@ -3297,13 +2685,13 @@ func (x *fastReflection_MsgTallyVoteResponse) Get(descriptor protoreflect.FieldD // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTallyVoteResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgProposeDisputeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgTallyVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) } } @@ -3317,36 +2705,36 @@ func (x *fastReflection_MsgTallyVoteResponse) Set(fd protoreflect.FieldDescripto // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTallyVoteResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgProposeDisputeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgTallyVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgTallyVoteResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgProposeDisputeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgTallyVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgTallyVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgTallyVoteResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgProposeDisputeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgTallyVoteResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgProposeDisputeResponse", d.FullName())) } panic("unreachable") } @@ -3354,7 +2742,7 @@ func (x *fastReflection_MsgTallyVoteResponse) WhichOneof(d protoreflect.OneofDes // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgTallyVoteResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgProposeDisputeResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3365,7 +2753,7 @@ func (x *fastReflection_MsgTallyVoteResponse) GetUnknown() protoreflect.RawField // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTallyVoteResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgProposeDisputeResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3377,7 +2765,7 @@ func (x *fastReflection_MsgTallyVoteResponse) SetUnknown(fields protoreflect.Raw // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgTallyVoteResponse) IsValid() bool { +func (x *fastReflection_MsgProposeDisputeResponse) IsValid() bool { return x != nil } @@ -3387,9 +2775,9 @@ func (x *fastReflection_MsgTallyVoteResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgTallyVoteResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgProposeDisputeResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgTallyVoteResponse) + x := input.Message.Interface().(*MsgProposeDisputeResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3411,7 +2799,7 @@ func (x *fastReflection_MsgTallyVoteResponse) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgTallyVoteResponse) + x := input.Message.Interface().(*MsgProposeDisputeResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3441,7 +2829,7 @@ func (x *fastReflection_MsgTallyVoteResponse) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgTallyVoteResponse) + x := input.Message.Interface().(*MsgProposeDisputeResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3473,10 +2861,10 @@ func (x *fastReflection_MsgTallyVoteResponse) ProtoMethods() *protoiface.Methods fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTallyVoteResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProposeDisputeResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTallyVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProposeDisputeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3515,34 +2903,32 @@ func (x *fastReflection_MsgTallyVoteResponse) ProtoMethods() *protoiface.Methods } var ( - md_MsgProposeDispute protoreflect.MessageDescriptor - fd_MsgProposeDispute_creator protoreflect.FieldDescriptor - fd_MsgProposeDispute_report protoreflect.FieldDescriptor - fd_MsgProposeDispute_dispute_category protoreflect.FieldDescriptor - fd_MsgProposeDispute_fee protoreflect.FieldDescriptor - fd_MsgProposeDispute_pay_from_bond protoreflect.FieldDescriptor + md_MsgAddFeeToDispute protoreflect.MessageDescriptor + fd_MsgAddFeeToDispute_creator protoreflect.FieldDescriptor + fd_MsgAddFeeToDispute_dispute_id protoreflect.FieldDescriptor + fd_MsgAddFeeToDispute_amount protoreflect.FieldDescriptor + fd_MsgAddFeeToDispute_pay_from_bond protoreflect.FieldDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgProposeDispute = File_layer_dispute_tx_proto.Messages().ByName("MsgProposeDispute") - fd_MsgProposeDispute_creator = md_MsgProposeDispute.Fields().ByName("creator") - fd_MsgProposeDispute_report = md_MsgProposeDispute.Fields().ByName("report") - fd_MsgProposeDispute_dispute_category = md_MsgProposeDispute.Fields().ByName("dispute_category") - fd_MsgProposeDispute_fee = md_MsgProposeDispute.Fields().ByName("fee") - fd_MsgProposeDispute_pay_from_bond = md_MsgProposeDispute.Fields().ByName("pay_from_bond") + md_MsgAddFeeToDispute = File_layer_dispute_tx_proto.Messages().ByName("MsgAddFeeToDispute") + fd_MsgAddFeeToDispute_creator = md_MsgAddFeeToDispute.Fields().ByName("creator") + fd_MsgAddFeeToDispute_dispute_id = md_MsgAddFeeToDispute.Fields().ByName("dispute_id") + fd_MsgAddFeeToDispute_amount = md_MsgAddFeeToDispute.Fields().ByName("amount") + fd_MsgAddFeeToDispute_pay_from_bond = md_MsgAddFeeToDispute.Fields().ByName("pay_from_bond") } -var _ protoreflect.Message = (*fastReflection_MsgProposeDispute)(nil) +var _ protoreflect.Message = (*fastReflection_MsgAddFeeToDispute)(nil) -type fastReflection_MsgProposeDispute MsgProposeDispute +type fastReflection_MsgAddFeeToDispute MsgAddFeeToDispute -func (x *MsgProposeDispute) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgProposeDispute)(x) +func (x *MsgAddFeeToDispute) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAddFeeToDispute)(x) } -func (x *MsgProposeDispute) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[8] +func (x *MsgAddFeeToDispute) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3553,43 +2939,43 @@ func (x *MsgProposeDispute) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgProposeDispute_messageType fastReflection_MsgProposeDispute_messageType -var _ protoreflect.MessageType = fastReflection_MsgProposeDispute_messageType{} +var _fastReflection_MsgAddFeeToDispute_messageType fastReflection_MsgAddFeeToDispute_messageType +var _ protoreflect.MessageType = fastReflection_MsgAddFeeToDispute_messageType{} -type fastReflection_MsgProposeDispute_messageType struct{} +type fastReflection_MsgAddFeeToDispute_messageType struct{} -func (x fastReflection_MsgProposeDispute_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgProposeDispute)(nil) +func (x fastReflection_MsgAddFeeToDispute_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAddFeeToDispute)(nil) } -func (x fastReflection_MsgProposeDispute_messageType) New() protoreflect.Message { - return new(fastReflection_MsgProposeDispute) +func (x fastReflection_MsgAddFeeToDispute_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAddFeeToDispute) } -func (x fastReflection_MsgProposeDispute_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgProposeDispute +func (x fastReflection_MsgAddFeeToDispute_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAddFeeToDispute } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgProposeDispute) Descriptor() protoreflect.MessageDescriptor { - return md_MsgProposeDispute +func (x *fastReflection_MsgAddFeeToDispute) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAddFeeToDispute } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgProposeDispute) Type() protoreflect.MessageType { - return _fastReflection_MsgProposeDispute_messageType +func (x *fastReflection_MsgAddFeeToDispute) Type() protoreflect.MessageType { + return _fastReflection_MsgAddFeeToDispute_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgProposeDispute) New() protoreflect.Message { - return new(fastReflection_MsgProposeDispute) +func (x *fastReflection_MsgAddFeeToDispute) New() protoreflect.Message { + return new(fastReflection_MsgAddFeeToDispute) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgProposeDispute) Interface() protoreflect.ProtoMessage { - return (*MsgProposeDispute)(x) +func (x *fastReflection_MsgAddFeeToDispute) Interface() protoreflect.ProtoMessage { + return (*MsgAddFeeToDispute)(x) } // Range iterates over every populated field in an undefined order, @@ -3597,34 +2983,28 @@ func (x *fastReflection_MsgProposeDispute) Interface() protoreflect.ProtoMessage // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgProposeDispute) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgAddFeeToDispute) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Creator != "" { value := protoreflect.ValueOfString(x.Creator) - if !f(fd_MsgProposeDispute_creator, value) { - return - } - } - if x.Report != nil { - value := protoreflect.ValueOfMessage(x.Report.ProtoReflect()) - if !f(fd_MsgProposeDispute_report, value) { + if !f(fd_MsgAddFeeToDispute_creator, value) { return } } - if x.DisputeCategory != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.DisputeCategory)) - if !f(fd_MsgProposeDispute_dispute_category, value) { + if x.DisputeId != uint64(0) { + value := protoreflect.ValueOfUint64(x.DisputeId) + if !f(fd_MsgAddFeeToDispute_dispute_id, value) { return } } - if x.Fee != nil { - value := protoreflect.ValueOfMessage(x.Fee.ProtoReflect()) - if !f(fd_MsgProposeDispute_fee, value) { + if x.Amount != nil { + value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + if !f(fd_MsgAddFeeToDispute_amount, value) { return } } if x.PayFromBond != false { value := protoreflect.ValueOfBool(x.PayFromBond) - if !f(fd_MsgProposeDispute_pay_from_bond, value) { + if !f(fd_MsgAddFeeToDispute_pay_from_bond, value) { return } } @@ -3641,23 +3021,21 @@ func (x *fastReflection_MsgProposeDispute) Range(f func(protoreflect.FieldDescri // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgProposeDispute) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgAddFeeToDispute) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "layer.dispute.MsgProposeDispute.creator": + case "layer.dispute.MsgAddFeeToDispute.creator": return x.Creator != "" - case "layer.dispute.MsgProposeDispute.report": - return x.Report != nil - case "layer.dispute.MsgProposeDispute.dispute_category": - return x.DisputeCategory != 0 - case "layer.dispute.MsgProposeDispute.fee": - return x.Fee != nil - case "layer.dispute.MsgProposeDispute.pay_from_bond": + case "layer.dispute.MsgAddFeeToDispute.dispute_id": + return x.DisputeId != uint64(0) + case "layer.dispute.MsgAddFeeToDispute.amount": + return x.Amount != nil + case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": return x.PayFromBond != false default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) } } @@ -3667,23 +3045,21 @@ func (x *fastReflection_MsgProposeDispute) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgProposeDispute) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgAddFeeToDispute) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "layer.dispute.MsgProposeDispute.creator": + case "layer.dispute.MsgAddFeeToDispute.creator": x.Creator = "" - case "layer.dispute.MsgProposeDispute.report": - x.Report = nil - case "layer.dispute.MsgProposeDispute.dispute_category": - x.DisputeCategory = 0 - case "layer.dispute.MsgProposeDispute.fee": - x.Fee = nil - case "layer.dispute.MsgProposeDispute.pay_from_bond": + case "layer.dispute.MsgAddFeeToDispute.dispute_id": + x.DisputeId = uint64(0) + case "layer.dispute.MsgAddFeeToDispute.amount": + x.Amount = nil + case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": x.PayFromBond = false default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) } } @@ -3693,28 +3069,25 @@ func (x *fastReflection_MsgProposeDispute) Clear(fd protoreflect.FieldDescriptor // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgProposeDispute) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgAddFeeToDispute) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "layer.dispute.MsgProposeDispute.creator": + case "layer.dispute.MsgAddFeeToDispute.creator": value := x.Creator return protoreflect.ValueOfString(value) - case "layer.dispute.MsgProposeDispute.report": - value := x.Report - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "layer.dispute.MsgProposeDispute.dispute_category": - value := x.DisputeCategory - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "layer.dispute.MsgProposeDispute.fee": - value := x.Fee + case "layer.dispute.MsgAddFeeToDispute.dispute_id": + value := x.DisputeId + return protoreflect.ValueOfUint64(value) + case "layer.dispute.MsgAddFeeToDispute.amount": + value := x.Amount return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "layer.dispute.MsgProposeDispute.pay_from_bond": + case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": value := x.PayFromBond return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", descriptor.FullName())) } } @@ -3728,23 +3101,21 @@ func (x *fastReflection_MsgProposeDispute) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgProposeDispute) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgAddFeeToDispute) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "layer.dispute.MsgProposeDispute.creator": + case "layer.dispute.MsgAddFeeToDispute.creator": x.Creator = value.Interface().(string) - case "layer.dispute.MsgProposeDispute.report": - x.Report = value.Message().Interface().(*oracle.MicroReport) - case "layer.dispute.MsgProposeDispute.dispute_category": - x.DisputeCategory = (DisputeCategory)(value.Enum()) - case "layer.dispute.MsgProposeDispute.fee": - x.Fee = value.Message().Interface().(*v1beta1.Coin) - case "layer.dispute.MsgProposeDispute.pay_from_bond": + case "layer.dispute.MsgAddFeeToDispute.dispute_id": + x.DisputeId = value.Uint() + case "layer.dispute.MsgAddFeeToDispute.amount": + x.Amount = value.Message().Interface().(*v1beta1.Coin) + case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": x.PayFromBond = value.Bool() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) } } @@ -3754,68 +3125,60 @@ func (x *fastReflection_MsgProposeDispute) Set(fd protoreflect.FieldDescriptor, // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgProposeDispute) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "layer.dispute.MsgProposeDispute.report": - if x.Report == nil { - x.Report = new(oracle.MicroReport) - } - return protoreflect.ValueOfMessage(x.Report.ProtoReflect()) - case "layer.dispute.MsgProposeDispute.fee": - if x.Fee == nil { - x.Fee = new(v1beta1.Coin) +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAddFeeToDispute) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "layer.dispute.MsgAddFeeToDispute.amount": + if x.Amount == nil { + x.Amount = new(v1beta1.Coin) } - return protoreflect.ValueOfMessage(x.Fee.ProtoReflect()) - case "layer.dispute.MsgProposeDispute.creator": - panic(fmt.Errorf("field creator of message layer.dispute.MsgProposeDispute is not mutable")) - case "layer.dispute.MsgProposeDispute.dispute_category": - panic(fmt.Errorf("field dispute_category of message layer.dispute.MsgProposeDispute is not mutable")) - case "layer.dispute.MsgProposeDispute.pay_from_bond": - panic(fmt.Errorf("field pay_from_bond of message layer.dispute.MsgProposeDispute is not mutable")) + return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + case "layer.dispute.MsgAddFeeToDispute.creator": + panic(fmt.Errorf("field creator of message layer.dispute.MsgAddFeeToDispute is not mutable")) + case "layer.dispute.MsgAddFeeToDispute.dispute_id": + panic(fmt.Errorf("field dispute_id of message layer.dispute.MsgAddFeeToDispute is not mutable")) + case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": + panic(fmt.Errorf("field pay_from_bond of message layer.dispute.MsgAddFeeToDispute is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgProposeDispute) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgAddFeeToDispute) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgProposeDispute.creator": + case "layer.dispute.MsgAddFeeToDispute.creator": return protoreflect.ValueOfString("") - case "layer.dispute.MsgProposeDispute.report": - m := new(oracle.MicroReport) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "layer.dispute.MsgProposeDispute.dispute_category": - return protoreflect.ValueOfEnum(0) - case "layer.dispute.MsgProposeDispute.fee": + case "layer.dispute.MsgAddFeeToDispute.dispute_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "layer.dispute.MsgAddFeeToDispute.amount": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "layer.dispute.MsgProposeDispute.pay_from_bond": + case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgProposeDispute) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgAddFeeToDispute) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgProposeDispute", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgAddFeeToDispute", d.FullName())) } panic("unreachable") } @@ -3823,7 +3186,7 @@ func (x *fastReflection_MsgProposeDispute) WhichOneof(d protoreflect.OneofDescri // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgProposeDispute) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgAddFeeToDispute) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3834,7 +3197,7 @@ func (x *fastReflection_MsgProposeDispute) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgProposeDispute) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgAddFeeToDispute) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3846,7 +3209,7 @@ func (x *fastReflection_MsgProposeDispute) SetUnknown(fields protoreflect.RawFie // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgProposeDispute) IsValid() bool { +func (x *fastReflection_MsgAddFeeToDispute) IsValid() bool { return x != nil } @@ -3856,9 +3219,9 @@ func (x *fastReflection_MsgProposeDispute) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgProposeDispute) + x := input.Message.Interface().(*MsgAddFeeToDispute) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3874,15 +3237,11 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Report != nil { - l = options.Size(x.Report) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.DisputeCategory != 0 { - n += 1 + runtime.Sov(uint64(x.DisputeCategory)) + if x.DisputeId != 0 { + n += 1 + runtime.Sov(uint64(x.DisputeId)) } - if x.Fee != nil { - l = options.Size(x.Fee) + if x.Amount != nil { + l = options.Size(x.Amount) n += 1 + l + runtime.Sov(uint64(l)) } if x.PayFromBond { @@ -3898,7 +3257,7 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgProposeDispute) + x := input.Message.Interface().(*MsgAddFeeToDispute) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3925,10 +3284,10 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } - if x.Fee != nil { - encoded, err := options.Marshal(x.Fee) + if x.Amount != nil { + encoded, err := options.Marshal(x.Amount) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3939,26 +3298,12 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x22 - } - if x.DisputeCategory != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.DisputeCategory)) - i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if x.Report != nil { - encoded, err := options.Marshal(x.Report) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if x.DisputeId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DisputeId)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } if len(x.Creator) > 0 { i -= len(x.Creator) @@ -3978,7 +3323,7 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgProposeDispute) + x := input.Message.Interface().(*MsgAddFeeToDispute) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4010,10 +3355,10 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProposeDispute: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddFeeToDispute: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProposeDispute: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddFeeToDispute: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4049,46 +3394,10 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { x.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Report", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Report == nil { - x.Report = &oracle.MicroReport{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Report); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisputeCategory", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) } - x.DisputeCategory = 0 + x.DisputeId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4098,14 +3407,14 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.DisputeCategory |= DisputeCategory(b&0x7F) << shift + x.DisputeId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: + case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4132,14 +3441,14 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Fee == nil { - x.Fee = &v1beta1.Coin{} + if x.Amount == nil { + x.Amount = &v1beta1.Coin{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Fee); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 5: + case 4: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PayFromBond", wireType) } @@ -4195,24 +3504,24 @@ func (x *fastReflection_MsgProposeDispute) ProtoMethods() *protoiface.Methods { } var ( - md_MsgProposeDisputeResponse protoreflect.MessageDescriptor + md_MsgAddFeeToDisputeResponse protoreflect.MessageDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgProposeDisputeResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgProposeDisputeResponse") + md_MsgAddFeeToDisputeResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgAddFeeToDisputeResponse") } -var _ protoreflect.Message = (*fastReflection_MsgProposeDisputeResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgAddFeeToDisputeResponse)(nil) -type fastReflection_MsgProposeDisputeResponse MsgProposeDisputeResponse +type fastReflection_MsgAddFeeToDisputeResponse MsgAddFeeToDisputeResponse -func (x *MsgProposeDisputeResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgProposeDisputeResponse)(x) +func (x *MsgAddFeeToDisputeResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAddFeeToDisputeResponse)(x) } -func (x *MsgProposeDisputeResponse) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[9] +func (x *MsgAddFeeToDisputeResponse) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4223,43 +3532,43 @@ func (x *MsgProposeDisputeResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgProposeDisputeResponse_messageType fastReflection_MsgProposeDisputeResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgProposeDisputeResponse_messageType{} +var _fastReflection_MsgAddFeeToDisputeResponse_messageType fastReflection_MsgAddFeeToDisputeResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgAddFeeToDisputeResponse_messageType{} -type fastReflection_MsgProposeDisputeResponse_messageType struct{} +type fastReflection_MsgAddFeeToDisputeResponse_messageType struct{} -func (x fastReflection_MsgProposeDisputeResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgProposeDisputeResponse)(nil) +func (x fastReflection_MsgAddFeeToDisputeResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAddFeeToDisputeResponse)(nil) } -func (x fastReflection_MsgProposeDisputeResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgProposeDisputeResponse) +func (x fastReflection_MsgAddFeeToDisputeResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAddFeeToDisputeResponse) } -func (x fastReflection_MsgProposeDisputeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgProposeDisputeResponse +func (x fastReflection_MsgAddFeeToDisputeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAddFeeToDisputeResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgProposeDisputeResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgProposeDisputeResponse +func (x *fastReflection_MsgAddFeeToDisputeResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAddFeeToDisputeResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgProposeDisputeResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgProposeDisputeResponse_messageType +func (x *fastReflection_MsgAddFeeToDisputeResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgAddFeeToDisputeResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgProposeDisputeResponse) New() protoreflect.Message { - return new(fastReflection_MsgProposeDisputeResponse) +func (x *fastReflection_MsgAddFeeToDisputeResponse) New() protoreflect.Message { + return new(fastReflection_MsgAddFeeToDisputeResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgProposeDisputeResponse) Interface() protoreflect.ProtoMessage { - return (*MsgProposeDisputeResponse)(x) +func (x *fastReflection_MsgAddFeeToDisputeResponse) Interface() protoreflect.ProtoMessage { + return (*MsgAddFeeToDisputeResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -4267,7 +3576,7 @@ func (x *fastReflection_MsgProposeDisputeResponse) Interface() protoreflect.Prot // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgProposeDisputeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgAddFeeToDisputeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -4281,13 +3590,13 @@ func (x *fastReflection_MsgProposeDisputeResponse) Range(f func(protoreflect.Fie // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgProposeDisputeResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgAddFeeToDisputeResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) } } @@ -4297,13 +3606,13 @@ func (x *fastReflection_MsgProposeDisputeResponse) Has(fd protoreflect.FieldDesc // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgProposeDisputeResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgAddFeeToDisputeResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) } } @@ -4313,13 +3622,13 @@ func (x *fastReflection_MsgProposeDisputeResponse) Clear(fd protoreflect.FieldDe // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgProposeDisputeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgAddFeeToDisputeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", descriptor.FullName())) } } @@ -4333,13 +3642,13 @@ func (x *fastReflection_MsgProposeDisputeResponse) Get(descriptor protoreflect.F // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgProposeDisputeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgAddFeeToDisputeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) } } @@ -4353,36 +3662,36 @@ func (x *fastReflection_MsgProposeDisputeResponse) Set(fd protoreflect.FieldDesc // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgProposeDisputeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgAddFeeToDisputeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgProposeDisputeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgAddFeeToDisputeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgProposeDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgProposeDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgProposeDisputeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgAddFeeToDisputeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgProposeDisputeResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgAddFeeToDisputeResponse", d.FullName())) } panic("unreachable") } @@ -4390,7 +3699,7 @@ func (x *fastReflection_MsgProposeDisputeResponse) WhichOneof(d protoreflect.One // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgProposeDisputeResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgAddFeeToDisputeResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4401,7 +3710,7 @@ func (x *fastReflection_MsgProposeDisputeResponse) GetUnknown() protoreflect.Raw // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgProposeDisputeResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgAddFeeToDisputeResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4413,7 +3722,7 @@ func (x *fastReflection_MsgProposeDisputeResponse) SetUnknown(fields protoreflec // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgProposeDisputeResponse) IsValid() bool { +func (x *fastReflection_MsgAddFeeToDisputeResponse) IsValid() bool { return x != nil } @@ -4423,9 +3732,9 @@ func (x *fastReflection_MsgProposeDisputeResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgProposeDisputeResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgAddFeeToDisputeResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgProposeDisputeResponse) + x := input.Message.Interface().(*MsgAddFeeToDisputeResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4447,7 +3756,7 @@ func (x *fastReflection_MsgProposeDisputeResponse) ProtoMethods() *protoiface.Me } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgProposeDisputeResponse) + x := input.Message.Interface().(*MsgAddFeeToDisputeResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4477,7 +3786,7 @@ func (x *fastReflection_MsgProposeDisputeResponse) ProtoMethods() *protoiface.Me }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgProposeDisputeResponse) + x := input.Message.Interface().(*MsgAddFeeToDisputeResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4509,10 +3818,10 @@ func (x *fastReflection_MsgProposeDisputeResponse) ProtoMethods() *protoiface.Me fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProposeDisputeResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddFeeToDisputeResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProposeDisputeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddFeeToDisputeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -4551,32 +3860,30 @@ func (x *fastReflection_MsgProposeDisputeResponse) ProtoMethods() *protoiface.Me } var ( - md_MsgAddFeeToDispute protoreflect.MessageDescriptor - fd_MsgAddFeeToDispute_creator protoreflect.FieldDescriptor - fd_MsgAddFeeToDispute_dispute_id protoreflect.FieldDescriptor - fd_MsgAddFeeToDispute_amount protoreflect.FieldDescriptor - fd_MsgAddFeeToDispute_pay_from_bond protoreflect.FieldDescriptor + md_MsgVote protoreflect.MessageDescriptor + fd_MsgVote_voter protoreflect.FieldDescriptor + fd_MsgVote_id protoreflect.FieldDescriptor + fd_MsgVote_vote protoreflect.FieldDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgAddFeeToDispute = File_layer_dispute_tx_proto.Messages().ByName("MsgAddFeeToDispute") - fd_MsgAddFeeToDispute_creator = md_MsgAddFeeToDispute.Fields().ByName("creator") - fd_MsgAddFeeToDispute_dispute_id = md_MsgAddFeeToDispute.Fields().ByName("dispute_id") - fd_MsgAddFeeToDispute_amount = md_MsgAddFeeToDispute.Fields().ByName("amount") - fd_MsgAddFeeToDispute_pay_from_bond = md_MsgAddFeeToDispute.Fields().ByName("pay_from_bond") + md_MsgVote = File_layer_dispute_tx_proto.Messages().ByName("MsgVote") + fd_MsgVote_voter = md_MsgVote.Fields().ByName("voter") + fd_MsgVote_id = md_MsgVote.Fields().ByName("id") + fd_MsgVote_vote = md_MsgVote.Fields().ByName("vote") } -var _ protoreflect.Message = (*fastReflection_MsgAddFeeToDispute)(nil) +var _ protoreflect.Message = (*fastReflection_MsgVote)(nil) -type fastReflection_MsgAddFeeToDispute MsgAddFeeToDispute +type fastReflection_MsgVote MsgVote -func (x *MsgAddFeeToDispute) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgAddFeeToDispute)(x) +func (x *MsgVote) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgVote)(x) } -func (x *MsgAddFeeToDispute) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[10] +func (x *MsgVote) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4587,43 +3894,43 @@ func (x *MsgAddFeeToDispute) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgAddFeeToDispute_messageType fastReflection_MsgAddFeeToDispute_messageType -var _ protoreflect.MessageType = fastReflection_MsgAddFeeToDispute_messageType{} +var _fastReflection_MsgVote_messageType fastReflection_MsgVote_messageType +var _ protoreflect.MessageType = fastReflection_MsgVote_messageType{} -type fastReflection_MsgAddFeeToDispute_messageType struct{} +type fastReflection_MsgVote_messageType struct{} -func (x fastReflection_MsgAddFeeToDispute_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgAddFeeToDispute)(nil) +func (x fastReflection_MsgVote_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgVote)(nil) } -func (x fastReflection_MsgAddFeeToDispute_messageType) New() protoreflect.Message { - return new(fastReflection_MsgAddFeeToDispute) +func (x fastReflection_MsgVote_messageType) New() protoreflect.Message { + return new(fastReflection_MsgVote) } -func (x fastReflection_MsgAddFeeToDispute_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAddFeeToDispute +func (x fastReflection_MsgVote_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgVote } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgAddFeeToDispute) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAddFeeToDispute +func (x *fastReflection_MsgVote) Descriptor() protoreflect.MessageDescriptor { + return md_MsgVote } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgAddFeeToDispute) Type() protoreflect.MessageType { - return _fastReflection_MsgAddFeeToDispute_messageType +func (x *fastReflection_MsgVote) Type() protoreflect.MessageType { + return _fastReflection_MsgVote_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgAddFeeToDispute) New() protoreflect.Message { - return new(fastReflection_MsgAddFeeToDispute) +func (x *fastReflection_MsgVote) New() protoreflect.Message { + return new(fastReflection_MsgVote) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgAddFeeToDispute) Interface() protoreflect.ProtoMessage { - return (*MsgAddFeeToDispute)(x) +func (x *fastReflection_MsgVote) Interface() protoreflect.ProtoMessage { + return (*MsgVote)(x) } // Range iterates over every populated field in an undefined order, @@ -4631,28 +3938,22 @@ func (x *fastReflection_MsgAddFeeToDispute) Interface() protoreflect.ProtoMessag // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgAddFeeToDispute) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Creator != "" { - value := protoreflect.ValueOfString(x.Creator) - if !f(fd_MsgAddFeeToDispute_creator, value) { - return - } - } - if x.DisputeId != uint64(0) { - value := protoreflect.ValueOfUint64(x.DisputeId) - if !f(fd_MsgAddFeeToDispute_dispute_id, value) { +func (x *fastReflection_MsgVote) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Voter != "" { + value := protoreflect.ValueOfString(x.Voter) + if !f(fd_MsgVote_voter, value) { return } } - if x.Amount != nil { - value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) - if !f(fd_MsgAddFeeToDispute_amount, value) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_MsgVote_id, value) { return } } - if x.PayFromBond != false { - value := protoreflect.ValueOfBool(x.PayFromBond) - if !f(fd_MsgAddFeeToDispute_pay_from_bond, value) { + if x.Vote != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Vote)) + if !f(fd_MsgVote_vote, value) { return } } @@ -4669,21 +3970,19 @@ func (x *fastReflection_MsgAddFeeToDispute) Range(f func(protoreflect.FieldDescr // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgAddFeeToDispute) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgVote) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "layer.dispute.MsgAddFeeToDispute.creator": - return x.Creator != "" - case "layer.dispute.MsgAddFeeToDispute.dispute_id": - return x.DisputeId != uint64(0) - case "layer.dispute.MsgAddFeeToDispute.amount": - return x.Amount != nil - case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": - return x.PayFromBond != false + case "layer.dispute.MsgVote.voter": + return x.Voter != "" + case "layer.dispute.MsgVote.id": + return x.Id != uint64(0) + case "layer.dispute.MsgVote.vote": + return x.Vote != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) } } @@ -4693,21 +3992,19 @@ func (x *fastReflection_MsgAddFeeToDispute) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddFeeToDispute) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgVote) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "layer.dispute.MsgAddFeeToDispute.creator": - x.Creator = "" - case "layer.dispute.MsgAddFeeToDispute.dispute_id": - x.DisputeId = uint64(0) - case "layer.dispute.MsgAddFeeToDispute.amount": - x.Amount = nil - case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": - x.PayFromBond = false + case "layer.dispute.MsgVote.voter": + x.Voter = "" + case "layer.dispute.MsgVote.id": + x.Id = uint64(0) + case "layer.dispute.MsgVote.vote": + x.Vote = 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) } } @@ -4717,25 +4014,22 @@ func (x *fastReflection_MsgAddFeeToDispute) Clear(fd protoreflect.FieldDescripto // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgAddFeeToDispute) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgVote) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "layer.dispute.MsgAddFeeToDispute.creator": - value := x.Creator + case "layer.dispute.MsgVote.voter": + value := x.Voter return protoreflect.ValueOfString(value) - case "layer.dispute.MsgAddFeeToDispute.dispute_id": - value := x.DisputeId + case "layer.dispute.MsgVote.id": + value := x.Id return protoreflect.ValueOfUint64(value) - case "layer.dispute.MsgAddFeeToDispute.amount": - value := x.Amount - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": - value := x.PayFromBond - return protoreflect.ValueOfBool(value) + case "layer.dispute.MsgVote.vote": + value := x.Vote + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", descriptor.FullName())) } } @@ -4749,21 +4043,19 @@ func (x *fastReflection_MsgAddFeeToDispute) Get(descriptor protoreflect.FieldDes // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddFeeToDispute) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgVote) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "layer.dispute.MsgAddFeeToDispute.creator": - x.Creator = value.Interface().(string) - case "layer.dispute.MsgAddFeeToDispute.dispute_id": - x.DisputeId = value.Uint() - case "layer.dispute.MsgAddFeeToDispute.amount": - x.Amount = value.Message().Interface().(*v1beta1.Coin) - case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": - x.PayFromBond = value.Bool() + case "layer.dispute.MsgVote.voter": + x.Voter = value.Interface().(string) + case "layer.dispute.MsgVote.id": + x.Id = value.Uint() + case "layer.dispute.MsgVote.vote": + x.Vote = (VoteEnum)(value.Enum()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) } } @@ -4777,56 +4069,48 @@ func (x *fastReflection_MsgAddFeeToDispute) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddFeeToDispute) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgVote) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgAddFeeToDispute.amount": - if x.Amount == nil { - x.Amount = new(v1beta1.Coin) - } - return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) - case "layer.dispute.MsgAddFeeToDispute.creator": - panic(fmt.Errorf("field creator of message layer.dispute.MsgAddFeeToDispute is not mutable")) - case "layer.dispute.MsgAddFeeToDispute.dispute_id": - panic(fmt.Errorf("field dispute_id of message layer.dispute.MsgAddFeeToDispute is not mutable")) - case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": - panic(fmt.Errorf("field pay_from_bond of message layer.dispute.MsgAddFeeToDispute is not mutable")) + case "layer.dispute.MsgVote.voter": + panic(fmt.Errorf("field voter of message layer.dispute.MsgVote is not mutable")) + case "layer.dispute.MsgVote.id": + panic(fmt.Errorf("field id of message layer.dispute.MsgVote is not mutable")) + case "layer.dispute.MsgVote.vote": + panic(fmt.Errorf("field vote of message layer.dispute.MsgVote is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgAddFeeToDispute) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgVote) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgAddFeeToDispute.creator": + case "layer.dispute.MsgVote.voter": return protoreflect.ValueOfString("") - case "layer.dispute.MsgAddFeeToDispute.dispute_id": + case "layer.dispute.MsgVote.id": return protoreflect.ValueOfUint64(uint64(0)) - case "layer.dispute.MsgAddFeeToDispute.amount": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "layer.dispute.MsgAddFeeToDispute.pay_from_bond": - return protoreflect.ValueOfBool(false) + case "layer.dispute.MsgVote.vote": + return protoreflect.ValueOfEnum(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDispute")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDispute does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgAddFeeToDispute) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgVote) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgAddFeeToDispute", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgVote", d.FullName())) } panic("unreachable") } @@ -4834,7 +4118,7 @@ func (x *fastReflection_MsgAddFeeToDispute) WhichOneof(d protoreflect.OneofDescr // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgAddFeeToDispute) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgVote) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4845,7 +4129,7 @@ func (x *fastReflection_MsgAddFeeToDispute) GetUnknown() protoreflect.RawFields // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddFeeToDispute) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgVote) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4857,7 +4141,7 @@ func (x *fastReflection_MsgAddFeeToDispute) SetUnknown(fields protoreflect.RawFi // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgAddFeeToDispute) IsValid() bool { +func (x *fastReflection_MsgVote) IsValid() bool { return x != nil } @@ -4867,9 +4151,9 @@ func (x *fastReflection_MsgAddFeeToDispute) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgAddFeeToDispute) + x := input.Message.Interface().(*MsgVote) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4881,19 +4165,15 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Creator) + l = len(x.Voter) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.DisputeId != 0 { - n += 1 + runtime.Sov(uint64(x.DisputeId)) - } - if x.Amount != nil { - l = options.Size(x.Amount) - n += 1 + l + runtime.Sov(uint64(l)) + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) } - if x.PayFromBond { - n += 2 + if x.Vote != 0 { + n += 1 + runtime.Sov(uint64(x.Vote)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -4905,7 +4185,7 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgAddFeeToDispute) + x := input.Message.Interface().(*MsgVote) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4924,39 +4204,20 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.PayFromBond { - i-- - if x.PayFromBond { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if x.Amount != nil { - encoded, err := options.Marshal(x.Amount) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if x.Vote != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Vote)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } - if x.DisputeId != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.DisputeId)) + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) i-- dAtA[i] = 0x10 } - if len(x.Creator) > 0 { - i -= len(x.Creator) - copy(dAtA[i:], x.Creator) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Creator))) + if len(x.Voter) > 0 { + i -= len(x.Voter) + copy(dAtA[i:], x.Voter) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Voter))) i-- dAtA[i] = 0xa } @@ -4971,7 +4232,7 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgAddFeeToDispute) + x := input.Message.Interface().(*MsgVote) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5003,15 +4264,15 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddFeeToDispute: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgVote: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddFeeToDispute: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgVote: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5039,13 +4300,13 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Creator = string(dAtA[iNdEx:postIndex]) + x.Voter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - x.DisputeId = 0 + x.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -5055,52 +4316,16 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.DisputeId |= uint64(b&0x7F) << shift + x.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Amount == nil { - x.Amount = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 4: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PayFromBond", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) } - var v int + x.Vote = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -5110,12 +4335,11 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + x.Vote |= VoteEnum(b&0x7F) << shift if b < 0x80 { break } } - x.PayFromBond = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -5152,24 +4376,24 @@ func (x *fastReflection_MsgAddFeeToDispute) ProtoMethods() *protoiface.Methods { } var ( - md_MsgAddFeeToDisputeResponse protoreflect.MessageDescriptor + md_MsgVoteResponse protoreflect.MessageDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgAddFeeToDisputeResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgAddFeeToDisputeResponse") + md_MsgVoteResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgVoteResponse") } -var _ protoreflect.Message = (*fastReflection_MsgAddFeeToDisputeResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgVoteResponse)(nil) -type fastReflection_MsgAddFeeToDisputeResponse MsgAddFeeToDisputeResponse +type fastReflection_MsgVoteResponse MsgVoteResponse -func (x *MsgAddFeeToDisputeResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgAddFeeToDisputeResponse)(x) +func (x *MsgVoteResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgVoteResponse)(x) } -func (x *MsgAddFeeToDisputeResponse) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[11] +func (x *MsgVoteResponse) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5180,43 +4404,43 @@ func (x *MsgAddFeeToDisputeResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgAddFeeToDisputeResponse_messageType fastReflection_MsgAddFeeToDisputeResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgAddFeeToDisputeResponse_messageType{} +var _fastReflection_MsgVoteResponse_messageType fastReflection_MsgVoteResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgVoteResponse_messageType{} -type fastReflection_MsgAddFeeToDisputeResponse_messageType struct{} +type fastReflection_MsgVoteResponse_messageType struct{} -func (x fastReflection_MsgAddFeeToDisputeResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgAddFeeToDisputeResponse)(nil) +func (x fastReflection_MsgVoteResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgVoteResponse)(nil) } -func (x fastReflection_MsgAddFeeToDisputeResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgAddFeeToDisputeResponse) +func (x fastReflection_MsgVoteResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgVoteResponse) } -func (x fastReflection_MsgAddFeeToDisputeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAddFeeToDisputeResponse +func (x fastReflection_MsgVoteResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgVoteResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAddFeeToDisputeResponse +func (x *fastReflection_MsgVoteResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgVoteResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgAddFeeToDisputeResponse_messageType +func (x *fastReflection_MsgVoteResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgVoteResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgAddFeeToDisputeResponse) New() protoreflect.Message { - return new(fastReflection_MsgAddFeeToDisputeResponse) +func (x *fastReflection_MsgVoteResponse) New() protoreflect.Message { + return new(fastReflection_MsgVoteResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Interface() protoreflect.ProtoMessage { - return (*MsgAddFeeToDisputeResponse)(x) +func (x *fastReflection_MsgVoteResponse) Interface() protoreflect.ProtoMessage { + return (*MsgVoteResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -5224,7 +4448,7 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) Interface() protoreflect.Pro // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgVoteResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -5238,13 +4462,13 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) Range(f func(protoreflect.Fi // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgVoteResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) } } @@ -5254,13 +4478,13 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) Has(fd protoreflect.FieldDes // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgVoteResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) } } @@ -5270,13 +4494,13 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) Clear(fd protoreflect.FieldD // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgVoteResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", descriptor.FullName())) } } @@ -5290,13 +4514,13 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) Get(descriptor protoreflect. // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgVoteResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) } } @@ -5310,36 +4534,36 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) Set(fd protoreflect.FieldDes // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddFeeToDisputeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgVoteResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgAddFeeToDisputeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgVoteResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgAddFeeToDisputeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgAddFeeToDisputeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgAddFeeToDisputeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgVoteResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgAddFeeToDisputeResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgVoteResponse", d.FullName())) } panic("unreachable") } @@ -5347,7 +4571,7 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) WhichOneof(d protoreflect.On // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgAddFeeToDisputeResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgVoteResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -5358,7 +4582,7 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) GetUnknown() protoreflect.Ra // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddFeeToDisputeResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgVoteResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -5370,7 +4594,7 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) SetUnknown(fields protorefle // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgAddFeeToDisputeResponse) IsValid() bool { +func (x *fastReflection_MsgVoteResponse) IsValid() bool { return x != nil } @@ -5380,9 +4604,9 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgAddFeeToDisputeResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgVoteResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgAddFeeToDisputeResponse) + x := input.Message.Interface().(*MsgVoteResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5404,7 +4628,7 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) ProtoMethods() *protoiface.M } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgAddFeeToDisputeResponse) + x := input.Message.Interface().(*MsgVoteResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5434,7 +4658,7 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) ProtoMethods() *protoiface.M }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgAddFeeToDisputeResponse) + x := input.Message.Interface().(*MsgVoteResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5466,10 +4690,10 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) ProtoMethods() *protoiface.M fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddFeeToDisputeResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgVoteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddFeeToDisputeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -5508,30 +4732,28 @@ func (x *fastReflection_MsgAddFeeToDisputeResponse) ProtoMethods() *protoiface.M } var ( - md_MsgVote protoreflect.MessageDescriptor - fd_MsgVote_voter protoreflect.FieldDescriptor - fd_MsgVote_id protoreflect.FieldDescriptor - fd_MsgVote_vote protoreflect.FieldDescriptor + md_MsgUpdateTeam protoreflect.MessageDescriptor + fd_MsgUpdateTeam_current_team_address protoreflect.FieldDescriptor + fd_MsgUpdateTeam_new_team_address protoreflect.FieldDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgVote = File_layer_dispute_tx_proto.Messages().ByName("MsgVote") - fd_MsgVote_voter = md_MsgVote.Fields().ByName("voter") - fd_MsgVote_id = md_MsgVote.Fields().ByName("id") - fd_MsgVote_vote = md_MsgVote.Fields().ByName("vote") + md_MsgUpdateTeam = File_layer_dispute_tx_proto.Messages().ByName("MsgUpdateTeam") + fd_MsgUpdateTeam_current_team_address = md_MsgUpdateTeam.Fields().ByName("current_team_address") + fd_MsgUpdateTeam_new_team_address = md_MsgUpdateTeam.Fields().ByName("new_team_address") } -var _ protoreflect.Message = (*fastReflection_MsgVote)(nil) +var _ protoreflect.Message = (*fastReflection_MsgUpdateTeam)(nil) -type fastReflection_MsgVote MsgVote +type fastReflection_MsgUpdateTeam MsgUpdateTeam -func (x *MsgVote) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgVote)(x) +func (x *MsgUpdateTeam) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateTeam)(x) } -func (x *MsgVote) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[12] +func (x *MsgUpdateTeam) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5542,43 +4764,43 @@ func (x *MsgVote) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgVote_messageType fastReflection_MsgVote_messageType -var _ protoreflect.MessageType = fastReflection_MsgVote_messageType{} +var _fastReflection_MsgUpdateTeam_messageType fastReflection_MsgUpdateTeam_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateTeam_messageType{} -type fastReflection_MsgVote_messageType struct{} +type fastReflection_MsgUpdateTeam_messageType struct{} -func (x fastReflection_MsgVote_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgVote)(nil) +func (x fastReflection_MsgUpdateTeam_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateTeam)(nil) } -func (x fastReflection_MsgVote_messageType) New() protoreflect.Message { - return new(fastReflection_MsgVote) +func (x fastReflection_MsgUpdateTeam_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateTeam) } -func (x fastReflection_MsgVote_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgVote +func (x fastReflection_MsgUpdateTeam_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateTeam } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgVote) Descriptor() protoreflect.MessageDescriptor { - return md_MsgVote +func (x *fastReflection_MsgUpdateTeam) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateTeam } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgVote) Type() protoreflect.MessageType { - return _fastReflection_MsgVote_messageType +func (x *fastReflection_MsgUpdateTeam) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateTeam_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgVote) New() protoreflect.Message { - return new(fastReflection_MsgVote) +func (x *fastReflection_MsgUpdateTeam) New() protoreflect.Message { + return new(fastReflection_MsgUpdateTeam) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgVote) Interface() protoreflect.ProtoMessage { - return (*MsgVote)(x) +func (x *fastReflection_MsgUpdateTeam) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateTeam)(x) } // Range iterates over every populated field in an undefined order, @@ -5586,22 +4808,16 @@ func (x *fastReflection_MsgVote) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgVote) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Voter != "" { - value := protoreflect.ValueOfString(x.Voter) - if !f(fd_MsgVote_voter, value) { - return - } - } - if x.Id != uint64(0) { - value := protoreflect.ValueOfUint64(x.Id) - if !f(fd_MsgVote_id, value) { +func (x *fastReflection_MsgUpdateTeam) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CurrentTeamAddress != "" { + value := protoreflect.ValueOfString(x.CurrentTeamAddress) + if !f(fd_MsgUpdateTeam_current_team_address, value) { return } } - if x.Vote != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Vote)) - if !f(fd_MsgVote_vote, value) { + if x.NewTeamAddress != "" { + value := protoreflect.ValueOfString(x.NewTeamAddress) + if !f(fd_MsgUpdateTeam_new_team_address, value) { return } } @@ -5618,19 +4834,17 @@ func (x *fastReflection_MsgVote) Range(f func(protoreflect.FieldDescriptor, prot // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgVote) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgUpdateTeam) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "layer.dispute.MsgVote.voter": - return x.Voter != "" - case "layer.dispute.MsgVote.id": - return x.Id != uint64(0) - case "layer.dispute.MsgVote.vote": - return x.Vote != 0 + case "layer.dispute.MsgUpdateTeam.current_team_address": + return x.CurrentTeamAddress != "" + case "layer.dispute.MsgUpdateTeam.new_team_address": + return x.NewTeamAddress != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) } - panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) } } @@ -5640,19 +4854,17 @@ func (x *fastReflection_MsgVote) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgVote) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgUpdateTeam) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "layer.dispute.MsgVote.voter": - x.Voter = "" - case "layer.dispute.MsgVote.id": - x.Id = uint64(0) - case "layer.dispute.MsgVote.vote": - x.Vote = 0 + case "layer.dispute.MsgUpdateTeam.current_team_address": + x.CurrentTeamAddress = "" + case "layer.dispute.MsgUpdateTeam.new_team_address": + x.NewTeamAddress = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) } - panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) } } @@ -5662,22 +4874,19 @@ func (x *fastReflection_MsgVote) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgVote) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateTeam) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "layer.dispute.MsgVote.voter": - value := x.Voter + case "layer.dispute.MsgUpdateTeam.current_team_address": + value := x.CurrentTeamAddress + return protoreflect.ValueOfString(value) + case "layer.dispute.MsgUpdateTeam.new_team_address": + value := x.NewTeamAddress return protoreflect.ValueOfString(value) - case "layer.dispute.MsgVote.id": - value := x.Id - return protoreflect.ValueOfUint64(value) - case "layer.dispute.MsgVote.vote": - value := x.Vote - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) } - panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", descriptor.FullName())) } } @@ -5691,19 +4900,17 @@ func (x *fastReflection_MsgVote) Get(descriptor protoreflect.FieldDescriptor) pr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgVote) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgUpdateTeam) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "layer.dispute.MsgVote.voter": - x.Voter = value.Interface().(string) - case "layer.dispute.MsgVote.id": - x.Id = value.Uint() - case "layer.dispute.MsgVote.vote": - x.Vote = (VoteEnum)(value.Enum()) + case "layer.dispute.MsgUpdateTeam.current_team_address": + x.CurrentTeamAddress = value.Interface().(string) + case "layer.dispute.MsgUpdateTeam.new_team_address": + x.NewTeamAddress = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) } - panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) } } @@ -5717,48 +4924,44 @@ func (x *fastReflection_MsgVote) Set(fd protoreflect.FieldDescriptor, value prot // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgVote) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateTeam) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgVote.voter": - panic(fmt.Errorf("field voter of message layer.dispute.MsgVote is not mutable")) - case "layer.dispute.MsgVote.id": - panic(fmt.Errorf("field id of message layer.dispute.MsgVote is not mutable")) - case "layer.dispute.MsgVote.vote": - panic(fmt.Errorf("field vote of message layer.dispute.MsgVote is not mutable")) + case "layer.dispute.MsgUpdateTeam.current_team_address": + panic(fmt.Errorf("field current_team_address of message layer.dispute.MsgUpdateTeam is not mutable")) + case "layer.dispute.MsgUpdateTeam.new_team_address": + panic(fmt.Errorf("field new_team_address of message layer.dispute.MsgUpdateTeam is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) } - panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgVote) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateTeam) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgVote.voter": + case "layer.dispute.MsgUpdateTeam.current_team_address": + return protoreflect.ValueOfString("") + case "layer.dispute.MsgUpdateTeam.new_team_address": return protoreflect.ValueOfString("") - case "layer.dispute.MsgVote.id": - return protoreflect.ValueOfUint64(uint64(0)) - case "layer.dispute.MsgVote.vote": - return protoreflect.ValueOfEnum(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVote")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) } - panic(fmt.Errorf("message layer.dispute.MsgVote does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgVote) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgUpdateTeam) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgVote", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgUpdateTeam", d.FullName())) } panic("unreachable") } @@ -5766,7 +4969,7 @@ func (x *fastReflection_MsgVote) WhichOneof(d protoreflect.OneofDescriptor) prot // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgVote) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgUpdateTeam) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -5777,7 +4980,7 @@ func (x *fastReflection_MsgVote) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgVote) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgUpdateTeam) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -5789,7 +4992,7 @@ func (x *fastReflection_MsgVote) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgVote) IsValid() bool { +func (x *fastReflection_MsgUpdateTeam) IsValid() bool { return x != nil } @@ -5799,9 +5002,9 @@ func (x *fastReflection_MsgVote) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgVote) + x := input.Message.Interface().(*MsgUpdateTeam) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5813,15 +5016,13 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Voter) + l = len(x.CurrentTeamAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) - } - if x.Vote != 0 { - n += 1 + runtime.Sov(uint64(x.Vote)) + l = len(x.NewTeamAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -5833,7 +5034,7 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgVote) + x := input.Message.Interface().(*MsgUpdateTeam) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5852,20 +5053,17 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Vote != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Vote)) - i-- - dAtA[i] = 0x18 - } - if x.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + if len(x.NewTeamAddress) > 0 { + i -= len(x.NewTeamAddress) + copy(dAtA[i:], x.NewTeamAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NewTeamAddress))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if len(x.Voter) > 0 { - i -= len(x.Voter) - copy(dAtA[i:], x.Voter) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Voter))) + if len(x.CurrentTeamAddress) > 0 { + i -= len(x.CurrentTeamAddress) + copy(dAtA[i:], x.CurrentTeamAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CurrentTeamAddress))) i-- dAtA[i] = 0xa } @@ -5880,7 +5078,7 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgVote) + x := input.Message.Interface().(*MsgUpdateTeam) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5912,15 +5110,15 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgVote: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateTeam: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgVote: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateTeam: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentTeamAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5948,13 +5146,13 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Voter = string(dAtA[iNdEx:postIndex]) + x.CurrentTeamAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NewTeamAddress", wireType) } - x.Id = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -5964,30 +5162,24 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Id |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - x.Vote = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Vote |= VoteEnum(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } + x.NewTeamAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -6024,24 +5216,24 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { } var ( - md_MsgVoteResponse protoreflect.MessageDescriptor + md_MsgUpdateTeamResponse protoreflect.MessageDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgVoteResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgVoteResponse") + md_MsgUpdateTeamResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgUpdateTeamResponse") } -var _ protoreflect.Message = (*fastReflection_MsgVoteResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgUpdateTeamResponse)(nil) -type fastReflection_MsgVoteResponse MsgVoteResponse +type fastReflection_MsgUpdateTeamResponse MsgUpdateTeamResponse -func (x *MsgVoteResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgVoteResponse)(x) +func (x *MsgUpdateTeamResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateTeamResponse)(x) } -func (x *MsgVoteResponse) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[13] +func (x *MsgUpdateTeamResponse) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6052,43 +5244,43 @@ func (x *MsgVoteResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgVoteResponse_messageType fastReflection_MsgVoteResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgVoteResponse_messageType{} +var _fastReflection_MsgUpdateTeamResponse_messageType fastReflection_MsgUpdateTeamResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateTeamResponse_messageType{} -type fastReflection_MsgVoteResponse_messageType struct{} +type fastReflection_MsgUpdateTeamResponse_messageType struct{} -func (x fastReflection_MsgVoteResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgVoteResponse)(nil) -} -func (x fastReflection_MsgVoteResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgVoteResponse) +func (x fastReflection_MsgUpdateTeamResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateTeamResponse)(nil) } -func (x fastReflection_MsgVoteResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgVoteResponse +func (x fastReflection_MsgUpdateTeamResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateTeamResponse) +} +func (x fastReflection_MsgUpdateTeamResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateTeamResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgVoteResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgVoteResponse +func (x *fastReflection_MsgUpdateTeamResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateTeamResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgVoteResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgVoteResponse_messageType +func (x *fastReflection_MsgUpdateTeamResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateTeamResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgVoteResponse) New() protoreflect.Message { - return new(fastReflection_MsgVoteResponse) +func (x *fastReflection_MsgUpdateTeamResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateTeamResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgVoteResponse) Interface() protoreflect.ProtoMessage { - return (*MsgVoteResponse)(x) +func (x *fastReflection_MsgUpdateTeamResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateTeamResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -6096,7 +5288,7 @@ func (x *fastReflection_MsgVoteResponse) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgVoteResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgUpdateTeamResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -6110,13 +5302,13 @@ func (x *fastReflection_MsgVoteResponse) Range(f func(protoreflect.FieldDescript // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgVoteResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgUpdateTeamResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) } } @@ -6126,13 +5318,13 @@ func (x *fastReflection_MsgVoteResponse) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgVoteResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgUpdateTeamResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) } } @@ -6142,13 +5334,13 @@ func (x *fastReflection_MsgVoteResponse) Clear(fd protoreflect.FieldDescriptor) // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgVoteResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateTeamResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", descriptor.FullName())) } } @@ -6162,13 +5354,13 @@ func (x *fastReflection_MsgVoteResponse) Get(descriptor protoreflect.FieldDescri // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgVoteResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgUpdateTeamResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) } } @@ -6182,36 +5374,36 @@ func (x *fastReflection_MsgVoteResponse) Set(fd protoreflect.FieldDescriptor, va // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgVoteResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateTeamResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgVoteResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateTeamResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgVoteResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgVoteResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgVoteResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgUpdateTeamResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgVoteResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgUpdateTeamResponse", d.FullName())) } panic("unreachable") } @@ -6219,7 +5411,7 @@ func (x *fastReflection_MsgVoteResponse) WhichOneof(d protoreflect.OneofDescript // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgVoteResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgUpdateTeamResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -6230,7 +5422,7 @@ func (x *fastReflection_MsgVoteResponse) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgVoteResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgUpdateTeamResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -6242,7 +5434,7 @@ func (x *fastReflection_MsgVoteResponse) SetUnknown(fields protoreflect.RawField // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgVoteResponse) IsValid() bool { +func (x *fastReflection_MsgUpdateTeamResponse) IsValid() bool { return x != nil } @@ -6252,9 +5444,9 @@ func (x *fastReflection_MsgVoteResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgVoteResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgUpdateTeamResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgVoteResponse) + x := input.Message.Interface().(*MsgUpdateTeamResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6276,7 +5468,7 @@ func (x *fastReflection_MsgVoteResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgVoteResponse) + x := input.Message.Interface().(*MsgUpdateTeamResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6306,7 +5498,7 @@ func (x *fastReflection_MsgVoteResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgVoteResponse) + x := input.Message.Interface().(*MsgUpdateTeamResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6338,10 +5530,10 @@ func (x *fastReflection_MsgVoteResponse) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgVoteResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateTeamResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateTeamResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -6380,28 +5572,28 @@ func (x *fastReflection_MsgVoteResponse) ProtoMethods() *protoiface.Methods { } var ( - md_MsgUpdateTeam protoreflect.MessageDescriptor - fd_MsgUpdateTeam_current_team_address protoreflect.FieldDescriptor - fd_MsgUpdateTeam_new_team_address protoreflect.FieldDescriptor + md_MsgClaimReward protoreflect.MessageDescriptor + fd_MsgClaimReward_caller_address protoreflect.FieldDescriptor + fd_MsgClaimReward_dispute_id protoreflect.FieldDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgUpdateTeam = File_layer_dispute_tx_proto.Messages().ByName("MsgUpdateTeam") - fd_MsgUpdateTeam_current_team_address = md_MsgUpdateTeam.Fields().ByName("current_team_address") - fd_MsgUpdateTeam_new_team_address = md_MsgUpdateTeam.Fields().ByName("new_team_address") + md_MsgClaimReward = File_layer_dispute_tx_proto.Messages().ByName("MsgClaimReward") + fd_MsgClaimReward_caller_address = md_MsgClaimReward.Fields().ByName("caller_address") + fd_MsgClaimReward_dispute_id = md_MsgClaimReward.Fields().ByName("dispute_id") } -var _ protoreflect.Message = (*fastReflection_MsgUpdateTeam)(nil) +var _ protoreflect.Message = (*fastReflection_MsgClaimReward)(nil) -type fastReflection_MsgUpdateTeam MsgUpdateTeam +type fastReflection_MsgClaimReward MsgClaimReward -func (x *MsgUpdateTeam) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateTeam)(x) +func (x *MsgClaimReward) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimReward)(x) } -func (x *MsgUpdateTeam) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[14] +func (x *MsgClaimReward) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6412,43 +5604,43 @@ func (x *MsgUpdateTeam) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgUpdateTeam_messageType fastReflection_MsgUpdateTeam_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateTeam_messageType{} +var _fastReflection_MsgClaimReward_messageType fastReflection_MsgClaimReward_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimReward_messageType{} -type fastReflection_MsgUpdateTeam_messageType struct{} +type fastReflection_MsgClaimReward_messageType struct{} -func (x fastReflection_MsgUpdateTeam_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateTeam)(nil) +func (x fastReflection_MsgClaimReward_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimReward)(nil) } -func (x fastReflection_MsgUpdateTeam_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateTeam) +func (x fastReflection_MsgClaimReward_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimReward) } -func (x fastReflection_MsgUpdateTeam_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateTeam +func (x fastReflection_MsgClaimReward_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimReward } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgUpdateTeam) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateTeam +func (x *fastReflection_MsgClaimReward) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimReward } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgUpdateTeam) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateTeam_messageType +func (x *fastReflection_MsgClaimReward) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimReward_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateTeam) New() protoreflect.Message { - return new(fastReflection_MsgUpdateTeam) +func (x *fastReflection_MsgClaimReward) New() protoreflect.Message { + return new(fastReflection_MsgClaimReward) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateTeam) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateTeam)(x) +func (x *fastReflection_MsgClaimReward) Interface() protoreflect.ProtoMessage { + return (*MsgClaimReward)(x) } // Range iterates over every populated field in an undefined order, @@ -6456,16 +5648,16 @@ func (x *fastReflection_MsgUpdateTeam) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgUpdateTeam) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.CurrentTeamAddress != "" { - value := protoreflect.ValueOfString(x.CurrentTeamAddress) - if !f(fd_MsgUpdateTeam_current_team_address, value) { +func (x *fastReflection_MsgClaimReward) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CallerAddress != "" { + value := protoreflect.ValueOfString(x.CallerAddress) + if !f(fd_MsgClaimReward_caller_address, value) { return } } - if x.NewTeamAddress != "" { - value := protoreflect.ValueOfString(x.NewTeamAddress) - if !f(fd_MsgUpdateTeam_new_team_address, value) { + if x.DisputeId != uint64(0) { + value := protoreflect.ValueOfUint64(x.DisputeId) + if !f(fd_MsgClaimReward_dispute_id, value) { return } } @@ -6482,17 +5674,17 @@ func (x *fastReflection_MsgUpdateTeam) Range(f func(protoreflect.FieldDescriptor // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateTeam) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgClaimReward) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "layer.dispute.MsgUpdateTeam.current_team_address": - return x.CurrentTeamAddress != "" - case "layer.dispute.MsgUpdateTeam.new_team_address": - return x.NewTeamAddress != "" + case "layer.dispute.MsgClaimReward.caller_address": + return x.CallerAddress != "" + case "layer.dispute.MsgClaimReward.dispute_id": + return x.DisputeId != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimReward")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimReward does not contain field %s", fd.FullName())) } } @@ -6502,17 +5694,17 @@ func (x *fastReflection_MsgUpdateTeam) Has(fd protoreflect.FieldDescriptor) bool // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateTeam) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgClaimReward) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "layer.dispute.MsgUpdateTeam.current_team_address": - x.CurrentTeamAddress = "" - case "layer.dispute.MsgUpdateTeam.new_team_address": - x.NewTeamAddress = "" + case "layer.dispute.MsgClaimReward.caller_address": + x.CallerAddress = "" + case "layer.dispute.MsgClaimReward.dispute_id": + x.DisputeId = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimReward")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimReward does not contain field %s", fd.FullName())) } } @@ -6522,19 +5714,19 @@ func (x *fastReflection_MsgUpdateTeam) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgUpdateTeam) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgClaimReward) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "layer.dispute.MsgUpdateTeam.current_team_address": - value := x.CurrentTeamAddress - return protoreflect.ValueOfString(value) - case "layer.dispute.MsgUpdateTeam.new_team_address": - value := x.NewTeamAddress + case "layer.dispute.MsgClaimReward.caller_address": + value := x.CallerAddress return protoreflect.ValueOfString(value) + case "layer.dispute.MsgClaimReward.dispute_id": + value := x.DisputeId + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimReward")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimReward does not contain field %s", descriptor.FullName())) } } @@ -6548,17 +5740,17 @@ func (x *fastReflection_MsgUpdateTeam) Get(descriptor protoreflect.FieldDescript // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateTeam) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgClaimReward) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "layer.dispute.MsgUpdateTeam.current_team_address": - x.CurrentTeamAddress = value.Interface().(string) - case "layer.dispute.MsgUpdateTeam.new_team_address": - x.NewTeamAddress = value.Interface().(string) + case "layer.dispute.MsgClaimReward.caller_address": + x.CallerAddress = value.Interface().(string) + case "layer.dispute.MsgClaimReward.dispute_id": + x.DisputeId = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimReward")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimReward does not contain field %s", fd.FullName())) } } @@ -6572,44 +5764,44 @@ func (x *fastReflection_MsgUpdateTeam) Set(fd protoreflect.FieldDescriptor, valu // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateTeam) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgClaimReward) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgUpdateTeam.current_team_address": - panic(fmt.Errorf("field current_team_address of message layer.dispute.MsgUpdateTeam is not mutable")) - case "layer.dispute.MsgUpdateTeam.new_team_address": - panic(fmt.Errorf("field new_team_address of message layer.dispute.MsgUpdateTeam is not mutable")) + case "layer.dispute.MsgClaimReward.caller_address": + panic(fmt.Errorf("field caller_address of message layer.dispute.MsgClaimReward is not mutable")) + case "layer.dispute.MsgClaimReward.dispute_id": + panic(fmt.Errorf("field dispute_id of message layer.dispute.MsgClaimReward is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimReward")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimReward does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgUpdateTeam) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgClaimReward) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "layer.dispute.MsgUpdateTeam.current_team_address": - return protoreflect.ValueOfString("") - case "layer.dispute.MsgUpdateTeam.new_team_address": + case "layer.dispute.MsgClaimReward.caller_address": return protoreflect.ValueOfString("") + case "layer.dispute.MsgClaimReward.dispute_id": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeam")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimReward")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeam does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimReward does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgUpdateTeam) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgClaimReward) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgUpdateTeam", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgClaimReward", d.FullName())) } panic("unreachable") } @@ -6617,7 +5809,7 @@ func (x *fastReflection_MsgUpdateTeam) WhichOneof(d protoreflect.OneofDescriptor // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgUpdateTeam) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgClaimReward) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -6628,7 +5820,7 @@ func (x *fastReflection_MsgUpdateTeam) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateTeam) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgClaimReward) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -6640,7 +5832,7 @@ func (x *fastReflection_MsgUpdateTeam) SetUnknown(fields protoreflect.RawFields) // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgUpdateTeam) IsValid() bool { +func (x *fastReflection_MsgClaimReward) IsValid() bool { return x != nil } @@ -6650,9 +5842,9 @@ func (x *fastReflection_MsgUpdateTeam) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgClaimReward) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateTeam) + x := input.Message.Interface().(*MsgClaimReward) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6664,13 +5856,12 @@ func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.CurrentTeamAddress) + l = len(x.CallerAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.NewTeamAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.DisputeId != 0 { + n += 1 + runtime.Sov(uint64(x.DisputeId)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -6682,7 +5873,7 @@ func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateTeam) + x := input.Message.Interface().(*MsgClaimReward) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6701,17 +5892,15 @@ func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.NewTeamAddress) > 0 { - i -= len(x.NewTeamAddress) - copy(dAtA[i:], x.NewTeamAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NewTeamAddress))) + if x.DisputeId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DisputeId)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(x.CurrentTeamAddress) > 0 { - i -= len(x.CurrentTeamAddress) - copy(dAtA[i:], x.CurrentTeamAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CurrentTeamAddress))) + if len(x.CallerAddress) > 0 { + i -= len(x.CallerAddress) + copy(dAtA[i:], x.CallerAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CallerAddress))) i-- dAtA[i] = 0xa } @@ -6726,7 +5915,7 @@ func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateTeam) + x := input.Message.Interface().(*MsgClaimReward) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6758,15 +5947,15 @@ func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateTeam: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimReward: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateTeam: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimReward: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentTeamAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CallerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6794,13 +5983,13 @@ func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.CurrentTeamAddress = string(dAtA[iNdEx:postIndex]) + x.CallerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NewTeamAddress", wireType) + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) } - var stringLen uint64 + x.DisputeId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6810,24 +5999,11 @@ func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + x.DisputeId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.NewTeamAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -6864,24 +6040,24 @@ func (x *fastReflection_MsgUpdateTeam) ProtoMethods() *protoiface.Methods { } var ( - md_MsgUpdateTeamResponse protoreflect.MessageDescriptor + md_MsgClaimRewardResponse protoreflect.MessageDescriptor ) func init() { file_layer_dispute_tx_proto_init() - md_MsgUpdateTeamResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgUpdateTeamResponse") + md_MsgClaimRewardResponse = File_layer_dispute_tx_proto.Messages().ByName("MsgClaimRewardResponse") } -var _ protoreflect.Message = (*fastReflection_MsgUpdateTeamResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgClaimRewardResponse)(nil) -type fastReflection_MsgUpdateTeamResponse MsgUpdateTeamResponse +type fastReflection_MsgClaimRewardResponse MsgClaimRewardResponse -func (x *MsgUpdateTeamResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateTeamResponse)(x) +func (x *MsgClaimRewardResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimRewardResponse)(x) } -func (x *MsgUpdateTeamResponse) slowProtoReflect() protoreflect.Message { - mi := &file_layer_dispute_tx_proto_msgTypes[15] +func (x *MsgClaimRewardResponse) slowProtoReflect() protoreflect.Message { + mi := &file_layer_dispute_tx_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6892,43 +6068,43 @@ func (x *MsgUpdateTeamResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgUpdateTeamResponse_messageType fastReflection_MsgUpdateTeamResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateTeamResponse_messageType{} +var _fastReflection_MsgClaimRewardResponse_messageType fastReflection_MsgClaimRewardResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimRewardResponse_messageType{} -type fastReflection_MsgUpdateTeamResponse_messageType struct{} +type fastReflection_MsgClaimRewardResponse_messageType struct{} -func (x fastReflection_MsgUpdateTeamResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateTeamResponse)(nil) +func (x fastReflection_MsgClaimRewardResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimRewardResponse)(nil) } -func (x fastReflection_MsgUpdateTeamResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateTeamResponse) +func (x fastReflection_MsgClaimRewardResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimRewardResponse) } -func (x fastReflection_MsgUpdateTeamResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateTeamResponse +func (x fastReflection_MsgClaimRewardResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimRewardResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgUpdateTeamResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateTeamResponse +func (x *fastReflection_MsgClaimRewardResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimRewardResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgUpdateTeamResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateTeamResponse_messageType +func (x *fastReflection_MsgClaimRewardResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimRewardResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateTeamResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateTeamResponse) +func (x *fastReflection_MsgClaimRewardResponse) New() protoreflect.Message { + return new(fastReflection_MsgClaimRewardResponse) } // Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateTeamResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateTeamResponse)(x) +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimRewardResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClaimRewardResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -6936,7 +6112,7 @@ func (x *fastReflection_MsgUpdateTeamResponse) Interface() protoreflect.ProtoMes // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgUpdateTeamResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgClaimRewardResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -6950,13 +6126,13 @@ func (x *fastReflection_MsgUpdateTeamResponse) Range(f func(protoreflect.FieldDe // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateTeamResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgClaimRewardResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimRewardResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimRewardResponse does not contain field %s", fd.FullName())) } } @@ -6966,13 +6142,13 @@ func (x *fastReflection_MsgUpdateTeamResponse) Has(fd protoreflect.FieldDescript // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateTeamResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgClaimRewardResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimRewardResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimRewardResponse does not contain field %s", fd.FullName())) } } @@ -6982,13 +6158,13 @@ func (x *fastReflection_MsgUpdateTeamResponse) Clear(fd protoreflect.FieldDescri // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgUpdateTeamResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgClaimRewardResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimRewardResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimRewardResponse does not contain field %s", descriptor.FullName())) } } @@ -7002,13 +6178,13 @@ func (x *fastReflection_MsgUpdateTeamResponse) Get(descriptor protoreflect.Field // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateTeamResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgClaimRewardResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimRewardResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimRewardResponse does not contain field %s", fd.FullName())) } } @@ -7022,36 +6198,36 @@ func (x *fastReflection_MsgUpdateTeamResponse) Set(fd protoreflect.FieldDescript // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateTeamResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgClaimRewardResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimRewardResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimRewardResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgUpdateTeamResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgClaimRewardResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgUpdateTeamResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.MsgClaimRewardResponse")) } - panic(fmt.Errorf("message layer.dispute.MsgUpdateTeamResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message layer.dispute.MsgClaimRewardResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgUpdateTeamResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgClaimRewardResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgUpdateTeamResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in layer.dispute.MsgClaimRewardResponse", d.FullName())) } panic("unreachable") } @@ -7059,7 +6235,7 @@ func (x *fastReflection_MsgUpdateTeamResponse) WhichOneof(d protoreflect.OneofDe // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgUpdateTeamResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgClaimRewardResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -7070,7 +6246,7 @@ func (x *fastReflection_MsgUpdateTeamResponse) GetUnknown() protoreflect.RawFiel // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateTeamResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgClaimRewardResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -7082,7 +6258,7 @@ func (x *fastReflection_MsgUpdateTeamResponse) SetUnknown(fields protoreflect.Ra // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgUpdateTeamResponse) IsValid() bool { +func (x *fastReflection_MsgClaimRewardResponse) IsValid() bool { return x != nil } @@ -7092,9 +6268,9 @@ func (x *fastReflection_MsgUpdateTeamResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateTeamResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgClaimRewardResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateTeamResponse) + x := input.Message.Interface().(*MsgClaimRewardResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -7116,7 +6292,7 @@ func (x *fastReflection_MsgUpdateTeamResponse) ProtoMethods() *protoiface.Method } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateTeamResponse) + x := input.Message.Interface().(*MsgClaimRewardResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -7146,7 +6322,7 @@ func (x *fastReflection_MsgUpdateTeamResponse) ProtoMethods() *protoiface.Method }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateTeamResponse) + x := input.Message.Interface().(*MsgClaimRewardResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -7178,10 +6354,10 @@ func (x *fastReflection_MsgUpdateTeamResponse) ProtoMethods() *protoiface.Method fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateTeamResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimRewardResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateTeamResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -7386,144 +6562,6 @@ func (*MsgWithdrawFeeRefundResponse) Descriptor() ([]byte, []int) { return file_layer_dispute_tx_proto_rawDescGZIP(), []int{3} } -type MsgExecuteDispute struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CallerAddress string `protobuf:"bytes,1,opt,name=caller_address,json=callerAddress,proto3" json:"caller_address,omitempty"` - DisputeId uint64 `protobuf:"varint,2,opt,name=dispute_id,json=disputeId,proto3" json:"dispute_id,omitempty"` -} - -func (x *MsgExecuteDispute) Reset() { - *x = MsgExecuteDispute{} - if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgExecuteDispute) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgExecuteDispute) ProtoMessage() {} - -// Deprecated: Use MsgExecuteDispute.ProtoReflect.Descriptor instead. -func (*MsgExecuteDispute) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{4} -} - -func (x *MsgExecuteDispute) GetCallerAddress() string { - if x != nil { - return x.CallerAddress - } - return "" -} - -func (x *MsgExecuteDispute) GetDisputeId() uint64 { - if x != nil { - return x.DisputeId - } - return 0 -} - -type MsgExecuteDisputeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgExecuteDisputeResponse) Reset() { - *x = MsgExecuteDisputeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgExecuteDisputeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgExecuteDisputeResponse) ProtoMessage() {} - -// Deprecated: Use MsgExecuteDisputeResponse.ProtoReflect.Descriptor instead. -func (*MsgExecuteDisputeResponse) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{5} -} - -type MsgTallyVote struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CallerAddress string `protobuf:"bytes,1,opt,name=caller_address,json=callerAddress,proto3" json:"caller_address,omitempty"` - DisputeId uint64 `protobuf:"varint,2,opt,name=dispute_id,json=disputeId,proto3" json:"dispute_id,omitempty"` -} - -func (x *MsgTallyVote) Reset() { - *x = MsgTallyVote{} - if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgTallyVote) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgTallyVote) ProtoMessage() {} - -// Deprecated: Use MsgTallyVote.ProtoReflect.Descriptor instead. -func (*MsgTallyVote) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{6} -} - -func (x *MsgTallyVote) GetCallerAddress() string { - if x != nil { - return x.CallerAddress - } - return "" -} - -func (x *MsgTallyVote) GetDisputeId() uint64 { - if x != nil { - return x.DisputeId - } - return 0 -} - -type MsgTallyVoteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgTallyVoteResponse) Reset() { - *x = MsgTallyVoteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgTallyVoteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgTallyVoteResponse) ProtoMessage() {} - -// Deprecated: Use MsgTallyVoteResponse.ProtoReflect.Descriptor instead. -func (*MsgTallyVoteResponse) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{7} -} - type MsgProposeDispute struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7539,7 +6577,7 @@ type MsgProposeDispute struct { func (x *MsgProposeDispute) Reset() { *x = MsgProposeDispute{} if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[8] + mi := &file_layer_dispute_tx_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7553,7 +6591,7 @@ func (*MsgProposeDispute) ProtoMessage() {} // Deprecated: Use MsgProposeDispute.ProtoReflect.Descriptor instead. func (*MsgProposeDispute) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{8} + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{4} } func (x *MsgProposeDispute) GetCreator() string { @@ -7600,7 +6638,7 @@ type MsgProposeDisputeResponse struct { func (x *MsgProposeDisputeResponse) Reset() { *x = MsgProposeDisputeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[9] + mi := &file_layer_dispute_tx_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7614,7 +6652,7 @@ func (*MsgProposeDisputeResponse) ProtoMessage() {} // Deprecated: Use MsgProposeDisputeResponse.ProtoReflect.Descriptor instead. func (*MsgProposeDisputeResponse) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{9} + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{5} } type MsgAddFeeToDispute struct { @@ -7631,7 +6669,7 @@ type MsgAddFeeToDispute struct { func (x *MsgAddFeeToDispute) Reset() { *x = MsgAddFeeToDispute{} if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[10] + mi := &file_layer_dispute_tx_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7645,7 +6683,7 @@ func (*MsgAddFeeToDispute) ProtoMessage() {} // Deprecated: Use MsgAddFeeToDispute.ProtoReflect.Descriptor instead. func (*MsgAddFeeToDispute) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{10} + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{6} } func (x *MsgAddFeeToDispute) GetCreator() string { @@ -7685,7 +6723,7 @@ type MsgAddFeeToDisputeResponse struct { func (x *MsgAddFeeToDisputeResponse) Reset() { *x = MsgAddFeeToDisputeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[11] + mi := &file_layer_dispute_tx_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7699,7 +6737,7 @@ func (*MsgAddFeeToDisputeResponse) ProtoMessage() {} // Deprecated: Use MsgAddFeeToDisputeResponse.ProtoReflect.Descriptor instead. func (*MsgAddFeeToDisputeResponse) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{11} + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{7} } type MsgVote struct { @@ -7715,7 +6753,7 @@ type MsgVote struct { func (x *MsgVote) Reset() { *x = MsgVote{} if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[12] + mi := &file_layer_dispute_tx_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7729,7 +6767,7 @@ func (*MsgVote) ProtoMessage() {} // Deprecated: Use MsgVote.ProtoReflect.Descriptor instead. func (*MsgVote) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{12} + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{8} } func (x *MsgVote) GetVoter() string { @@ -7762,7 +6800,7 @@ type MsgVoteResponse struct { func (x *MsgVoteResponse) Reset() { *x = MsgVoteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[13] + mi := &file_layer_dispute_tx_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7776,7 +6814,7 @@ func (*MsgVoteResponse) ProtoMessage() {} // Deprecated: Use MsgVoteResponse.ProtoReflect.Descriptor instead. func (*MsgVoteResponse) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{13} + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{9} } type MsgUpdateTeam struct { @@ -7791,7 +6829,7 @@ type MsgUpdateTeam struct { func (x *MsgUpdateTeam) Reset() { *x = MsgUpdateTeam{} if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[14] + mi := &file_layer_dispute_tx_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7805,7 +6843,7 @@ func (*MsgUpdateTeam) ProtoMessage() {} // Deprecated: Use MsgUpdateTeam.ProtoReflect.Descriptor instead. func (*MsgUpdateTeam) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{14} + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{10} } func (x *MsgUpdateTeam) GetCurrentTeamAddress() string { @@ -7831,7 +6869,7 @@ type MsgUpdateTeamResponse struct { func (x *MsgUpdateTeamResponse) Reset() { *x = MsgUpdateTeamResponse{} if protoimpl.UnsafeEnabled { - mi := &file_layer_dispute_tx_proto_msgTypes[15] + mi := &file_layer_dispute_tx_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7845,7 +6883,76 @@ func (*MsgUpdateTeamResponse) ProtoMessage() {} // Deprecated: Use MsgUpdateTeamResponse.ProtoReflect.Descriptor instead. func (*MsgUpdateTeamResponse) Descriptor() ([]byte, []int) { - return file_layer_dispute_tx_proto_rawDescGZIP(), []int{15} + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{11} +} + +type MsgClaimReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CallerAddress string `protobuf:"bytes,1,opt,name=caller_address,json=callerAddress,proto3" json:"caller_address,omitempty"` + DisputeId uint64 `protobuf:"varint,2,opt,name=dispute_id,json=disputeId,proto3" json:"dispute_id,omitempty"` +} + +func (x *MsgClaimReward) Reset() { + *x = MsgClaimReward{} + if protoimpl.UnsafeEnabled { + mi := &file_layer_dispute_tx_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimReward) ProtoMessage() {} + +// Deprecated: Use MsgClaimReward.ProtoReflect.Descriptor instead. +func (*MsgClaimReward) Descriptor() ([]byte, []int) { + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{12} +} + +func (x *MsgClaimReward) GetCallerAddress() string { + if x != nil { + return x.CallerAddress + } + return "" +} + +func (x *MsgClaimReward) GetDisputeId() uint64 { + if x != nil { + return x.DisputeId + } + return 0 +} + +type MsgClaimRewardResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgClaimRewardResponse) Reset() { + *x = MsgClaimRewardResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_layer_dispute_tx_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimRewardResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimRewardResponse) ProtoMessage() {} + +// Deprecated: Use MsgClaimRewardResponse.ProtoReflect.Descriptor instead. +func (*MsgClaimRewardResponse) Descriptor() ([]byte, []int) { + return file_layer_dispute_tx_proto_rawDescGZIP(), []int{13} } var File_layer_dispute_tx_proto protoreflect.FileDescriptor @@ -7886,23 +6993,6 @@ var file_layer_dispute_tx_proto_rawDesc = []byte{ 0x3a, 0x13, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x46, 0x65, 0x65, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6e, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, - 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x49, 0x64, - 0x3a, 0x13, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x69, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x56, 0x6f, - 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x6c, 0x6c, - 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, - 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x64, - 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x49, 0x64, 0x3a, 0x13, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x63, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x16, 0x0a, - 0x14, 0x4d, 0x73, 0x67, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x90, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, @@ -7953,62 +7043,65 @@ var file_layer_dispute_tx_proto_rawDesc = []byte{ 0x61, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x19, 0x82, 0xe7, 0xb0, 0x2a, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xc6, 0x05, - 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, - 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x1a, 0x28, 0x2e, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x46, 0x65, 0x65, 0x54, 0x6f, 0x44, - 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x21, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, - 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x46, 0x65, 0x65, - 0x54, 0x6f, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x1a, 0x29, 0x2e, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, - 0x46, 0x65, 0x65, 0x54, 0x6f, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, - 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1e, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, - 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, - 0x61, 0x6d, 0x12, 0x1c, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, - 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, - 0x1a, 0x24, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x09, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x56, - 0x6f, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, - 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, - 0x1a, 0x23, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, - 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, - 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x1a, 0x28, 0x2e, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x11, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x46, - 0x65, 0x65, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x12, 0x23, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, - 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x46, 0x65, 0x65, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x1a, 0x2b, 0x2e, + 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6b, 0x0a, + 0x0e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x64, 0x69, 0x73, 0x70, + 0x75, 0x74, 0x65, 0x49, 0x64, 0x3a, 0x13, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x63, 0x61, 0x6c, 0x6c, + 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x73, + 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xee, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x20, + 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, + 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, + 0x1a, 0x28, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, + 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x73, 0x70, 0x75, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0f, 0x41, 0x64, + 0x64, 0x46, 0x65, 0x65, 0x54, 0x6f, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x12, 0x21, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, - 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x46, 0x65, 0x65, 0x52, 0x65, 0x66, 0x75, - 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0b, 0x41, 0x64, - 0x64, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, - 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x1a, 0x25, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, - 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x45, - 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, - 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x9f, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x42, 0x07, 0x54, 0x78, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x6c, 0x6f, 0x72, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x64, 0x69, - 0x73, 0x70, 0x75, 0x74, 0x65, 0xa2, 0x02, 0x03, 0x4c, 0x44, 0x58, 0xaa, 0x02, 0x0d, 0x4c, 0x61, - 0x79, 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xca, 0x02, 0x0d, 0x4c, 0x61, - 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xe2, 0x02, 0x19, 0x4c, 0x61, - 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x3a, - 0x3a, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x41, 0x64, 0x64, 0x46, 0x65, 0x65, 0x54, 0x6f, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, + 0x1a, 0x29, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, + 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x46, 0x65, 0x65, 0x54, 0x6f, 0x44, 0x69, 0x73, 0x70, + 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x56, + 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, + 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1e, 0x2e, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x56, + 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1c, 0x2e, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x1a, 0x24, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, + 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, + 0x11, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x46, 0x65, 0x65, 0x52, 0x65, 0x66, 0x75, + 0x6e, 0x64, 0x12, 0x23, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, + 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x46, 0x65, + 0x65, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x1a, 0x2b, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, + 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x46, 0x65, 0x65, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x45, 0x76, 0x69, 0x64, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, + 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, + 0x63, 0x65, 0x1a, 0x25, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, + 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0b, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1d, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x25, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, + 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, + 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x9f, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x42, 0x07, 0x54, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x6c, 0x6f, 0x72, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x64, 0x69, 0x73, + 0x70, 0x75, 0x74, 0x65, 0xa2, 0x02, 0x03, 0x4c, 0x44, 0x58, 0xaa, 0x02, 0x0d, 0x4c, 0x61, 0x79, + 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xca, 0x02, 0x0d, 0x4c, 0x61, 0x79, + 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xe2, 0x02, 0x19, 0x4c, 0x61, 0x79, + 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x3a, 0x3a, + 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8023,54 +7116,50 @@ func file_layer_dispute_tx_proto_rawDescGZIP() []byte { return file_layer_dispute_tx_proto_rawDescData } -var file_layer_dispute_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_layer_dispute_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_layer_dispute_tx_proto_goTypes = []interface{}{ (*MsgAddEvidence)(nil), // 0: layer.dispute.MsgAddEvidence (*MsgAddEvidenceResponse)(nil), // 1: layer.dispute.MsgAddEvidenceResponse (*MsgWithdrawFeeRefund)(nil), // 2: layer.dispute.MsgWithdrawFeeRefund (*MsgWithdrawFeeRefundResponse)(nil), // 3: layer.dispute.MsgWithdrawFeeRefundResponse - (*MsgExecuteDispute)(nil), // 4: layer.dispute.MsgExecuteDispute - (*MsgExecuteDisputeResponse)(nil), // 5: layer.dispute.MsgExecuteDisputeResponse - (*MsgTallyVote)(nil), // 6: layer.dispute.MsgTallyVote - (*MsgTallyVoteResponse)(nil), // 7: layer.dispute.MsgTallyVoteResponse - (*MsgProposeDispute)(nil), // 8: layer.dispute.MsgProposeDispute - (*MsgProposeDisputeResponse)(nil), // 9: layer.dispute.MsgProposeDisputeResponse - (*MsgAddFeeToDispute)(nil), // 10: layer.dispute.MsgAddFeeToDispute - (*MsgAddFeeToDisputeResponse)(nil), // 11: layer.dispute.MsgAddFeeToDisputeResponse - (*MsgVote)(nil), // 12: layer.dispute.MsgVote - (*MsgVoteResponse)(nil), // 13: layer.dispute.MsgVoteResponse - (*MsgUpdateTeam)(nil), // 14: layer.dispute.MsgUpdateTeam - (*MsgUpdateTeamResponse)(nil), // 15: layer.dispute.MsgUpdateTeamResponse - (*oracle.MicroReport)(nil), // 16: layer.oracle.MicroReport - (DisputeCategory)(0), // 17: layer.dispute.DisputeCategory - (*v1beta1.Coin)(nil), // 18: cosmos.base.v1beta1.Coin - (VoteEnum)(0), // 19: layer.dispute.VoteEnum + (*MsgProposeDispute)(nil), // 4: layer.dispute.MsgProposeDispute + (*MsgProposeDisputeResponse)(nil), // 5: layer.dispute.MsgProposeDisputeResponse + (*MsgAddFeeToDispute)(nil), // 6: layer.dispute.MsgAddFeeToDispute + (*MsgAddFeeToDisputeResponse)(nil), // 7: layer.dispute.MsgAddFeeToDisputeResponse + (*MsgVote)(nil), // 8: layer.dispute.MsgVote + (*MsgVoteResponse)(nil), // 9: layer.dispute.MsgVoteResponse + (*MsgUpdateTeam)(nil), // 10: layer.dispute.MsgUpdateTeam + (*MsgUpdateTeamResponse)(nil), // 11: layer.dispute.MsgUpdateTeamResponse + (*MsgClaimReward)(nil), // 12: layer.dispute.MsgClaimReward + (*MsgClaimRewardResponse)(nil), // 13: layer.dispute.MsgClaimRewardResponse + (*oracle.MicroReport)(nil), // 14: layer.oracle.MicroReport + (DisputeCategory)(0), // 15: layer.dispute.DisputeCategory + (*v1beta1.Coin)(nil), // 16: cosmos.base.v1beta1.Coin + (VoteEnum)(0), // 17: layer.dispute.VoteEnum } var file_layer_dispute_tx_proto_depIdxs = []int32{ - 16, // 0: layer.dispute.MsgAddEvidence.reports:type_name -> layer.oracle.MicroReport - 16, // 1: layer.dispute.MsgProposeDispute.report:type_name -> layer.oracle.MicroReport - 17, // 2: layer.dispute.MsgProposeDispute.dispute_category:type_name -> layer.dispute.DisputeCategory - 18, // 3: layer.dispute.MsgProposeDispute.fee:type_name -> cosmos.base.v1beta1.Coin - 18, // 4: layer.dispute.MsgAddFeeToDispute.amount:type_name -> cosmos.base.v1beta1.Coin - 19, // 5: layer.dispute.MsgVote.vote:type_name -> layer.dispute.VoteEnum - 8, // 6: layer.dispute.Msg.ProposeDispute:input_type -> layer.dispute.MsgProposeDispute - 10, // 7: layer.dispute.Msg.AddFeeToDispute:input_type -> layer.dispute.MsgAddFeeToDispute - 12, // 8: layer.dispute.Msg.Vote:input_type -> layer.dispute.MsgVote - 14, // 9: layer.dispute.Msg.UpdateTeam:input_type -> layer.dispute.MsgUpdateTeam - 6, // 10: layer.dispute.Msg.TallyVote:input_type -> layer.dispute.MsgTallyVote - 4, // 11: layer.dispute.Msg.ExecuteDispute:input_type -> layer.dispute.MsgExecuteDispute - 2, // 12: layer.dispute.Msg.WithdrawFeeRefund:input_type -> layer.dispute.MsgWithdrawFeeRefund - 0, // 13: layer.dispute.Msg.AddEvidence:input_type -> layer.dispute.MsgAddEvidence - 9, // 14: layer.dispute.Msg.ProposeDispute:output_type -> layer.dispute.MsgProposeDisputeResponse - 11, // 15: layer.dispute.Msg.AddFeeToDispute:output_type -> layer.dispute.MsgAddFeeToDisputeResponse - 13, // 16: layer.dispute.Msg.Vote:output_type -> layer.dispute.MsgVoteResponse - 15, // 17: layer.dispute.Msg.UpdateTeam:output_type -> layer.dispute.MsgUpdateTeamResponse - 7, // 18: layer.dispute.Msg.TallyVote:output_type -> layer.dispute.MsgTallyVoteResponse - 5, // 19: layer.dispute.Msg.ExecuteDispute:output_type -> layer.dispute.MsgExecuteDisputeResponse - 3, // 20: layer.dispute.Msg.WithdrawFeeRefund:output_type -> layer.dispute.MsgWithdrawFeeRefundResponse - 1, // 21: layer.dispute.Msg.AddEvidence:output_type -> layer.dispute.MsgAddEvidenceResponse - 14, // [14:22] is the sub-list for method output_type - 6, // [6:14] is the sub-list for method input_type + 14, // 0: layer.dispute.MsgAddEvidence.reports:type_name -> layer.oracle.MicroReport + 14, // 1: layer.dispute.MsgProposeDispute.report:type_name -> layer.oracle.MicroReport + 15, // 2: layer.dispute.MsgProposeDispute.dispute_category:type_name -> layer.dispute.DisputeCategory + 16, // 3: layer.dispute.MsgProposeDispute.fee:type_name -> cosmos.base.v1beta1.Coin + 16, // 4: layer.dispute.MsgAddFeeToDispute.amount:type_name -> cosmos.base.v1beta1.Coin + 17, // 5: layer.dispute.MsgVote.vote:type_name -> layer.dispute.VoteEnum + 4, // 6: layer.dispute.Msg.ProposeDispute:input_type -> layer.dispute.MsgProposeDispute + 6, // 7: layer.dispute.Msg.AddFeeToDispute:input_type -> layer.dispute.MsgAddFeeToDispute + 8, // 8: layer.dispute.Msg.Vote:input_type -> layer.dispute.MsgVote + 10, // 9: layer.dispute.Msg.UpdateTeam:input_type -> layer.dispute.MsgUpdateTeam + 2, // 10: layer.dispute.Msg.WithdrawFeeRefund:input_type -> layer.dispute.MsgWithdrawFeeRefund + 0, // 11: layer.dispute.Msg.AddEvidence:input_type -> layer.dispute.MsgAddEvidence + 12, // 12: layer.dispute.Msg.ClaimReward:input_type -> layer.dispute.MsgClaimReward + 5, // 13: layer.dispute.Msg.ProposeDispute:output_type -> layer.dispute.MsgProposeDisputeResponse + 7, // 14: layer.dispute.Msg.AddFeeToDispute:output_type -> layer.dispute.MsgAddFeeToDisputeResponse + 9, // 15: layer.dispute.Msg.Vote:output_type -> layer.dispute.MsgVoteResponse + 11, // 16: layer.dispute.Msg.UpdateTeam:output_type -> layer.dispute.MsgUpdateTeamResponse + 3, // 17: layer.dispute.Msg.WithdrawFeeRefund:output_type -> layer.dispute.MsgWithdrawFeeRefundResponse + 1, // 18: layer.dispute.Msg.AddEvidence:output_type -> layer.dispute.MsgAddEvidenceResponse + 13, // 19: layer.dispute.Msg.ClaimReward:output_type -> layer.dispute.MsgClaimRewardResponse + 13, // [13:20] is the sub-list for method output_type + 6, // [6:13] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name 6, // [6:6] is the sub-list for extension extendee 0, // [0:6] is the sub-list for field type_name @@ -8133,7 +7222,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgExecuteDispute); i { + switch v := v.(*MsgProposeDispute); i { case 0: return &v.state case 1: @@ -8145,7 +7234,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgExecuteDisputeResponse); i { + switch v := v.(*MsgProposeDisputeResponse); i { case 0: return &v.state case 1: @@ -8157,7 +7246,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgTallyVote); i { + switch v := v.(*MsgAddFeeToDispute); i { case 0: return &v.state case 1: @@ -8169,7 +7258,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgTallyVoteResponse); i { + switch v := v.(*MsgAddFeeToDisputeResponse); i { case 0: return &v.state case 1: @@ -8181,7 +7270,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgProposeDispute); i { + switch v := v.(*MsgVote); i { case 0: return &v.state case 1: @@ -8193,7 +7282,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgProposeDisputeResponse); i { + switch v := v.(*MsgVoteResponse); i { case 0: return &v.state case 1: @@ -8205,7 +7294,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgAddFeeToDispute); i { + switch v := v.(*MsgUpdateTeam); i { case 0: return &v.state case 1: @@ -8217,7 +7306,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgAddFeeToDisputeResponse); i { + switch v := v.(*MsgUpdateTeamResponse); i { case 0: return &v.state case 1: @@ -8229,7 +7318,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgVote); i { + switch v := v.(*MsgClaimReward); i { case 0: return &v.state case 1: @@ -8241,31 +7330,7 @@ func file_layer_dispute_tx_proto_init() { } } file_layer_dispute_tx_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgVoteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_layer_dispute_tx_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateTeam); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_layer_dispute_tx_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateTeamResponse); i { + switch v := v.(*MsgClaimRewardResponse); i { case 0: return &v.state case 1: @@ -8283,7 +7348,7 @@ func file_layer_dispute_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_layer_dispute_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 16, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, diff --git a/api/layer/dispute/tx_grpc.pb.go b/api/layer/dispute/tx_grpc.pb.go index a2d10391f..f251a10b3 100644 --- a/api/layer/dispute/tx_grpc.pb.go +++ b/api/layer/dispute/tx_grpc.pb.go @@ -22,10 +22,9 @@ type MsgClient interface { AddFeeToDispute(ctx context.Context, in *MsgAddFeeToDispute, opts ...grpc.CallOption) (*MsgAddFeeToDisputeResponse, error) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) UpdateTeam(ctx context.Context, in *MsgUpdateTeam, opts ...grpc.CallOption) (*MsgUpdateTeamResponse, error) - TallyVote(ctx context.Context, in *MsgTallyVote, opts ...grpc.CallOption) (*MsgTallyVoteResponse, error) - ExecuteDispute(ctx context.Context, in *MsgExecuteDispute, opts ...grpc.CallOption) (*MsgExecuteDisputeResponse, error) WithdrawFeeRefund(ctx context.Context, in *MsgWithdrawFeeRefund, opts ...grpc.CallOption) (*MsgWithdrawFeeRefundResponse, error) AddEvidence(ctx context.Context, in *MsgAddEvidence, opts ...grpc.CallOption) (*MsgAddEvidenceResponse, error) + ClaimReward(ctx context.Context, in *MsgClaimReward, opts ...grpc.CallOption) (*MsgClaimRewardResponse, error) } type msgClient struct { @@ -72,24 +71,6 @@ func (c *msgClient) UpdateTeam(ctx context.Context, in *MsgUpdateTeam, opts ...g return out, nil } -func (c *msgClient) TallyVote(ctx context.Context, in *MsgTallyVote, opts ...grpc.CallOption) (*MsgTallyVoteResponse, error) { - out := new(MsgTallyVoteResponse) - err := c.cc.Invoke(ctx, "/layer.dispute.Msg/TallyVote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ExecuteDispute(ctx context.Context, in *MsgExecuteDispute, opts ...grpc.CallOption) (*MsgExecuteDisputeResponse, error) { - out := new(MsgExecuteDisputeResponse) - err := c.cc.Invoke(ctx, "/layer.dispute.Msg/ExecuteDispute", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) WithdrawFeeRefund(ctx context.Context, in *MsgWithdrawFeeRefund, opts ...grpc.CallOption) (*MsgWithdrawFeeRefundResponse, error) { out := new(MsgWithdrawFeeRefundResponse) err := c.cc.Invoke(ctx, "/layer.dispute.Msg/WithdrawFeeRefund", in, out, opts...) @@ -108,6 +89,15 @@ func (c *msgClient) AddEvidence(ctx context.Context, in *MsgAddEvidence, opts .. return out, nil } +func (c *msgClient) ClaimReward(ctx context.Context, in *MsgClaimReward, opts ...grpc.CallOption) (*MsgClaimRewardResponse, error) { + out := new(MsgClaimRewardResponse) + err := c.cc.Invoke(ctx, "/layer.dispute.Msg/ClaimReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -116,10 +106,9 @@ type MsgServer interface { AddFeeToDispute(context.Context, *MsgAddFeeToDispute) (*MsgAddFeeToDisputeResponse, error) Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) UpdateTeam(context.Context, *MsgUpdateTeam) (*MsgUpdateTeamResponse, error) - TallyVote(context.Context, *MsgTallyVote) (*MsgTallyVoteResponse, error) - ExecuteDispute(context.Context, *MsgExecuteDispute) (*MsgExecuteDisputeResponse, error) WithdrawFeeRefund(context.Context, *MsgWithdrawFeeRefund) (*MsgWithdrawFeeRefundResponse, error) AddEvidence(context.Context, *MsgAddEvidence) (*MsgAddEvidenceResponse, error) + ClaimReward(context.Context, *MsgClaimReward) (*MsgClaimRewardResponse, error) mustEmbedUnimplementedMsgServer() } @@ -139,18 +128,15 @@ func (UnimplementedMsgServer) Vote(context.Context, *MsgVote) (*MsgVoteResponse, func (UnimplementedMsgServer) UpdateTeam(context.Context, *MsgUpdateTeam) (*MsgUpdateTeamResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateTeam not implemented") } -func (UnimplementedMsgServer) TallyVote(context.Context, *MsgTallyVote) (*MsgTallyVoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TallyVote not implemented") -} -func (UnimplementedMsgServer) ExecuteDispute(context.Context, *MsgExecuteDispute) (*MsgExecuteDisputeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExecuteDispute not implemented") -} func (UnimplementedMsgServer) WithdrawFeeRefund(context.Context, *MsgWithdrawFeeRefund) (*MsgWithdrawFeeRefundResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method WithdrawFeeRefund not implemented") } func (UnimplementedMsgServer) AddEvidence(context.Context, *MsgAddEvidence) (*MsgAddEvidenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddEvidence not implemented") } +func (UnimplementedMsgServer) ClaimReward(context.Context, *MsgClaimReward) (*MsgClaimRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimReward not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -236,74 +222,56 @@ func _Msg_UpdateTeam_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Msg_TallyVote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTallyVote) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).TallyVote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/layer.dispute.Msg/TallyVote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).TallyVote(ctx, req.(*MsgTallyVote)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ExecuteDispute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExecuteDispute) +func _Msg_WithdrawFeeRefund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawFeeRefund) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).ExecuteDispute(ctx, in) + return srv.(MsgServer).WithdrawFeeRefund(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/layer.dispute.Msg/ExecuteDispute", + FullMethod: "/layer.dispute.Msg/WithdrawFeeRefund", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ExecuteDispute(ctx, req.(*MsgExecuteDispute)) + return srv.(MsgServer).WithdrawFeeRefund(ctx, req.(*MsgWithdrawFeeRefund)) } return interceptor(ctx, in, info, handler) } -func _Msg_WithdrawFeeRefund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgWithdrawFeeRefund) +func _Msg_AddEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddEvidence) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).WithdrawFeeRefund(ctx, in) + return srv.(MsgServer).AddEvidence(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/layer.dispute.Msg/WithdrawFeeRefund", + FullMethod: "/layer.dispute.Msg/AddEvidence", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).WithdrawFeeRefund(ctx, req.(*MsgWithdrawFeeRefund)) + return srv.(MsgServer).AddEvidence(ctx, req.(*MsgAddEvidence)) } return interceptor(ctx, in, info, handler) } -func _Msg_AddEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAddEvidence) +func _Msg_ClaimReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimReward) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AddEvidence(ctx, in) + return srv.(MsgServer).ClaimReward(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/layer.dispute.Msg/AddEvidence", + FullMethod: "/layer.dispute.Msg/ClaimReward", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AddEvidence(ctx, req.(*MsgAddEvidence)) + return srv.(MsgServer).ClaimReward(ctx, req.(*MsgClaimReward)) } return interceptor(ctx, in, info, handler) } @@ -331,14 +299,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateTeam", Handler: _Msg_UpdateTeam_Handler, }, - { - MethodName: "TallyVote", - Handler: _Msg_TallyVote_Handler, - }, - { - MethodName: "ExecuteDispute", - Handler: _Msg_ExecuteDispute_Handler, - }, { MethodName: "WithdrawFeeRefund", Handler: _Msg_WithdrawFeeRefund_Handler, @@ -347,6 +307,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "AddEvidence", Handler: _Msg_AddEvidence_Handler, }, + { + MethodName: "ClaimReward", + Handler: _Msg_ClaimReward_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "layer/dispute/tx.proto", diff --git a/api/layer/dispute/vote.pulsar.go b/api/layer/dispute/vote.pulsar.go index 5ad49d590..48480d20b 100644 --- a/api/layer/dispute/vote.pulsar.go +++ b/api/layer/dispute/vote.pulsar.go @@ -680,9 +680,12 @@ func (x *fastReflection_Vote) ProtoMethods() *protoiface.Methods { } var ( - md_Voter protoreflect.MessageDescriptor - fd_Voter_vote protoreflect.FieldDescriptor - fd_Voter_voter_power protoreflect.FieldDescriptor + md_Voter protoreflect.MessageDescriptor + fd_Voter_vote protoreflect.FieldDescriptor + fd_Voter_voter_power protoreflect.FieldDescriptor + fd_Voter_reporter_power protoreflect.FieldDescriptor + fd_Voter_tokenholder_power protoreflect.FieldDescriptor + fd_Voter_reward_claimed protoreflect.FieldDescriptor ) func init() { @@ -690,6 +693,9 @@ func init() { md_Voter = File_layer_dispute_vote_proto.Messages().ByName("Voter") fd_Voter_vote = md_Voter.Fields().ByName("vote") fd_Voter_voter_power = md_Voter.Fields().ByName("voter_power") + fd_Voter_reporter_power = md_Voter.Fields().ByName("reporter_power") + fd_Voter_tokenholder_power = md_Voter.Fields().ByName("tokenholder_power") + fd_Voter_reward_claimed = md_Voter.Fields().ByName("reward_claimed") } var _ protoreflect.Message = (*fastReflection_Voter)(nil) @@ -769,6 +775,24 @@ func (x *fastReflection_Voter) Range(f func(protoreflect.FieldDescriptor, protor return } } + if x.ReporterPower != "" { + value := protoreflect.ValueOfString(x.ReporterPower) + if !f(fd_Voter_reporter_power, value) { + return + } + } + if x.TokenholderPower != "" { + value := protoreflect.ValueOfString(x.TokenholderPower) + if !f(fd_Voter_tokenholder_power, value) { + return + } + } + if x.RewardClaimed != false { + value := protoreflect.ValueOfBool(x.RewardClaimed) + if !f(fd_Voter_reward_claimed, value) { + return + } + } } // Has reports whether a field is populated. @@ -788,6 +812,12 @@ func (x *fastReflection_Voter) Has(fd protoreflect.FieldDescriptor) bool { return x.Vote != 0 case "layer.dispute.Voter.voter_power": return x.VoterPower != "" + case "layer.dispute.Voter.reporter_power": + return x.ReporterPower != "" + case "layer.dispute.Voter.tokenholder_power": + return x.TokenholderPower != "" + case "layer.dispute.Voter.reward_claimed": + return x.RewardClaimed != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Voter")) @@ -808,6 +838,12 @@ func (x *fastReflection_Voter) Clear(fd protoreflect.FieldDescriptor) { x.Vote = 0 case "layer.dispute.Voter.voter_power": x.VoterPower = "" + case "layer.dispute.Voter.reporter_power": + x.ReporterPower = "" + case "layer.dispute.Voter.tokenholder_power": + x.TokenholderPower = "" + case "layer.dispute.Voter.reward_claimed": + x.RewardClaimed = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Voter")) @@ -830,6 +866,15 @@ func (x *fastReflection_Voter) Get(descriptor protoreflect.FieldDescriptor) prot case "layer.dispute.Voter.voter_power": value := x.VoterPower return protoreflect.ValueOfString(value) + case "layer.dispute.Voter.reporter_power": + value := x.ReporterPower + return protoreflect.ValueOfString(value) + case "layer.dispute.Voter.tokenholder_power": + value := x.TokenholderPower + return protoreflect.ValueOfString(value) + case "layer.dispute.Voter.reward_claimed": + value := x.RewardClaimed + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Voter")) @@ -854,6 +899,12 @@ func (x *fastReflection_Voter) Set(fd protoreflect.FieldDescriptor, value protor x.Vote = (VoteEnum)(value.Enum()) case "layer.dispute.Voter.voter_power": x.VoterPower = value.Interface().(string) + case "layer.dispute.Voter.reporter_power": + x.ReporterPower = value.Interface().(string) + case "layer.dispute.Voter.tokenholder_power": + x.TokenholderPower = value.Interface().(string) + case "layer.dispute.Voter.reward_claimed": + x.RewardClaimed = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Voter")) @@ -878,6 +929,12 @@ func (x *fastReflection_Voter) Mutable(fd protoreflect.FieldDescriptor) protoref panic(fmt.Errorf("field vote of message layer.dispute.Voter is not mutable")) case "layer.dispute.Voter.voter_power": panic(fmt.Errorf("field voter_power of message layer.dispute.Voter is not mutable")) + case "layer.dispute.Voter.reporter_power": + panic(fmt.Errorf("field reporter_power of message layer.dispute.Voter is not mutable")) + case "layer.dispute.Voter.tokenholder_power": + panic(fmt.Errorf("field tokenholder_power of message layer.dispute.Voter is not mutable")) + case "layer.dispute.Voter.reward_claimed": + panic(fmt.Errorf("field reward_claimed of message layer.dispute.Voter is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Voter")) @@ -895,6 +952,12 @@ func (x *fastReflection_Voter) NewField(fd protoreflect.FieldDescriptor) protore return protoreflect.ValueOfEnum(0) case "layer.dispute.Voter.voter_power": return protoreflect.ValueOfString("") + case "layer.dispute.Voter.reporter_power": + return protoreflect.ValueOfString("") + case "layer.dispute.Voter.tokenholder_power": + return protoreflect.ValueOfString("") + case "layer.dispute.Voter.reward_claimed": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: layer.dispute.Voter")) @@ -971,6 +1034,17 @@ func (x *fastReflection_Voter) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.ReporterPower) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.TokenholderPower) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.RewardClaimed { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1000,6 +1074,30 @@ func (x *fastReflection_Voter) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.RewardClaimed { + i-- + if x.RewardClaimed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(x.TokenholderPower) > 0 { + i -= len(x.TokenholderPower) + copy(dAtA[i:], x.TokenholderPower) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TokenholderPower))) + i-- + dAtA[i] = 0x22 + } + if len(x.ReporterPower) > 0 { + i -= len(x.ReporterPower) + copy(dAtA[i:], x.ReporterPower) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ReporterPower))) + i-- + dAtA[i] = 0x1a + } if len(x.VoterPower) > 0 { i -= len(x.VoterPower) copy(dAtA[i:], x.VoterPower) @@ -1112,6 +1210,90 @@ func (x *fastReflection_Voter) ProtoMethods() *protoiface.Methods { } x.VoterPower = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ReporterPower", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ReporterPower = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TokenholderPower", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.TokenholderPower = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RewardClaimed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.RewardClaimed = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1342,8 +1524,11 @@ type Voter struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Vote VoteEnum `protobuf:"varint,1,opt,name=vote,proto3,enum=layer.dispute.VoteEnum" json:"vote,omitempty"` - VoterPower string `protobuf:"bytes,2,opt,name=voter_power,json=voterPower,proto3" json:"voter_power,omitempty"` + Vote VoteEnum `protobuf:"varint,1,opt,name=vote,proto3,enum=layer.dispute.VoteEnum" json:"vote,omitempty"` + VoterPower string `protobuf:"bytes,2,opt,name=voter_power,json=voterPower,proto3" json:"voter_power,omitempty"` + ReporterPower string `protobuf:"bytes,3,opt,name=reporter_power,json=reporterPower,proto3" json:"reporter_power,omitempty"` + TokenholderPower string `protobuf:"bytes,4,opt,name=tokenholder_power,json=tokenholderPower,proto3" json:"tokenholder_power,omitempty"` + RewardClaimed bool `protobuf:"varint,5,opt,name=reward_claimed,json=rewardClaimed,proto3" json:"reward_claimed,omitempty"` } func (x *Voter) Reset() { @@ -1380,6 +1565,27 @@ func (x *Voter) GetVoterPower() string { return "" } +func (x *Voter) GetReporterPower() string { + if x != nil { + return x.ReporterPower + } + return "" +} + +func (x *Voter) GetTokenholderPower() string { + if x != nil { + return x.TokenholderPower + } + return "" +} + +func (x *Voter) GetRewardClaimed() bool { + if x != nil { + return x.RewardClaimed + } + return false +} + var File_layer_dispute_vote_proto protoreflect.FileDescriptor var file_layer_dispute_vote_proto_rawDesc = []byte{ @@ -1407,7 +1613,7 @@ var file_layer_dispute_vote_proto_rawDesc = []byte{ 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x05, 0x56, + 0x52, 0x08, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x22, 0xd7, 0x02, 0x0a, 0x05, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x04, 0x76, 0x6f, 0x74, @@ -1415,33 +1621,46 @@ var file_layer_dispute_vote_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x2a, - 0xa1, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0c, - 0x0a, 0x08, 0x4e, 0x4f, 0x5f, 0x54, 0x41, 0x4c, 0x4c, 0x59, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, - 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x47, 0x41, - 0x49, 0x4e, 0x53, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, - 0x44, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x4e, 0x4f, 0x5f, 0x51, 0x55, 0x4f, 0x52, 0x55, 0x4d, - 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, - 0x54, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x4e, 0x4f, 0x5f, 0x51, 0x55, 0x4f, 0x52, 0x55, 0x4d, - 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x41, 0x47, 0x41, 0x49, 0x4e, 0x53, - 0x54, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x4e, 0x4f, 0x5f, 0x51, 0x55, 0x4f, 0x52, 0x55, 0x4d, - 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, - 0x44, 0x10, 0x06, 0x2a, 0x40, 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, - 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, - 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, - 0x54, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x41, 0x47, 0x41, 0x49, - 0x4e, 0x53, 0x54, 0x10, 0x02, 0x42, 0xa1, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x42, 0x09, 0x56, 0x6f, 0x74, - 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x6c, 0x6f, 0x72, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x64, - 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xa2, 0x02, 0x03, 0x4c, 0x44, 0x58, 0xaa, 0x02, 0x0d, 0x4c, - 0x61, 0x79, 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xca, 0x02, 0x0d, 0x4c, - 0x61, 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xe2, 0x02, 0x19, 0x4c, - 0x61, 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4c, 0x61, 0x79, 0x65, 0x72, - 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x49, 0x6e, 0x74, 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, + 0x52, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x77, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x50, 0x6f, + 0x77, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x11, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x68, 0x6f, 0x6c, 0x64, + 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x10, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x25, 0x0a, + 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x2a, 0xa1, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x4f, 0x5f, 0x54, 0x41, 0x4c, 0x4c, 0x59, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x41, 0x47, 0x41, 0x49, 0x4e, 0x53, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x4e, 0x4f, 0x5f, 0x51, + 0x55, 0x4f, 0x52, 0x55, 0x4d, 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x53, + 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x4e, 0x4f, 0x5f, 0x51, + 0x55, 0x4f, 0x52, 0x55, 0x4d, 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x41, + 0x47, 0x41, 0x49, 0x4e, 0x53, 0x54, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x4e, 0x4f, 0x5f, 0x51, + 0x55, 0x4f, 0x52, 0x55, 0x4d, 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x06, 0x2a, 0x40, 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, + 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x53, + 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x54, 0x45, + 0x5f, 0x41, 0x47, 0x41, 0x49, 0x4e, 0x53, 0x54, 0x10, 0x02, 0x42, 0xa1, 0x01, 0x0a, 0x11, 0x63, + 0x6f, 0x6d, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, + 0x42, 0x09, 0x56, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x6c, 0x6f, 0x72, + 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0xa2, 0x02, 0x03, 0x4c, 0x44, + 0x58, 0xaa, 0x02, 0x0d, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, + 0x65, 0xca, 0x02, 0x0d, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, + 0x65, 0xe2, 0x02, 0x19, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x5c, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, + 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, + 0x4c, 0x61, 0x79, 0x65, 0x72, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x70, 0x75, 0x74, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/layer/bridge/query.proto b/proto/layer/bridge/query.proto index ab853b183..ea0ca27bb 100644 --- a/proto/layer/bridge/query.proto +++ b/proto/layer/bridge/query.proto @@ -21,47 +21,57 @@ service Query { rpc GetEvmValidators(QueryGetEvmValidatorsRequest) returns (QueryGetEvmValidatorsResponse) { option (google.api.http).get = "/layer/bridge/get_evm_validators"; } - + // Queries the latest validator checkpoint rpc GetValidatorCheckpoint(QueryGetValidatorCheckpointRequest) returns (QueryGetValidatorCheckpointResponse) { option (google.api.http).get = "/layer/bridge/get_validator_checkpoint"; } + // Queries the validator checkpoint params for a given timestamp rpc GetValidatorCheckpointParams(QueryGetValidatorCheckpointParamsRequest) returns (QueryGetValidatorCheckpointParamsResponse) { option (google.api.http).get = "/layer/bridge/get_validator_checkpoint_params/{timestamp}"; } + // Queries the validator timestamp by index rpc GetValidatorTimestampByIndex(QueryGetValidatorTimestampByIndexRequest) returns (QueryGetValidatorTimestampByIndexResponse) { option (google.api.http).get = "/layer/bridge/get_validator_timestamp_by_index/{index}"; } + // Queries the validator set signatures for a given timestamp rpc GetValsetSigs(QueryGetValsetSigsRequest) returns (QueryGetValsetSigsResponse) { option (google.api.http).get = "/layer/bridge/get_valset_sigs/{timestamp}"; } + // Queries the evm address by validator address rpc GetEvmAddressByValidatorAddress(QueryGetEvmAddressByValidatorAddressRequest) returns (QueryGetEvmAddressByValidatorAddressResponse) { option (google.api.http).get = "/layer/bridge/get_evm_address_by_validator_address/{validator_address}"; } + // Queries the validator set by timestamp rpc GetValsetByTimestamp(QueryGetValsetByTimestampRequest) returns (QueryGetValsetByTimestampResponse) { option (google.api.http).get = "/layer/bridge/get_valset_by_timestamp/{timestamp}"; } + // Queries a list of snapshots by report query id and timestamp rpc GetSnapshotsByReport(QueryGetSnapshotsByReportRequest) returns (QueryGetSnapshotsByReportResponse) { option (google.api.http).get = "/layer/bridge/get_snapshots_by_report/{query_id}/{timestamp}"; } + // Queries attestation data by snapshot rpc GetAttestationDataBySnapshot(QueryGetAttestationDataBySnapshotRequest) returns (QueryGetAttestationDataBySnapshotResponse) { option (google.api.http).get = "/layer/bridge/get_attestation_data_by_snapshot/{snapshot}"; } + // Queries the set of attestations by snapshot rpc GetAttestationsBySnapshot(QueryGetAttestationsBySnapshotRequest) returns (QueryGetAttestationsBySnapshotResponse) { option (google.api.http).get = "/layer/bridge/get_attestations_by_snapshot/{snapshot}"; } + // Queries the validator set index by timestamp rpc GetValidatorSetIndexByTimestamp(QueryGetValidatorSetIndexByTimestampRequest) returns (QueryGetValidatorSetIndexByTimestampResponse) { option (google.api.http).get = "/layer/bridge/get_validator_set_index_by_timestamp/{timestamp}"; } + // Queries the current validator set timestamp rpc GetCurrentValidatorSetTimestamp(QueryGetCurrentValidatorSetTimestampRequest) returns (QueryGetCurrentValidatorSetTimestampResponse) { option (google.api.http).get = "/layer/bridge/get_current_validator_set_timestamp"; } diff --git a/proto/layer/dispute/dispute.proto b/proto/layer/dispute/dispute.proto index a1c0f4145..21741be4c 100644 --- a/proto/layer/dispute/dispute.proto +++ b/proto/layer/dispute/dispute.proto @@ -66,6 +66,15 @@ message Dispute { uint64 block_number = 15; bool open = 16; repeated layer.oracle.MicroReport additional_evidence = 17; + // total tokens allocated to voters + string voter_reward = 18 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // pending execution is true if the dispute has reached quorum and is pending execution. + // however, if a new dispute round begins, this is set to false again + bool pending_execution = 19; } // DisputeCategory defines the severity of a dispute. diff --git a/proto/layer/dispute/tx.proto b/proto/layer/dispute/tx.proto index ae418e13a..626c712a8 100644 --- a/proto/layer/dispute/tx.proto +++ b/proto/layer/dispute/tx.proto @@ -18,10 +18,9 @@ service Msg { rpc AddFeeToDispute(MsgAddFeeToDispute) returns (MsgAddFeeToDisputeResponse); rpc Vote(MsgVote) returns (MsgVoteResponse); rpc UpdateTeam(MsgUpdateTeam) returns (MsgUpdateTeamResponse); - rpc TallyVote(MsgTallyVote) returns (MsgTallyVoteResponse); - rpc ExecuteDispute(MsgExecuteDispute) returns (MsgExecuteDisputeResponse); rpc WithdrawFeeRefund(MsgWithdrawFeeRefund) returns (MsgWithdrawFeeRefundResponse); rpc AddEvidence(MsgAddEvidence) returns (MsgAddEvidenceResponse); + rpc ClaimReward(MsgClaimReward) returns (MsgClaimRewardResponse); } message MsgAddEvidence { @@ -42,22 +41,6 @@ message MsgWithdrawFeeRefund { message MsgWithdrawFeeRefundResponse {} -message MsgExecuteDispute { - option (cosmos.msg.v1.signer) = "caller_address"; - string caller_address = 1; - uint64 dispute_id = 2; -} - -message MsgExecuteDisputeResponse {} - -message MsgTallyVote { - option (cosmos.msg.v1.signer) = "caller_address"; - string caller_address = 1; - uint64 dispute_id = 2; -} - -message MsgTallyVoteResponse {} - message MsgProposeDispute { option (cosmos.msg.v1.signer) = "creator"; string creator = 1; @@ -95,3 +78,11 @@ message MsgUpdateTeam { } message MsgUpdateTeamResponse {} + +message MsgClaimReward { + option (cosmos.msg.v1.signer) = "caller_address"; + string caller_address = 1; + uint64 dispute_id = 2; +} + +message MsgClaimRewardResponse {} diff --git a/proto/layer/dispute/vote.proto b/proto/layer/dispute/vote.proto index 537999744..20ac27f05 100644 --- a/proto/layer/dispute/vote.proto +++ b/proto/layer/dispute/vote.proto @@ -45,4 +45,15 @@ message Voter { (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; + string reporter_power = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string tokenholder_power = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + bool reward_claimed = 5; } diff --git a/tests/e2e/basic_dispute_test.go b/tests/e2e/basic_dispute_test.go index b551b8ef5..8ece7cec0 100644 --- a/tests/e2e/basic_dispute_test.go +++ b/tests/e2e/basic_dispute_test.go @@ -228,6 +228,7 @@ func (s *E2ETestSuite) TestDisputes() { disputes, err := s.Setup.Disputekeeper.GetOpenDisputes(s.Setup.Ctx) require.NoError(err) require.NotNil(disputes) + require.Equal(1, len(disputes)) // dispute is created correctly dispute, err := s.Setup.Disputekeeper.Disputes.Get(s.Setup.Ctx, 1) require.NoError(err) @@ -240,6 +241,11 @@ func (s *E2ETestSuite) TestDisputes() { require.Equal(feepayer.Amount, disputeFee.Amount) require.Equal(feepayer.FromBond, false) slashAmount := dispute.SlashAmount + firstDisputeVoteMsg := disputetypes.MsgVote{ + Voter: reporterAccount.String(), + Id: dispute.DisputeId, + Vote: disputetypes.VoteEnum_VOTE_SUPPORT, + } _, err = s.Setup.App.EndBlocker(s.Setup.Ctx) require.NoError(err) @@ -300,8 +306,10 @@ func (s *E2ETestSuite) TestDisputes() { QueryData: cycleListQuery, Value: value, } + secReportQueryId := utils.QueryIDFromData(cycleListQuery) // send reveal message revealResponse, err = msgServerOracle.SubmitValue(s.Setup.Ctx, &reveal) + revealBlock = s.Setup.Ctx.BlockHeight() require.NoError(err) require.NotNil(revealResponse) // advance block height to expire the query and aggregate report @@ -357,6 +365,7 @@ func (s *E2ETestSuite) TestDisputes() { require.NoError(err) balBeforeDispute, err = s.Setup.Reporterkeeper.ReporterStake(s.Setup.Ctx, reporterAccount) + fmt.Println("Balance before dispute: ", balBeforeDispute) require.NoError(err) fivePercent := balBeforeDispute.Mul(math.NewInt(5)).Quo(math.NewInt(100)) disputeFee = sdk.NewCoin(s.Setup.Denom, fivePercent) @@ -364,12 +373,14 @@ func (s *E2ETestSuite) TestDisputes() { report = oracletypes.MicroReport{ Reporter: reporterAccount.String(), Power: balBeforeDispute.Quo(sdk.DefaultPowerReduction).Uint64(), - QueryId: queryId, + QueryId: secReportQueryId, Value: value, Timestamp: s.Setup.Ctx.BlockTime(), BlockNumber: uint64(revealBlock), } + fmt.Println("Report power: ", report.Power) + // create msg for propose dispute tx msgProposeDispute = disputetypes.MsgProposeDispute{ Creator: reporterAccount.String(), @@ -406,6 +417,7 @@ func (s *E2ETestSuite) TestDisputes() { // dispute is created correctly burnAmount = disputeFee.Amount.MulRaw(1).QuoRaw(20) dispute, err = s.Setup.Disputekeeper.GetDisputeByReporter(s.Setup.Ctx, report, disputetypes.Minor) + fmt.Printf("Dispute: %v,\r Report: %v\r", dispute, report) require.NoError(err) require.Equal(dispute.DisputeCategory, disputetypes.Minor) require.Equal(dispute.DisputeStatus, disputetypes.Voting) @@ -415,13 +427,17 @@ func (s *E2ETestSuite) TestDisputes() { require.Equal(feepayer.Amount, disputeFee.Amount) require.Equal(feepayer.FromBond, false) + firstVoteReponse, err := msgServerDispute.Vote(s.Setup.Ctx, &firstDisputeVoteMsg) + require.NoError(err) + require.NotNil(firstVoteReponse) + // create vote tx msg msgVote := disputetypes.MsgVote{ Voter: reporterAccount.String(), Id: dispute.DisputeId, Vote: disputetypes.VoteEnum_VOTE_SUPPORT, } - // send vote tx + // send vote tx for second dispute voteResponse, err := msgServerDispute.Vote(s.Setup.Ctx, &msgVote) require.NoError(err) require.NotNil(voteResponse) diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index d2a7da162..6d87def36 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -653,6 +653,7 @@ func (s *E2ETestSuite) TestDisputes2() { Id: dispute.DisputeId, Vote: disputetypes.VoteEnum_VOTE_SUPPORT, } + fmt.Println("Dispute Id on rep[0] vote: ", dispute.DisputeId) voteResponse, err := msgServerDispute.Vote(s.Setup.Ctx, &msgVote) require.NoError(err) require.NotNil(voteResponse) @@ -663,6 +664,7 @@ func (s *E2ETestSuite) TestDisputes2() { Id: dispute.DisputeId, Vote: disputetypes.VoteEnum_VOTE_SUPPORT, } + voteResponse, err = msgServerDispute.Vote(s.Setup.Ctx, &msgVote) require.NoError(err) require.NotNil(voteResponse) @@ -679,6 +681,8 @@ func (s *E2ETestSuite) TestDisputes2() { require.NoError(err) require.NotNil(voteResponse) + s.Setup.Ctx = s.Setup.Ctx.WithBlockHeight(s.Setup.Ctx.BlockHeight() + 1) + // vote from team // fmt.Println(disputetypes.TeamAddress) // msgVote = disputetypes.MsgVote{ @@ -697,15 +701,6 @@ func (s *E2ETestSuite) TestDisputes2() { totalReporterPower, err := s.Setup.Reporterkeeper.TotalReporterPower(s.Setup.Ctx) require.NoError(err) fmt.Println("total reporter power: ", totalReporterPower.Quo(sdk.DefaultPowerReduction)) - reporter1Power, err := s.Setup.Disputekeeper.ReportersGroup.Get(s.Setup.Ctx, collections.Join(dispute.DisputeId, repsAccs[0].Bytes())) - require.NoError(err) - fmt.Println("reporter1 Power: ", reporter1Power) - reporter2Power, err := s.Setup.Disputekeeper.ReportersGroup.Get(s.Setup.Ctx, collections.Join(dispute.DisputeId, repsAccs[1].Bytes())) - require.NoError(err) - fmt.Println("reporter2 Power: ", reporter2Power) - reporter3Power, err := s.Setup.Disputekeeper.ReportersGroup.Get(s.Setup.Ctx, collections.Join(dispute.DisputeId, repsAccs[2].Bytes())) - require.NoError(err) - fmt.Println("reporter3 Power: ", reporter3Power) totalFreeFloatingTokens := s.Setup.Disputekeeper.GetTotalSupply(s.Setup.Ctx) fmt.Println("total Free Floating Tokens: ", totalFreeFloatingTokens) diff --git a/tests/integration/dispute_keeper_test.go b/tests/integration/dispute_keeper_test.go index 0ed1aa31f..b0e9f456d 100644 --- a/tests/integration/dispute_keeper_test.go +++ b/tests/integration/dispute_keeper_test.go @@ -23,10 +23,11 @@ import ( func (s *IntegrationTestSuite) TestVotingOnDispute() { msgServer := keeper.NewMsgServerImpl(s.Setup.Disputekeeper) - _, valAddrs, _ := s.createValidatorAccs([]uint64{1000}) + _, valAddrs, _ := s.createValidatorAccs([]uint64{50}) // creates validator with 100 power valAddr := valAddrs[0] repAddr := sdk.AccAddress(valAddr) valBond, err := s.Setup.Stakingkeeper.GetValidator(s.Setup.Ctx, valAddr) + s.NoError(err) dels, err := s.Setup.Stakingkeeper.GetValidatorDelegations(s.Setup.Ctx, valAddr) s.NoError(err) @@ -98,12 +99,11 @@ func (s *IntegrationTestSuite) TestVotingOnDispute() { // vote on dispute // mint more tokens to disputer to give voting power s.Setup.MintTokens(disputer, math.NewInt(1_000_000)) - _, err = msgServer.Vote(s.Setup.Ctx, &types.MsgVote{ + _, _ = msgServer.Vote(s.Setup.Ctx, &types.MsgVote{ Voter: disputer.String(), Id: 1, Vote: types.VoteEnum_VOTE_SUPPORT, }) - s.NoError(err) vtr, err := s.Setup.Disputekeeper.Voter.Get(s.Setup.Ctx, collections.Join(uint64(1), disputer.Bytes())) s.NoError(err) s.Equal(types.VoteEnum_VOTE_SUPPORT, vtr.Vote) @@ -120,7 +120,7 @@ func (s *IntegrationTestSuite) TestVotingOnDispute() { func (s *IntegrationTestSuite) TestProposeDisputeFromBond() { msgServer := keeper.NewMsgServerImpl(s.Setup.Disputekeeper) - _, valAddrs, _ := s.createValidatorAccs([]uint64{1000}) + _, valAddrs, _ := s.createValidatorAccs([]uint64{500}) valAddr := valAddrs[0] repAddr := sdk.AccAddress(valAddr) @@ -147,7 +147,7 @@ func (s *IntegrationTestSuite) TestProposeDisputeFromBond() { qId, _ := hex.DecodeString("83a7f3d48786ac2667503a61e8c415438ed2922eb86a2906e4ee66d9a2ce4992") report := oracletypes.MicroReport{ Reporter: repAddr.String(), - Power: 100, + Power: 1000, QueryId: qId, Value: "000000000000000000000000000000000000000000000058528649cf80ee0000", Timestamp: time.Unix(1696516597, 0), @@ -158,7 +158,7 @@ func (s *IntegrationTestSuite) TestProposeDisputeFromBond() { Creator: repAddr.String(), Report: &report, DisputeCategory: types.Warning, - Fee: sdk.NewCoin(s.Setup.Denom, math.NewInt(1_000_000)), // one percent dispute fee + Fee: sdk.NewCoin(s.Setup.Denom, math.NewInt(10_000_000)), // one percent dispute fee PayFromBond: true, }) s.NoError(err) @@ -182,9 +182,10 @@ func (s *IntegrationTestSuite) TestProposeDisputeFromBond() { func (s *IntegrationTestSuite) TestExecuteVoteInvalid() { msgServer := keeper.NewMsgServerImpl(s.Setup.Disputekeeper) - _, valAddrs, _ := s.createValidatorAccs([]uint64{1000}) + _, valAddrs, _ := s.createValidatorAccs([]uint64{50}) repAccs := s.CreateAccountsWithTokens(3, 100*1e6) disputer := s.newKeysWithTokens() + s.Setup.MintTokens(disputer, math.NewInt(100_000_000)) delegators := repAccs valAddr := valAddrs[0] repAddr := sdk.AccAddress(valAddr) @@ -209,7 +210,7 @@ func (s *IntegrationTestSuite) TestExecuteVoteInvalid() { s.NoError(s.Setup.Reporterkeeper.Reporters.Set(s.Setup.Ctx, repAddr, reportertypes.NewReporter(reportertypes.DefaultMinCommissionRate, math.OneInt()))) s.NoError(s.Setup.Reporterkeeper.Selectors.Set(s.Setup.Ctx, repAddr, reportertypes.NewSelection(repAddr, uint64(len(dels))))) - repTokens, err := s.Setup.Reporterkeeper.ReporterStake(s.Setup.Ctx, repAddr) + repTokensBeforePropose, err := s.Setup.Reporterkeeper.ReporterStake(s.Setup.Ctx, repAddr) s.NoError(err) qId, _ := hex.DecodeString("83a7f3d48786ac2667503a61e8c415438ed2922eb86a2906e4ee66d9a2ce4992") report := oracletypes.MicroReport{ @@ -234,7 +235,7 @@ func (s *IntegrationTestSuite) TestExecuteVoteInvalid() { s.NoError(err) s.True(s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, disputer, s.Setup.Denom).IsLT(disputerBalanceBefore)) - s.NoError(dispute.CheckPrevoteDisputesForExpiration(s.Setup.Ctx, s.Setup.Disputekeeper)) + s.NoError(dispute.CheckOpenDisputesForExpiration(s.Setup.Ctx, s.Setup.Disputekeeper)) votes := []types.MsgVote{ { @@ -265,17 +266,17 @@ func (s *IntegrationTestSuite) TestExecuteVoteInvalid() { } } + valTokensBeforeExecuteVote, err := s.Setup.Stakingkeeper.GetValidator(s.Setup.Ctx, valAddr) + s.NoError(err) + disputerBalanceBeforeExecuteVote := s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, disputer, s.Setup.Denom) // only 25 percent of the total power voted so vote should not be tallied unless it's expired s.Setup.Ctx = s.Setup.Ctx.WithBlockTime(s.Setup.Ctx.BlockTime().Add(keeper.THREE_DAYS + 1)) - // // tally vote - err = s.Setup.Disputekeeper.TallyVote(s.Setup.Ctx, 1) + _, err = s.Setup.App.BeginBlocker(s.Setup.Ctx) s.NoError(err) - - repTknBeforeExecuteVote := repTokens - disputerBalanceBeforeExecuteVote := s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, disputer, s.Setup.Denom) - // execute vote - err = s.Setup.Disputekeeper.ExecuteVote(s.Setup.Ctx, 1) + voteInfo, err := s.Setup.Disputekeeper.Votes.Get(s.Setup.Ctx, 1) s.NoError(err) + s.True(voteInfo.Executed) + s.Equal(types.VoteResult_NO_QUORUM_MAJORITY_INVALID, voteInfo.VoteResult) _, err = msgServer.WithdrawFeeRefund(s.Setup.Ctx, &types.MsgWithdrawFeeRefund{CallerAddress: disputer.String(), PayerAddress: disputer.String(), Id: 1}) s.NoError(err) @@ -285,18 +286,18 @@ func (s *IntegrationTestSuite) TestExecuteVoteInvalid() { } _, err = reporterServer.UnjailReporter(s.Setup.Ctx, req) s.NoError(err) - repTokens, err = s.Setup.Reporterkeeper.ReporterStake(s.Setup.Ctx, repAddr) + repTokensAfterExecuteVote, err := s.Setup.Reporterkeeper.ReporterStake(s.Setup.Ctx, repAddr) s.NoError(err) - fmt.Println(repTokens, repTknBeforeExecuteVote) - // s.True(repTokens.GT(repTknBeforeExecuteVote)) - // // dispute fee returned so balance should be the same as before paying fee + s.True(repTokensBeforePropose.Equal(repTokensAfterExecuteVote)) + valTokensAfterExecuteVote, err := s.Setup.Stakingkeeper.GetValidator(s.Setup.Ctx, valAddr) + s.NoError(err) + s.True(valTokensAfterExecuteVote.Tokens.GT(valTokensBeforeExecuteVote.Tokens)) disputerBalanceAfterExecuteVote := s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, disputer, s.Setup.Denom) iter, err := s.Setup.Disputekeeper.Voter.Indexes.VotersById.MatchExact(s.Setup.Ctx, uint64(1)) s.NoError(err) keys, err := iter.PrimaryKeys() s.NoError(err) voters := make([]keeper.VoterInfo, len(keys)) - disputerInfo := keeper.VoterInfo{Share: math.ZeroInt()} totalVoterPower := math.ZeroInt() for i := range keys { v, err := s.Setup.Disputekeeper.Voter.Get(s.Setup.Ctx, keys[i]) @@ -304,15 +305,24 @@ func (s *IntegrationTestSuite) TestExecuteVoteInvalid() { voters[i] = keeper.VoterInfo{Voter: keys[i].K2(), Power: v.VoterPower} totalVoterPower = totalVoterPower.Add(v.VoterPower) } - rewards, _ := s.Setup.Disputekeeper.CalculateVoterShare(s.Setup.Ctx, voters, burnAmount.QuoRaw(2), totalVoterPower) - for i := range rewards { - if rewards[i].Voter.String() == disputer.String() { - disputerInfo = rewards[i] - } - } - // // add dispute fee returned minus burn amount plus the voter reward - disputerBalanceBeforeExecuteVote.Amount = disputerBalanceBeforeExecuteVote.Amount.Add(disputeFee.Sub(burnAmount)).Add(disputerInfo.Share) - s.Equal(disputerBalanceBeforeExecuteVote, disputerBalanceAfterExecuteVote) + expectedDisputerBalAfterExecute := disputerBalanceBeforeExecuteVote.Amount.Add(disputeFee.Sub(burnAmount)) + s.Equal(expectedDisputerBalAfterExecute, disputerBalanceAfterExecuteVote.Amount) + disputerVoterReward, err := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, disputer, 1) + s.NoError(err) + reporterVoterReward, err := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, repAddr, 1) + s.NoError(err) + delegator1VoterReward, err := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, delegators[1], 1) + s.NoError(err) + delegator2VoterReward, err := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, delegators[2], 1) + s.NoError(err) + _, err = msgServer.ClaimReward(s.Setup.Ctx, &types.MsgClaimReward{CallerAddress: disputer.String(), DisputeId: 1}) + s.NoError(err) + disputerBalAfterClaim := s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, disputer, s.Setup.Denom) + expectedDisputerBalAfterClaim := disputerBalanceAfterExecuteVote.Amount.Add(disputerVoterReward) + s.Equal(expectedDisputerBalAfterClaim, disputerBalAfterClaim.Amount) + sumVoterRewards := disputerVoterReward.Add(reporterVoterReward).Add(delegator1VoterReward).Add(delegator2VoterReward) + s.True(sumVoterRewards.LTE(burnAmount.Quo(math.NewInt(2)))) + s.True(sumVoterRewards.GTE(burnAmount.Quo(math.NewInt(2)).Sub(math.NewInt(4)))) // max one loya per voter lost via rounding } func (s *IntegrationTestSuite) TestExecuteVoteNoQuorumInvalid() { @@ -328,12 +338,20 @@ func (s *IntegrationTestSuite) TestExecuteVoteNoQuorumInvalid() { s.NoError(s.Setup.Reporterkeeper.Reporters.Set(s.Setup.Ctx, repAddr, reportertypes.NewReporter(reportertypes.DefaultMinCommissionRate, math.OneInt()))) s.NoError(s.Setup.Reporterkeeper.Selectors.Set(s.Setup.Ctx, repAddr, reportertypes.NewSelection(repAddr, 1))) - stake, err := s.Setup.Reporterkeeper.ReporterStake(s.Setup.Ctx, repAddr) + repStake, _ := s.Setup.Reporterkeeper.ReporterStake(s.Setup.Ctx, repAddr) + fmt.Println("\nrepStake", repStake) + valStakeBeforePropose, err := s.Setup.Stakingkeeper.GetValidator(s.Setup.Ctx, valAddr) s.NoError(err) + fmt.Println("\nvalStakeBeforePropose", valStakeBeforePropose.Tokens) + s.NoError(err) + currentBlock := s.Setup.Ctx.BlockHeight() + delTokensAtBlock, err := s.Setup.Reporterkeeper.GetDelegatorTokensAtBlock(s.Setup.Ctx, valAddr.Bytes(), uint64(currentBlock)) + s.NoError(err) + fmt.Println("\ndelTokensAtBlock", delTokensAtBlock) qId, _ := hex.DecodeString("83a7f3d48786ac2667503a61e8c415438ed2922eb86a2906e4ee66d9a2ce4992") report := oracletypes.MicroReport{ Reporter: repAddr.String(), - Power: stake.Quo(sdk.DefaultPowerReduction).Uint64(), + Power: repStake.Quo(sdk.DefaultPowerReduction).Uint64(), QueryId: qId, Value: "000000000000000000000000000000000000000000000058528649cf80ee0000", Timestamp: time.Unix(1696516597, 0), @@ -359,8 +377,7 @@ func (s *IntegrationTestSuite) TestExecuteVoteNoQuorumInvalid() { }, } // start vote - _, err = msgServer.Vote(s.Setup.Ctx, &vote[0]) - s.NoError(err) + _, _ = msgServer.Vote(s.Setup.Ctx, &vote[0]) ctx := s.Setup.Ctx.WithBlockTime(s.Setup.Ctx.BlockTime().Add(keeper.THREE_DAYS + 1)) err = s.Setup.Disputekeeper.TallyVote(ctx, 1) @@ -418,10 +435,10 @@ func (s *IntegrationTestSuite) TestExecuteVoteSupport() { Value: "000000000000000000000000000000000000000000000058528649cf80ee0000", Timestamp: time.Unix(1696516597, 0), } + fmt.Println("Disputed report power: ", report.Power) disputeFee, err := s.Setup.Disputekeeper.GetDisputeFee(s.Setup.Ctx, report, types.Warning) s.NoError(err) fivePercentBurn := disputeFee.MulRaw(1).QuoRaw(20) - twoPercentBurn := fivePercentBurn.QuoRaw(2) _, err = msgServer.ProposeDispute(s.Setup.Ctx, &types.MsgProposeDispute{ Creator: disputer.String(), Report: &report, @@ -429,7 +446,7 @@ func (s *IntegrationTestSuite) TestExecuteVoteSupport() { DisputeCategory: types.Warning, }) s.NoError(err) - s.NoError(dispute.CheckPrevoteDisputesForExpiration(s.Setup.Ctx, s.Setup.Disputekeeper)) + s.NoError(dispute.CheckOpenDisputesForExpiration(s.Setup.Ctx, s.Setup.Disputekeeper)) votersBalanceBefore := map[string]sdk.Coin{ repAddr.String(): s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, repAddr, s.Setup.Denom), @@ -437,6 +454,7 @@ func (s *IntegrationTestSuite) TestExecuteVoteSupport() { delegators[1].String(): s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, delegators[1], s.Setup.Denom), delegators[2].String(): s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, delegators[2], s.Setup.Denom), } + votes := []types.MsgVote{ { Voter: repAddr.String(), @@ -467,9 +485,11 @@ func (s *IntegrationTestSuite) TestExecuteVoteSupport() { } fmt.Println("rep", repAddr.String()) err = s.Setup.Disputekeeper.TallyVote(s.Setup.Ctx, 1) - s.NoError(err) + s.Equal(err.Error(), "vote already tallied") // execute vote - s.NoError(s.Setup.Disputekeeper.ExecuteVote(s.Setup.Ctx, 1)) + s.Setup.Ctx = s.Setup.Ctx.WithBlockTime(s.Setup.Ctx.BlockTime().Add(keeper.THREE_DAYS + 1)) + _, err = s.Setup.App.BeginBlocker(s.Setup.Ctx) + s.NoError(err) _, err = msgServer.WithdrawFeeRefund(s.Setup.Ctx, &types.MsgWithdrawFeeRefund{CallerAddress: disputer.String(), PayerAddress: disputer.String(), Id: 1}) s.NoError(err) @@ -479,6 +499,14 @@ func (s *IntegrationTestSuite) TestExecuteVoteSupport() { // should still be jailed s.True(reporterAfter.Jailed) + for i := range votes { + _, err = msgServer.ClaimReward(s.Setup.Ctx, &types.MsgClaimReward{CallerAddress: votes[i].Voter, DisputeId: 1}) + if err != nil { + fmt.Printf("Reporter address: %s, currentAddr: %s\r", repAddr.String(), votes[i].Voter) + s.Equal(err.Error(), "reward is zero") + } + } + votersBalanceAfter := map[string]sdk.Coin{ repAddr.String(): s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, repAddr, s.Setup.Denom), disputer.String(): s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, disputer, s.Setup.Denom), @@ -489,6 +517,7 @@ func (s *IntegrationTestSuite) TestExecuteVoteSupport() { iter, err := s.Setup.Disputekeeper.Voter.Indexes.VotersById.MatchExact(s.Setup.Ctx, uint64(1)) s.NoError(err) keys, err := iter.PrimaryKeys() + fmt.Println("Length of voters returned: ", len(keys)) s.NoError(err) voters := make([]keeper.VoterInfo, len(keys)) totalVoterPower := math.ZeroInt() @@ -498,13 +527,15 @@ func (s *IntegrationTestSuite) TestExecuteVoteSupport() { voters[i] = keeper.VoterInfo{Voter: keys[i].K2(), Power: v.VoterPower} totalVoterPower = totalVoterPower.Add(v.VoterPower) } - votersReward, _ := s.Setup.Disputekeeper.CalculateVoterShare(s.Setup.Ctx, voters, twoPercentBurn, totalVoterPower) - for i, v := range votersReward { - voterBal := votersBalanceBefore[v.Voter.String()].AddAmount(votersReward[i].Share) - if bytes.Equal(disputer, votersReward[i].Voter) { + + for _, v := range voters { + votersReward, _ := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, v.Voter, 1) + voterBal := votersBalanceBefore[v.Voter.String()].AddAmount(votersReward) + if bytes.Equal(disputer, v.Voter) { // disputer gets the dispute fee they paid minus the 5% burn for a one rounder dispute voterBal = voterBal.AddAmount(disputeFee.Sub(fivePercentBurn)) } + fmt.Printf("Reporter: %s, VoterBalanceBefore: %v, VotersReward: %v, VotersBalanceAfter: %v, votersBal: %v\r", v.Voter.String(), votersBalanceBefore[v.Voter.String()].Amount.Uint64(), votersReward.Uint64(), votersBalanceAfter[v.Voter.String()].Amount.Uint64(), voterBal.Amount.Uint64()) s.Equal(voterBal, votersBalanceAfter[v.Voter.String()]) } disputerDelgation, err := s.Setup.Stakingkeeper.GetDelegatorBonded(s.Setup.Ctx, disputer) @@ -602,13 +633,8 @@ func (s *IntegrationTestSuite) TestExecuteVoteAgainst() { s.NoError(err) fmt.Println(val.Tokens) // tally vote - err = s.Setup.Disputekeeper.TallyVote(s.Setup.Ctx, 1) + _, err = s.Setup.App.BeginBlocker(s.Setup.Ctx) s.NoError(err) - // execute vote - err = s.Setup.Disputekeeper.ExecuteVote(s.Setup.Ctx, 1) - s.NoError(err) - // reporterAfterDispute, err := s.Setup.Reporterkeeper.Reporter(s.Setup.Ctx, repAddr) - // s.NoError(err) // s.Equal(stake.Add(disputeFeeMinusBurn), reporterAfterDispute.TotalTokens) votersBalanceAfter := map[string]sdk.Coin{ @@ -630,13 +656,40 @@ func (s *IntegrationTestSuite) TestExecuteVoteAgainst() { voters[i] = keeper.VoterInfo{Voter: keys[i].K2(), Power: v.VoterPower, Share: math.ZeroInt()} totalVoterPower = totalVoterPower.Add(v.VoterPower) } - votersReward, _ := s.Setup.Disputekeeper.CalculateVoterShare(s.Setup.Ctx, voters, twoPercentBurn, totalVoterPower) + // votersReward, _ := s.Setup.Disputekeeper.CalculateVoterShare(s.Setup.Ctx, voters, twoPercentBurn, totalVoterPower) + fmt.Println("twoPercentBurn", twoPercentBurn) - for _, v := range votersReward { + for _, v := range voters { newBal := votersBalanceBefore[v.Voter.String()].Amount.Add(v.Share) + fmt.Println(newBal) // votersBalanceBefore[votersReward[i].Voter.String()].Amount = votersBalanceBefore[i].Amount.Add(votersReward[i].Share) s.Equal(newBal, votersBalanceAfter[v.Voter.String()].Amount) } + + // execute vote + s.NoError(s.Setup.Disputekeeper.ExecuteVote(s.Setup.Ctx, 1)) + + // Check voter rewards + disputerVoterReward, err := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, disputer, 1) + s.NoError(err) + reporterVoterReward, err := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, repAddr, 1) + s.NoError(err) + delegator1VoterReward, err := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, delegators[1], 1) + s.NoError(err) + delegator2VoterReward, err := s.Setup.Disputekeeper.CalculateReward(s.Setup.Ctx, delegators[2], 1) + s.NoError(err) + + // Claim rewards and check balances + _, err = msgServer.ClaimReward(s.Setup.Ctx, &types.MsgClaimReward{CallerAddress: disputer.String(), DisputeId: 1}) + s.NoError(err) + disputerBalAfterClaim := s.Setup.Bankkeeper.GetBalance(s.Setup.Ctx, disputer, s.Setup.Denom) + expectedDisputerBalAfterClaim := votersBalanceAfter[disputer.String()].Amount.Add(disputerVoterReward) + s.Equal(expectedDisputerBalAfterClaim, disputerBalAfterClaim.Amount) + + // Check total voter rewards are less than or equal to 50% of burn amount + sumVoterRewards := disputerVoterReward.Add(reporterVoterReward).Add(delegator1VoterReward).Add(delegator2VoterReward) + s.True(sumVoterRewards.LTE(twoPercentBurn)) + s.True(sumVoterRewards.GTE(twoPercentBurn.Sub(math.NewInt(4)))) // max one loya per voter lost via rounding } func (s *IntegrationTestSuite) TestDisputeMultipleRounds() { diff --git a/testutil/keeper/dispute.go b/testutil/keeper/dispute.go index 0779eb065..efdac53d3 100644 --- a/testutil/keeper/dispute.go +++ b/testutil/keeper/dispute.go @@ -57,7 +57,7 @@ func DisputeKeeper(tb testing.TB) ( if err != nil { panic(err) } - err = k.Dust.Set(ctx, math.LegacyZeroDec()) + err = k.Dust.Set(ctx, math.ZeroInt()) if err != nil { panic(err) } diff --git a/types/global.go b/types/global.go index f4fa60aa3..f92e49339 100644 --- a/types/global.go +++ b/types/global.go @@ -10,9 +10,9 @@ var ( BondDenom = "loya" OneTrb = math.NewInt(1_000_000) - // one percent of 1TRB + // one percent of 1TRB. // min stake is 1TRB so min dispute fee would be 1% of 1TRB - OnePercent = math.NewInt(1_000) + OnePercent = math.NewInt(10_000) PowerReduction = sdk.DefaultPowerReduction ) diff --git a/x/bridge/types/query.pb.go b/x/bridge/types/query.pb.go index 76055f17e..ce3edcedb 100644 --- a/x/bridge/types/query.pb.go +++ b/x/bridge/types/query.pb.go @@ -1802,16 +1802,27 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a list of GetEvmValidators items. GetEvmValidators(ctx context.Context, in *QueryGetEvmValidatorsRequest, opts ...grpc.CallOption) (*QueryGetEvmValidatorsResponse, error) + // Queries the latest validator checkpoint GetValidatorCheckpoint(ctx context.Context, in *QueryGetValidatorCheckpointRequest, opts ...grpc.CallOption) (*QueryGetValidatorCheckpointResponse, error) + // Queries the validator checkpoint params for a given timestamp GetValidatorCheckpointParams(ctx context.Context, in *QueryGetValidatorCheckpointParamsRequest, opts ...grpc.CallOption) (*QueryGetValidatorCheckpointParamsResponse, error) + // Queries the validator timestamp by index GetValidatorTimestampByIndex(ctx context.Context, in *QueryGetValidatorTimestampByIndexRequest, opts ...grpc.CallOption) (*QueryGetValidatorTimestampByIndexResponse, error) + // Queries the validator set signatures for a given timestamp GetValsetSigs(ctx context.Context, in *QueryGetValsetSigsRequest, opts ...grpc.CallOption) (*QueryGetValsetSigsResponse, error) + // Queries the evm address by validator address GetEvmAddressByValidatorAddress(ctx context.Context, in *QueryGetEvmAddressByValidatorAddressRequest, opts ...grpc.CallOption) (*QueryGetEvmAddressByValidatorAddressResponse, error) + // Queries the validator set by timestamp GetValsetByTimestamp(ctx context.Context, in *QueryGetValsetByTimestampRequest, opts ...grpc.CallOption) (*QueryGetValsetByTimestampResponse, error) + // Queries a list of snapshots by report query id and timestamp GetSnapshotsByReport(ctx context.Context, in *QueryGetSnapshotsByReportRequest, opts ...grpc.CallOption) (*QueryGetSnapshotsByReportResponse, error) + // Queries attestation data by snapshot GetAttestationDataBySnapshot(ctx context.Context, in *QueryGetAttestationDataBySnapshotRequest, opts ...grpc.CallOption) (*QueryGetAttestationDataBySnapshotResponse, error) + // Queries the set of attestations by snapshot GetAttestationsBySnapshot(ctx context.Context, in *QueryGetAttestationsBySnapshotRequest, opts ...grpc.CallOption) (*QueryGetAttestationsBySnapshotResponse, error) + // Queries the validator set index by timestamp GetValidatorSetIndexByTimestamp(ctx context.Context, in *QueryGetValidatorSetIndexByTimestampRequest, opts ...grpc.CallOption) (*QueryGetValidatorSetIndexByTimestampResponse, error) + // Queries the current validator set timestamp GetCurrentValidatorSetTimestamp(ctx context.Context, in *QueryGetCurrentValidatorSetTimestampRequest, opts ...grpc.CallOption) (*QueryGetCurrentValidatorSetTimestampResponse, error) } @@ -1946,16 +1957,27 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a list of GetEvmValidators items. GetEvmValidators(context.Context, *QueryGetEvmValidatorsRequest) (*QueryGetEvmValidatorsResponse, error) + // Queries the latest validator checkpoint GetValidatorCheckpoint(context.Context, *QueryGetValidatorCheckpointRequest) (*QueryGetValidatorCheckpointResponse, error) + // Queries the validator checkpoint params for a given timestamp GetValidatorCheckpointParams(context.Context, *QueryGetValidatorCheckpointParamsRequest) (*QueryGetValidatorCheckpointParamsResponse, error) + // Queries the validator timestamp by index GetValidatorTimestampByIndex(context.Context, *QueryGetValidatorTimestampByIndexRequest) (*QueryGetValidatorTimestampByIndexResponse, error) + // Queries the validator set signatures for a given timestamp GetValsetSigs(context.Context, *QueryGetValsetSigsRequest) (*QueryGetValsetSigsResponse, error) + // Queries the evm address by validator address GetEvmAddressByValidatorAddress(context.Context, *QueryGetEvmAddressByValidatorAddressRequest) (*QueryGetEvmAddressByValidatorAddressResponse, error) + // Queries the validator set by timestamp GetValsetByTimestamp(context.Context, *QueryGetValsetByTimestampRequest) (*QueryGetValsetByTimestampResponse, error) + // Queries a list of snapshots by report query id and timestamp GetSnapshotsByReport(context.Context, *QueryGetSnapshotsByReportRequest) (*QueryGetSnapshotsByReportResponse, error) + // Queries attestation data by snapshot GetAttestationDataBySnapshot(context.Context, *QueryGetAttestationDataBySnapshotRequest) (*QueryGetAttestationDataBySnapshotResponse, error) + // Queries the set of attestations by snapshot GetAttestationsBySnapshot(context.Context, *QueryGetAttestationsBySnapshotRequest) (*QueryGetAttestationsBySnapshotResponse, error) + // Queries the validator set index by timestamp GetValidatorSetIndexByTimestamp(context.Context, *QueryGetValidatorSetIndexByTimestampRequest) (*QueryGetValidatorSetIndexByTimestampResponse, error) + // Queries the current validator set timestamp GetCurrentValidatorSetTimestamp(context.Context, *QueryGetCurrentValidatorSetTimestampRequest) (*QueryGetCurrentValidatorSetTimestampResponse, error) } diff --git a/x/dispute/abci.go b/x/dispute/abci.go index 9b34bdaa6..802bef561 100644 --- a/x/dispute/abci.go +++ b/x/dispute/abci.go @@ -10,10 +10,16 @@ import ( ) func BeginBlocker(ctx context.Context, k keeper.Keeper) error { - return CheckPrevoteDisputesForExpiration(ctx, k) + err := CheckOpenDisputesForExpiration(ctx, k) + if err != nil { + return err + } + return CheckClosedDisputesForExecution(ctx, k) } -func CheckPrevoteDisputesForExpiration(ctx context.Context, k keeper.Keeper) error { +// Checks for expired prevote disputes and sets them to failed if expired. +// Also checks whether any open disputes' vote periods have ended and tallies the vote if so. +func CheckOpenDisputesForExpiration(ctx context.Context, k keeper.Keeper) error { iter, err := k.Disputes.Indexes.OpenDisputes.MatchExact(ctx, true) if err != nil { return err @@ -34,6 +40,41 @@ func CheckPrevoteDisputesForExpiration(ctx context.Context, k keeper.Keeper) err if err := k.Disputes.Set(ctx, key, dispute); err != nil { return err } + } else if dispute.DisputeStatus == types.Voting { + // try to tally the vote + vote, err := k.Votes.Get(ctx, key) + if err != nil { + return err + } + if sdk.UnwrapSDKContext(ctx).BlockTime().After(vote.VoteEnd) && vote.VoteResult == types.VoteResult_NO_TALLY { + if err := k.TallyVote(ctx, key); err != nil { + return err + } + } + } + } + return nil +} + +func CheckClosedDisputesForExecution(ctx context.Context, k keeper.Keeper) error { + iter, err := k.Disputes.Indexes.PendingExecution.MatchExact(ctx, true) + if err != nil { + return err + } + defer iter.Close() + for ; iter.Valid(); iter.Next() { + key, err := iter.PrimaryKey() + if err != nil { + return err + } + dispute, err := k.Disputes.Get(ctx, key) + if err != nil { + return err + } + if sdk.UnwrapSDKContext(ctx).BlockTime().After(dispute.DisputeEndTime) { + if err := k.ExecuteVote(ctx, key); err != nil { + return err + } } } return nil diff --git a/x/dispute/abci_test.go b/x/dispute/abci_test.go index b4c62aaf6..1fcd8630f 100644 --- a/x/dispute/abci_test.go +++ b/x/dispute/abci_test.go @@ -59,7 +59,7 @@ func (s *TestSuite) TestCheckPrevoteDisputesForExpiration() { ctx = ctx.WithBlockTime(ctx.BlockTime().Add(24 * time.Hour)) // check with no open disputes - err := dispute.CheckPrevoteDisputesForExpiration(ctx, k) + err := dispute.CheckOpenDisputesForExpiration(ctx, k) require.NoError(err) // check with open dispute @@ -71,12 +71,12 @@ func (s *TestSuite) TestCheckPrevoteDisputesForExpiration() { Open: true, })) - err = dispute.CheckPrevoteDisputesForExpiration(ctx, k) + err = dispute.CheckOpenDisputesForExpiration(ctx, k) require.NoError(err) // check again after endtime passes ctx = ctx.WithBlockTime(ctx.BlockTime().Add(2 * time.Hour)) - err = dispute.CheckPrevoteDisputesForExpiration(ctx, k) + err = dispute.CheckOpenDisputesForExpiration(ctx, k) require.NoError(err) dispute, err := k.Disputes.Get(ctx, 1) require.NoError(err) diff --git a/x/dispute/autocli.go b/x/dispute/autocli.go index ef028a9cf..535f96fb4 100644 --- a/x/dispute/autocli.go +++ b/x/dispute/autocli.go @@ -41,18 +41,6 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Short: "Execute the Vote RPC method", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}, {ProtoField: "vote"}}, }, - { - RpcMethod: "TallyVote", - Use: "tally-vote [dispute-id]", - Short: "Execute the TallyVote RPC method", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "dispute_id"}}, - }, - { - RpcMethod: "ExecuteDispute", - Use: "execute-dispute [dispute-id]", - Short: "Execute the ExecuteDispute RPC method", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "dispute_id"}}, - }, { RpcMethod: "WithdrawFeeRefund", Use: "withdraw-fee-refund [payer-address] [id]", @@ -63,6 +51,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "UpdateTeam", Skip: true, // skipped because team gated }, + { + RpcMethod: "ClaimReward", + Use: "claim-reward [dispute_id]", + Short: "Execute the ClaimReward RPC method", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "dispute_id"}}, + }, }, }, } diff --git a/x/dispute/genesis.go b/x/dispute/genesis.go index 4c25ce452..32c7c336a 100644 --- a/x/dispute/genesis.go +++ b/x/dispute/genesis.go @@ -16,7 +16,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) if err != nil { panic(err) } - err = k.Dust.Set(ctx, math.LegacyZeroDec()) + err = k.Dust.Set(ctx, math.ZeroInt()) if err != nil { panic(err) } diff --git a/x/dispute/keeper/claim_reward.go b/x/dispute/keeper/claim_reward.go new file mode 100644 index 000000000..5af8604bc --- /dev/null +++ b/x/dispute/keeper/claim_reward.go @@ -0,0 +1,133 @@ +package keeper + +import ( + "errors" + + layer "github.com/tellor-io/layer/types" + "github.com/tellor-io/layer/x/dispute/types" + + "cosmossdk.io/collections" + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// Pay fee from account +func (k Keeper) ClaimReward(ctx sdk.Context, addr sdk.AccAddress, id uint64) error { + // check if dispute exists + dispute, err := k.Disputes.Get(ctx, id) + if err != nil { + return err + } + + if dispute.DisputeStatus != types.Resolved { + return errors.New("can't execute, dispute not resolved") + } + + // check if caller already claimed + voterInfo, err := k.Voter.Get(ctx, collections.Join(id, addr.Bytes())) + if err != nil { + if !errors.Is(err, collections.ErrNotFound) { + return err + } + // not found, so must not have been claimed + } else { + if voterInfo.RewardClaimed { + return errors.New("reward already claimed") + } + } + + reward, err := k.CalculateReward(ctx, addr, id) + if err != nil { + return err + } + if reward.IsZero() { + return errors.New("reward is zero") + } + + voterInfo.RewardClaimed = true + if err := k.Voter.Set(ctx, collections.Join(id, addr.Bytes()), voterInfo); err != nil { + return err + } + + // send reward from this module to the address + if err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, addr, sdk.NewCoins(sdk.NewCoin(layer.BondDenom, reward))); err != nil { + return err + } + + return nil +} + +func (k Keeper) CalculateReward(ctx sdk.Context, addr sdk.AccAddress, id uint64) (math.Int, error) { + dispute, err := k.Disputes.Get(ctx, id) + if err != nil { + return math.Int{}, err + } + disputeVote, err := k.Votes.Get(ctx, id) + if err != nil { + return math.Int{}, err + } + if !disputeVote.Executed { + return math.Int{}, errors.New("vote not executed") + } + + addrReporterPower := math.ZeroInt() + addrTokenholderPower := math.ZeroInt() + addrUserPower := math.ZeroInt() + + globalReporterPower := math.ZeroInt() + globalUserPower := math.ZeroInt() + globalTokenholderPower := math.ZeroInt() + + for _, pastId := range dispute.PrevDisputeIds { + pastVoterInfo, err := k.Voter.Get(ctx, collections.Join(pastId, addr.Bytes())) + if err == nil { + // Voter info exists for this past dispute + addrReporterPower = addrReporterPower.Add(pastVoterInfo.ReporterPower) + addrTokenholderPower = addrTokenholderPower.Add(pastVoterInfo.TokenholderPower) + userTips, err := k.GetUserTotalTips(ctx, addr, pastId) + if err != nil { + return math.Int{}, err + } + addrUserPower = addrUserPower.Add(userTips) + } + + // Get global vote counts for the past dispute + pastVoteCounts, err := k.VoteCountsByGroup.Get(ctx, pastId) + if err != nil { + return math.Int{}, err + } + globalReporterPower = globalReporterPower.Add(math.NewIntFromUint64(pastVoteCounts.Reporters.Support)). + Add(math.NewIntFromUint64(pastVoteCounts.Reporters.Against)).Add(math.NewIntFromUint64(pastVoteCounts.Reporters.Invalid)) + globalUserPower = globalUserPower.Add(math.NewIntFromUint64(pastVoteCounts.Users.Support)). + Add(math.NewIntFromUint64(pastVoteCounts.Users.Against)).Add(math.NewIntFromUint64(pastVoteCounts.Users.Invalid)) + globalTokenholderPower = globalTokenholderPower.Add(math.NewIntFromUint64(pastVoteCounts.Tokenholders.Support)). + Add(math.NewIntFromUint64(pastVoteCounts.Tokenholders.Against)).Add(math.NewIntFromUint64(pastVoteCounts.Tokenholders.Invalid)) + } + + totalGroups := int64(3) + if globalReporterPower.IsZero() { + globalReporterPower = math.NewInt(1) + totalGroups-- + } + if globalUserPower.IsZero() { + globalUserPower = math.NewInt(1) + totalGroups-- + } + if globalTokenholderPower.IsZero() { + globalTokenholderPower = math.NewInt(1) + totalGroups-- + } + if totalGroups == 0 { + return math.Int{}, errors.New("no votes found") + } + + // normalize powers + userPower := addrUserPower.Mul(layer.PowerReduction).Quo(globalUserPower) + reporterPower := addrReporterPower.Mul(layer.PowerReduction).Quo(globalReporterPower) + tokenholderPower := addrTokenholderPower.Mul(layer.PowerReduction).Quo(globalTokenholderPower) + totalAccPower := userPower.Add(reporterPower).Add(tokenholderPower) + rewardAcc := totalAccPower.Mul(dispute.VoterReward).Quo(math.NewInt(totalGroups).Mul(layer.PowerReduction)) + + return rewardAcc, nil +} diff --git a/x/dispute/keeper/dispute.go b/x/dispute/keeper/dispute.go index 55917539f..16d536363 100644 --- a/x/dispute/keeper/dispute.go +++ b/x/dispute/keeper/dispute.go @@ -154,13 +154,13 @@ func (k Keeper) SlashAndJailReporter(ctx sdk.Context, report oracletypes.MicroRe } reporterAddr := sdk.MustAccAddressFromBech32(report.Reporter) - slashFactor, jailDuration, err := GetSlashPercentageAndJailDuration(category) + slashPercentageFixed6, jailDuration, err := GetSlashPercentageAndJailDuration(category) if err != nil { return err } - amount := math.NewInt(int64(report.Power)).Mul(layertypes.PowerReduction) - slashAmount := math.LegacyNewDecFromInt(amount).Mul(slashFactor) - err = k.reporterKeeper.EscrowReporterStake(ctx, reporterAddr, report.Power, report.BlockNumber, slashAmount.TruncateInt(), hashId) + reportPowerFixed6 := math.NewInt(int64(report.Power)).Mul(layertypes.PowerReduction) + slashAmountFixed6 := reportPowerFixed6.Mul(slashPercentageFixed6).Quo(layertypes.PowerReduction) + err = k.reporterKeeper.EscrowReporterStake(ctx, reporterAddr, report.Power, report.BlockNumber, slashAmountFixed6, hashId) if err != nil { return err } @@ -175,17 +175,17 @@ func (k Keeper) JailReporter(ctx context.Context, repAddr sdk.AccAddress, jailDu return k.reporterKeeper.JailReporter(ctx, repAddr, jailDuration) } -// Get percentage of slash amount based on category -func GetSlashPercentageAndJailDuration(category types.DisputeCategory) (math.LegacyDec, uint64, error) { +// Get percentage of slash amount based on category, returned as fixed6 +func GetSlashPercentageAndJailDuration(category types.DisputeCategory) (math.Int, uint64, error) { switch category { case types.Warning: - return math.LegacyNewDecWithPrec(1, 2), 0, nil // 1% + return math.NewInt(layertypes.PowerReduction.Int64()).QuoRaw(100), 0, nil // 1% case types.Minor: - return math.LegacyNewDecWithPrec(5, 2), 600, nil // 5% + return math.NewInt(layertypes.PowerReduction.Int64()).QuoRaw(20), 600, nil // 5% case types.Major: - return math.LegacyNewDecWithPrec(1, 0), gomath.MaxInt64, nil // 100% + return layertypes.PowerReduction, gomath.MaxInt64, nil // 100% default: - return math.LegacyDec{}, 0, types.ErrInvalidDisputeCategory + return math.Int{}, 0, types.ErrInvalidDisputeCategory } } @@ -272,6 +272,7 @@ func (k Keeper) AddDisputeRound(ctx sdk.Context, sender sdk.AccAddress, dispute return k.SetStartVote(ctx, dispute.DisputeId) // starting voting immediately } +// creates a snapshot of total reporter power and total tips func (k Keeper) SetBlockInfo(ctx context.Context, hashId []byte) error { tp, err := k.reporterKeeper.TotalReporterPower(ctx) if err != nil { @@ -296,9 +297,11 @@ func (k Keeper) CloseDispute(ctx context.Context, id uint64) error { return err } dispute.Open = false + dispute.PendingExecution = false return k.Disputes.Set(ctx, id, dispute) } +// gets all open disputes func (k Keeper) GetOpenDisputes(ctx context.Context) ([]uint64, error) { iter, err := k.Disputes.Indexes.OpenDisputes.MatchExact(ctx, true) if err != nil { diff --git a/x/dispute/keeper/dispute_test.go b/x/dispute/keeper/dispute_test.go index a07a5c560..eaf81f9e8 100644 --- a/x/dispute/keeper/dispute_test.go +++ b/x/dispute/keeper/dispute_test.go @@ -37,6 +37,7 @@ func (s *KeeperTestSuite) dispute() types.Dispute { InitialEvidence: report, Open: true, SlashAmount: math.NewInt(10000), + BurnAmount: math.NewInt(500), } } @@ -162,25 +163,25 @@ func (s *KeeperTestSuite) TestGetSlashPercentageAndJailDuration() { testCases := []struct { name string cat types.DisputeCategory - expectedSlashPercentage float64 + expectedSlashPercentage math.Int expectedJailTime uint64 }{ { name: "Warning", cat: types.Warning, - expectedSlashPercentage: 0.01, + expectedSlashPercentage: math.NewInt(10000), expectedJailTime: 0, }, { name: "Minor", cat: types.Minor, - expectedSlashPercentage: 0.05, + expectedSlashPercentage: math.NewInt(50000), expectedJailTime: 600, }, { name: "Major", cat: types.Major, - expectedSlashPercentage: 1, + expectedSlashPercentage: math.NewInt(1000000), expectedJailTime: gomath.MaxInt64, }, { @@ -198,7 +199,7 @@ func (s *KeeperTestSuite) TestGetSlashPercentageAndJailDuration() { s.Error(err, types.ErrInvalidDisputeCategory) } else { s.NoError(err) - s.Equal(tc.expectedSlashPercentage, slashAmount.MustFloat64()) + s.Equal(tc.expectedSlashPercentage, slashAmount) s.Equal(tc.expectedJailTime, jailTime) } }) diff --git a/x/dispute/keeper/execute.go b/x/dispute/keeper/execute.go index 29d182a75..4815ab3c6 100644 --- a/x/dispute/keeper/execute.go +++ b/x/dispute/keeper/execute.go @@ -5,13 +5,12 @@ import ( "errors" "strconv" - layer "github.com/tellor-io/layer/types" + layertypes "github.com/tellor-io/layer/types" "github.com/tellor-io/layer/x/dispute/types" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -47,39 +46,16 @@ func (k Keeper) ExecuteVote(ctx context.Context, id uint64) error { if vote.Executed { return errors.New("vote already executed") } - - var voters []VoterInfo - totalVoterPower := math.ZeroInt() - for _, id := range dispute.PrevDisputeIds { - iter, err := k.Voter.Indexes.VotersById.MatchExact(ctx, id) - if err != nil { - return err - } - - defer iter.Close() - for ; iter.Valid(); iter.Next() { - voterKey, err := iter.PrimaryKey() - if err != nil { - return err - } - v, err := k.Voter.Get(ctx, voterKey) - if err != nil { - return err - } - voters = append(voters, VoterInfo{ - Voter: voterKey.K2(), - Power: v.VoterPower, - Share: math.ZeroInt(), // initialize, share is calculated later - }) - totalVoterPower = totalVoterPower.Add(v.VoterPower) - } - } // amount of dispute fee to return to fee payers or give to reporter disputeFeeMinusBurn := dispute.SlashAmount.Sub(dispute.BurnAmount) // the burnAmount starts at %5 of disputeFee, half of which is burned and the other half is distributed to the voters halfBurnAmount := dispute.BurnAmount.QuoRaw(2) voterReward := halfBurnAmount - if len(voters) == 0 { + totalVoterPower, err := k.GetSumOfAllGroupVotesAllRounds(ctx, id) + if err != nil { + return err + } + if totalVoterPower.IsZero() { // if no voters, burn the entire burnAmount halfBurnAmount = dispute.BurnAmount // non voters get nothing @@ -87,14 +63,11 @@ func (k Keeper) ExecuteVote(ctx context.Context, id uint64) error { } switch vote.VoteResult { case types.VoteResult_INVALID, types.VoteResult_NO_QUORUM_MAJORITY_INVALID: - // distribute the voterRewardunt equally among the voters and transfer it to their accounts - burnRemainder, err := k.RewardVoters(ctx, voters, voterReward, totalVoterPower) - if err != nil { - return err - } // burn half the burnAmount - if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(layer.BondDenom, halfBurnAmount.Add(burnRemainder)))); err != nil { - return err + if !halfBurnAmount.IsZero() { + if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(layertypes.BondDenom, halfBurnAmount))); err != nil { + return err + } } // stake the slashed tokens back into the bonded pool for the reporter if err := k.ReturnSlashedTokens(ctx, dispute); err != nil { @@ -105,14 +78,9 @@ func (k Keeper) ExecuteVote(ctx context.Context, id uint64) error { return err } case types.VoteResult_SUPPORT, types.VoteResult_NO_QUORUM_MAJORITY_SUPPORT: - burnRemainder, err := k.RewardVoters(ctx, voters, voterReward, totalVoterPower) - if err != nil { - return err - } // burn half the burnAmount - toBurn := halfBurnAmount.Add(burnRemainder) - if !toBurn.IsZero() { - if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(layer.BondDenom, toBurn))); err != nil { + if !halfBurnAmount.IsZero() { + if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(layertypes.BondDenom, halfBurnAmount))); err != nil { return err } } @@ -122,13 +90,11 @@ func (k Keeper) ExecuteVote(ctx context.Context, id uint64) error { return err } case types.VoteResult_AGAINST, types.VoteResult_NO_QUORUM_MAJORITY_AGAINST: - burnRemainder, err := k.RewardVoters(ctx, voters, voterReward, totalVoterPower) - if err != nil { - return err - } // burn half the burnAmount - if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(layer.BondDenom, halfBurnAmount.Add(burnRemainder)))); err != nil { - return err + if !halfBurnAmount.IsZero() { + if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(layertypes.BondDenom, halfBurnAmount))); err != nil { + return err + } } // refund the reporters bond to the reporter plus the remaining disputeFee; goes to bonded pool dispute.SlashAmount = dispute.SlashAmount.Add(disputeFeeMinusBurn) @@ -142,6 +108,11 @@ func (k Keeper) ExecuteVote(ctx context.Context, id uint64) error { case types.VoteResult_NO_TALLY: return errors.New("vote hasn't been tallied yet") } + dispute.VoterReward = voterReward + dispute.PendingExecution = false + if err := k.Disputes.Set(ctx, id, dispute); err != nil { + return err + } sdk.UnwrapSDKContext(ctx).EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( "dispute_executed", @@ -152,70 +123,82 @@ func (k Keeper) ExecuteVote(ctx context.Context, id uint64) error { return k.BlockInfo.Remove(ctx, dispute.HashId) } -func (k Keeper) RefundDisputeFee(ctx context.Context, feePayer sdk.AccAddress, payerInfo types.PayerInfo, totalFeesPaid, feeMinusBurn math.Int, hashId []byte) (math.LegacyDec, error) { - fee := math.LegacyNewDecFromInt(payerInfo.Amount) - totalFees := math.LegacyNewDecFromInt(totalFeesPaid) - feeMinusBurnDec := math.LegacyNewDecFromInt(feeMinusBurn) - amt := fee.Quo(totalFees).Mul(feeMinusBurnDec) +func (k Keeper) RefundDisputeFee(ctx context.Context, feePayer sdk.AccAddress, payerInfo types.PayerInfo, totalFeesPaid, feeMinusBurn math.Int, hashId []byte) (math.Int, error) { + fee := payerInfo.Amount + totalFees := totalFeesPaid + feeMinusBurnDec := feeMinusBurn + amtFixed12 := fee.Mul(feeMinusBurnDec).Mul(layertypes.PowerReduction).Quo(totalFees) - remainder := amt.Sub(amt.TruncateDec()) + remainder := amtFixed12.Mod(layertypes.PowerReduction) - coins := sdk.NewCoins(sdk.NewCoin(layer.BondDenom, amt.TruncateInt())) + amtFixed6 := amtFixed12.Quo(layertypes.PowerReduction) + coins := sdk.NewCoins(sdk.NewCoin(layertypes.BondDenom, amtFixed6)) if !payerInfo.FromBond { return remainder, k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, feePayer, coins) } - return remainder, k.ReturnFeetoStake(ctx, hashId, amt.TruncateInt()) + return remainder, k.ReturnFeetoStake(ctx, hashId, amtFixed6) } -func (k Keeper) RewardReporterBondToFeePayers(ctx context.Context, feePayer sdk.AccAddress, payerInfo types.PayerInfo, totalFeesPaid, reporterBond math.Int) (math.LegacyDec, error) { - bond := math.LegacyNewDecFromInt(reporterBond) - totalFees := math.LegacyNewDecFromInt(totalFeesPaid) +func (k Keeper) RewardReporterBondToFeePayers(ctx context.Context, feePayer sdk.AccAddress, payerInfo types.PayerInfo, totalFeesPaid, reporterBond math.Int) (math.Int, error) { + bond := reporterBond + totalFees := totalFeesPaid - fee := math.LegacyNewDecFromInt(payerInfo.Amount) - amt := fee.Quo(totalFees).Mul(bond) + fee := payerInfo.Amount + amtFixed12 := fee.Mul(bond).Mul(layertypes.PowerReduction).Quo(totalFees) - if err := k.reporterKeeper.AddAmountToStake(ctx, feePayer, amt.TruncateInt()); err != nil { - return math.LegacyDec{}, err + amtFixed6 := amtFixed12.Quo(layertypes.PowerReduction) + if err := k.reporterKeeper.AddAmountToStake(ctx, feePayer, amtFixed6); err != nil { + return math.Int{}, err } - remainder := amt.Sub(amt.TruncateDec()) - return remainder, k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, stakingtypes.BondedPoolName, sdk.NewCoins(sdk.NewCoin(layer.BondDenom, amt.TruncateInt()))) + remainder := amtFixed12.Mod(layertypes.PowerReduction) + return remainder, k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, stakingtypes.BondedPoolName, sdk.NewCoins(sdk.NewCoin(layertypes.BondDenom, amtFixed6))) } -func (k Keeper) RewardVoters(ctx context.Context, voters []VoterInfo, totalAmount, totalVoterPower math.Int) (math.Int, error) { - if totalAmount.IsZero() { - return totalAmount, nil +func (k Keeper) GetSumOfAllGroupVotesAllRounds(ctx context.Context, id uint64) (math.Int, error) { + dispute, err := k.Disputes.Get(ctx, id) + if err != nil { + return math.Int{}, err } - tokenDistribution, burnedRemainder := k.CalculateVoterShare(ctx, voters, totalAmount, totalVoterPower) - totalAmount = totalAmount.Sub(burnedRemainder) - var outputs []banktypes.Output - for _, v := range tokenDistribution { - if v.Share.IsZero() { - continue - } - reward := sdk.NewCoins(sdk.NewCoin(layer.BondDenom, v.Share)) - outputs = append(outputs, banktypes.NewOutput(v.Voter, reward)) + + sumUsers := uint64(0) + sumReporters := uint64(0) + sumTokenholders := uint64(0) + sumTeam := uint64(0) + + // process vote counts function + processVoteCounts := func(voteCounts types.StakeholderVoteCounts) { + sumUsers += voteCounts.Users.Support + voteCounts.Users.Against + voteCounts.Users.Invalid + sumReporters += voteCounts.Reporters.Support + voteCounts.Reporters.Against + voteCounts.Reporters.Invalid + sumTokenholders += voteCounts.Tokenholders.Support + voteCounts.Tokenholders.Against + voteCounts.Tokenholders.Invalid + sumTeam += voteCounts.Team.Support + voteCounts.Team.Against + voteCounts.Team.Invalid } - moduleAddress := k.accountKeeper.GetModuleAddress(types.ModuleName) - inputs := banktypes.NewInput(moduleAddress, sdk.NewCoins(sdk.NewCoin(layer.BondDenom, totalAmount))) - return burnedRemainder, k.bankKeeper.InputOutputCoins(ctx, inputs, outputs) -} -func (k Keeper) CalculateVoterShare( - ctx context.Context, voters []VoterInfo, totalTokens math.Int, - totalPower math.Int, -) ([]VoterInfo, math.Int) { - scalingFactor := layer.PowerReduction - totalShare := math.ZeroInt() - for i, v := range voters { - share := v.Power.Mul(scalingFactor).Quo(totalPower) - tokens := share.Mul(totalTokens).Quo(scalingFactor) - voters[i].Share = tokens - totalShare = totalShare.Add(tokens) + // process current dispute + voteCounts, err := k.VoteCountsByGroup.Get(ctx, id) + if err != nil { + return math.ZeroInt(), nil } - burnedRemainder := math.ZeroInt() - if totalTokens.GT(totalShare) { - burnedRemainder = totalTokens.Sub(totalShare) + processVoteCounts(voteCounts) + + // process previous disputes + for _, roundId := range dispute.PrevDisputeIds { + voteCounts, err := k.VoteCountsByGroup.Get(ctx, roundId) + if err != nil { + voteCounts = types.StakeholderVoteCounts{ + Users: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Team: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + } + } + processVoteCounts(voteCounts) } - return voters, burnedRemainder + + totalSum := math.NewInt(int64(sumUsers)). + Add(math.NewInt(int64(sumReporters))). + Add(math.NewInt(int64(sumTokenholders))). + Add(math.NewInt(int64(sumTeam))) + + return totalSum, nil } diff --git a/x/dispute/keeper/execute_test.go b/x/dispute/keeper/execute_test.go index d2ee7e3f5..f119127b2 100644 --- a/x/dispute/keeper/execute_test.go +++ b/x/dispute/keeper/execute_test.go @@ -2,15 +2,13 @@ package keeper_test import ( "github.com/tellor-io/layer/testutil/sample" - "github.com/tellor-io/layer/x/dispute/keeper" + layertypes "github.com/tellor-io/layer/types" "github.com/tellor-io/layer/x/dispute/types" "cosmossdk.io/collections" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) func (k *KeeperTestSuite) TestExecuteVote() { @@ -30,39 +28,52 @@ func (k *KeeperTestSuite) TestExecuteVote() { VoteResult: types.VoteResult_NO_TALLY, Executed: true, } + voteCounts := types.StakeholderVoteCounts{ + Users: types.VoteCounts{Support: 1, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 1, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 1, Against: 0, Invalid: 0}, + Team: types.VoteCounts{Support: 1, Against: 0, Invalid: 0}, + } + k.NoError(k.disputeKeeper.VoteCountsByGroup.Set(k.ctx, dispute.DisputeId, voteCounts)) + // vote and dispute set, dispute status not resolved k.NoError(k.disputeKeeper.Votes.Set(k.ctx, dispute.DisputeId, vote)) k.NoError(k.disputeKeeper.Disputes.Set(k.ctx, dispute.DisputeId, dispute)) - k.Error(k.disputeKeeper.ExecuteVote(k.ctx, dispute.DisputeId), "can't execute, dispute not resolved") + // dispute time ended but vote result not dispute.DisputeEndTime = k.ctx.BlockTime() k.NoError(k.disputeKeeper.Disputes.Set(k.ctx, dispute.DisputeId, dispute)) k.Error(k.disputeKeeper.ExecuteVote(k.ctx, dispute.DisputeId), "can't execute, dispute not resolved") + // vote aleady executed vote.VoteResult = types.VoteResult_SUPPORT k.NoError(k.disputeKeeper.Votes.Set(k.ctx, dispute.DisputeId, vote)) k.Error(k.disputeKeeper.ExecuteVote(k.ctx, dispute.DisputeId), "vote already executed") + // actually execute vote vote.Executed = false k.NoError(k.disputeKeeper.Votes.Set(k.ctx, dispute.DisputeId, vote)) - k.ctx = k.ctx.WithBlockTime(k.ctx.BlockTime().Add(1)) + k.bankKeeper.On("BurnCoins", k.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("loya", dispute.BurnAmount.QuoRaw(2)))).Return(nil) k.NoError(k.disputeKeeper.ExecuteVote(k.ctx, dispute.DisputeId)) + // withdraw fee refund for feepayer1 k.NoError(k.disputeKeeper.DisputeFeePayer.Set(k.ctx, collections.Join(dispute.DisputeId, feepayer1.Bytes()), feePayers[0])) k.NoError(k.disputeKeeper.DisputeFeePayer.Set(k.ctx, collections.Join(dispute.DisputeId, feepayer2.Bytes()), feePayers[1])) msg := &types.MsgWithdrawFeeRefund{CallerAddress: sample.AccAddressBytes().String(), Id: dispute.DisputeId, PayerAddress: feepayer1.String()} - k.reporterKeeper.On("FeeRefund", k.ctx, dispute.HashId, math.NewInt(8000)).Return(nil) - k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(8000)))).Return(nil) - k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer1, math.NewInt(8000)).Return(nil) + k.reporterKeeper.On("FeeRefund", k.ctx, dispute.HashId, math.NewInt(7600)).Return(nil).Once() + k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(7600)))).Return(nil).Once() + k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer1, math.NewInt(8000)).Return(nil).Once() + k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(8000)))).Return(nil).Once() _, err := k.msgServer.WithdrawFeeRefund(k.ctx, msg) k.NoError(err) + // wqithdraw fee refund for feepayer2 msg = &types.MsgWithdrawFeeRefund{CallerAddress: sample.AccAddressBytes().String(), Id: dispute.DisputeId, PayerAddress: feepayer2.String()} - k.bankKeeper.On("SendCoinsFromModuleToAccount", k.ctx, types.ModuleName, feepayer2, sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(2000)))).Return(nil) - k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer2, math.NewInt(2000)).Return(nil) - k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(2000)))).Return(nil) + k.bankKeeper.On("SendCoinsFromModuleToAccount", k.ctx, types.ModuleName, feepayer2, sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(1900)))).Return(nil).Once() + k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer2, math.NewInt(2000)).Return(nil).Once() + k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(2000)))).Return(nil).Once() _, err = k.msgServer.WithdrawFeeRefund(k.ctx, msg) k.NoError(err) } @@ -80,12 +91,12 @@ func (k *KeeperTestSuite) TestRefundDisputeFee() { k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(760)))).Return(nil) dust, err := k.disputeKeeper.RefundDisputeFee(k.ctx, feepayer1, feePayers[0], math.NewInt(1000), disputeFeeMinusBurn, []byte("hash")) k.NoError(err) - k.True(math.LegacyZeroDec().Equal(dust)) + k.True(math.ZeroInt().Equal(dust)) k.bankKeeper.On("SendCoinsFromModuleToAccount", k.ctx, types.ModuleName, feepayer2, sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(190)))).Return(nil) dust, err = k.disputeKeeper.RefundDisputeFee(k.ctx, feepayer2, feePayers[1], math.NewInt(1000), disputeFeeMinusBurn, []byte("hash")) k.NoError(err) - k.True(math.LegacyZeroDec().Equal(dust)) + k.True(math.ZeroInt().Equal(dust)) } func (k *KeeperTestSuite) TestRewardReporterBondToFeePayers() { @@ -101,12 +112,12 @@ func (k *KeeperTestSuite) TestRewardReporterBondToFeePayers() { k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(800)))).Return(nil) dust, err := k.disputeKeeper.RewardReporterBondToFeePayers(k.ctx, feepayer1, feePayers[0], reporterBond, reporterBond) k.NoError(err) - k.True(math.LegacyZeroDec().Equal(dust)) + k.True(math.ZeroInt().Equal(dust)) k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer2, math.NewInt(200)).Return(nil) k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(200)))).Return(nil) dust, err = k.disputeKeeper.RewardReporterBondToFeePayers(k.ctx, feepayer2, feePayers[1], reporterBond, reporterBond) k.NoError(err) - k.True(math.LegacyZeroDec().Equal(dust)) + k.True(math.ZeroInt().Equal(dust)) feePayers = []types.PayerInfo{ {Amount: math.NewInt(8), FromBond: true}, @@ -114,77 +125,90 @@ func (k *KeeperTestSuite) TestRewardReporterBondToFeePayers() { {Amount: math.NewInt(3), FromBond: true}, } totalFeesPaid := math.NewInt(13) - share := feePayers[0].Amount.ToLegacyDec().Quo(totalFeesPaid.ToLegacyDec()).Mul(reporterBond.ToLegacyDec()) - k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer1, share.TruncateInt()).Return(nil) - k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(615)))).Return(nil) + + shareFixed12 := feePayers[0].Amount.Mul(reporterBond).Mul(layertypes.PowerReduction).Quo(totalFeesPaid) + shareFixed6 := shareFixed12.Quo(layertypes.PowerReduction) + k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer1, shareFixed6).Return(nil) + k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", shareFixed6))).Return(nil) dust, err = k.disputeKeeper.RewardReporterBondToFeePayers(k.ctx, feepayer1, feePayers[0], totalFeesPaid, reporterBond) k.NoError(err) - k.Equal(share.Sub(share.TruncateDec()), dust) - share = feePayers[1].Amount.ToLegacyDec().Quo(totalFeesPaid.ToLegacyDec()).Mul(reporterBond.ToLegacyDec()) - k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer2, share.TruncateInt()).Return(nil) - k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(153)))).Return(nil) + k.Equal(shareFixed12.Mod(layertypes.PowerReduction), dust) + + shareFixed12 = feePayers[1].Amount.Mul(reporterBond).Mul(layertypes.PowerReduction).Quo(totalFeesPaid) + shareFixed6 = shareFixed12.Quo(layertypes.PowerReduction) + k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer2, shareFixed6).Return(nil) + k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", shareFixed6))).Return(nil) dust, err = k.disputeKeeper.RewardReporterBondToFeePayers(k.ctx, feepayer2, feePayers[1], totalFeesPaid, reporterBond) k.NoError(err) - k.Equal(share.Sub(share.TruncateDec()), dust) - share = feePayers[2].Amount.ToLegacyDec().Quo(totalFeesPaid.ToLegacyDec()).Mul(reporterBond.ToLegacyDec()) + k.Equal(shareFixed12.Mod(layertypes.PowerReduction), dust) - k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer3, share.TruncateInt()).Return(nil) - k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(230)))).Return(nil) + shareFixed12 = feePayers[2].Amount.Mul(reporterBond).Mul(layertypes.PowerReduction).Quo(totalFeesPaid) + shareFixed6 = shareFixed12.Quo(layertypes.PowerReduction) + k.reporterKeeper.On("AddAmountToStake", k.ctx, feepayer3, shareFixed6).Return(nil) + k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", shareFixed6))).Return(nil) dust, err = k.disputeKeeper.RewardReporterBondToFeePayers(k.ctx, feepayer3, feePayers[2], totalFeesPaid, reporterBond) k.NoError(err) - k.Equal(share.Sub(share.TruncateDec()), dust) + k.Equal(shareFixed12.Mod(layertypes.PowerReduction), dust) } -func (k *KeeperTestSuite) TestRewardVoters() { - remaining, err := k.disputeKeeper.RewardVoters(k.ctx, []keeper.VoterInfo{{Voter: sample.AccAddressBytes(), Power: math.OneInt(), Share: math.ZeroInt()}}, math.ZeroInt(), math.ZeroInt()) - k.NoError(err) - k.Equal(math.ZeroInt(), remaining) +func (k *KeeperTestSuite) TestGetSumOfAllGroupVotesAllRounds() { + dispute := k.dispute() + k.NoError(k.disputeKeeper.Disputes.Set(k.ctx, dispute.DisputeId, dispute)) - voters := []keeper.VoterInfo{ - {Voter: sample.AccAddressBytes(), Power: math.NewInt(1), Share: math.ZeroInt()}, - {Voter: sample.AccAddressBytes(), Power: math.NewInt(1), Share: math.ZeroInt()}, - {Voter: sample.AccAddressBytes(), Power: math.NewInt(1), Share: math.ZeroInt()}, + // set vote counts for current dispute + currentVoteCounts := types.StakeholderVoteCounts{ + Users: types.VoteCounts{Support: 10, Against: 5, Invalid: 2}, // 17 + Reporters: types.VoteCounts{Support: 8, Against: 3, Invalid: 1}, // 12 + Tokenholders: types.VoteCounts{Support: 15, Against: 7, Invalid: 3}, // 25 + Team: types.VoteCounts{Support: 5, Against: 2, Invalid: 1}, // 8 total=62 } - modulAddr := authtypes.NewModuleAddress(types.ModuleName) - k.accountKeeper.On("GetModuleAddress", types.ModuleName).Return(modulAddr, nil) - k.bankKeeper.On( - "InputOutputCoins", k.ctx, - banktypes.Input{Address: modulAddr.String(), Coins: sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(99)))}, - []banktypes.Output{ - {Address: voters[0].Voter.String(), Coins: sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(33)))}, - {Address: voters[1].Voter.String(), Coins: sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(33)))}, - {Address: voters[2].Voter.String(), Coins: sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(33)))}, - }).Return(nil, nil) - remaining, err = k.disputeKeeper.RewardVoters(k.ctx, voters, math.NewInt(100), math.NewInt(3)) - k.NoError(err) - k.Equal(math.OneInt(), remaining) -} + k.NoError(k.disputeKeeper.VoteCountsByGroup.Set(k.ctx, dispute.DisputeId, currentVoteCounts)) -func (k *KeeperTestSuite) TestCalculateVoterShare() { - totalPower := math.NewInt(3) - totalTokens := math.NewInt(100) - voters := []keeper.VoterInfo{ - {Voter: sample.AccAddressBytes(), Power: math.NewInt(1), Share: math.ZeroInt()}, - {Voter: sample.AccAddressBytes(), Power: math.NewInt(1), Share: math.ZeroInt()}, - {Voter: sample.AccAddressBytes(), Power: math.NewInt(1), Share: math.ZeroInt()}, + // test no previous disputes + expectedTotalSum := math.NewInt(62) + totalSum, err := k.disputeKeeper.GetSumOfAllGroupVotesAllRounds(k.ctx, dispute.DisputeId) + k.NoError(err) + k.True(expectedTotalSum.Equal(totalSum)) + + // test with 3 previous dispute rounds + prevDisputeIds := []uint64{2, 3, 4} + prevVoteCounts := []types.StakeholderVoteCounts{ + { + Users: types.VoteCounts{Support: 5, Against: 3, Invalid: 1}, // 9 + Reporters: types.VoteCounts{Support: 4, Against: 2, Invalid: 0}, // 6 + Tokenholders: types.VoteCounts{Support: 8, Against: 4, Invalid: 2}, // 14 + Team: types.VoteCounts{Support: 3, Against: 1, Invalid: 0}, // 4 total=33 + }, + { + Users: types.VoteCounts{Support: 7, Against: 4, Invalid: 2}, // 13 + Reporters: types.VoteCounts{Support: 6, Against: 3, Invalid: 1}, // 10 + Tokenholders: types.VoteCounts{Support: 10, Against: 5, Invalid: 2}, // 17 + Team: types.VoteCounts{Support: 4, Against: 2, Invalid: 1}, // 7 total=47 + }, + { + Users: types.VoteCounts{Support: 3, Against: 2, Invalid: 0}, // 5 + Reporters: types.VoteCounts{Support: 2, Against: 1, Invalid: 0}, // 3 + Tokenholders: types.VoteCounts{Support: 5, Against: 3, Invalid: 1}, // 9 + Team: types.VoteCounts{Support: 2, Against: 1, Invalid: 0}, // 3 total=20 + }, } - voters, remainder := k.disputeKeeper.CalculateVoterShare(k.ctx, voters, totalTokens, totalPower) - k.Equal(math.OneInt(), remainder) - k.Equal(math.NewInt(33), voters[0].Share) - k.Equal(math.NewInt(33), voters[1].Share) - k.Equal(math.NewInt(33), voters[2].Share) - - totalPower = math.NewInt(5) - totalTokens = math.NewInt(190) - voters = []keeper.VoterInfo{ - {Voter: sample.AccAddressBytes(), Power: math.NewInt(3), Share: math.ZeroInt()}, - {Voter: sample.AccAddressBytes(), Power: math.NewInt(2), Share: math.ZeroInt()}, + + dispute.PrevDisputeIds = prevDisputeIds + for i, id := range prevDisputeIds { + k.NoError(k.disputeKeeper.VoteCountsByGroup.Set(k.ctx, id, prevVoteCounts[i])) } - voters, remainder = k.disputeKeeper.CalculateVoterShare(k.ctx, voters, totalTokens, totalPower) - // 3/5 = 0.6 * 190 = 114 - k.Equal(math.ZeroInt(), remainder) - k.Equal(math.NewInt(114), voters[0].Share) - // 2/5 = 0.4 * 190 = 76 - k.Equal(math.NewInt(76), voters[1].Share) + k.NoError(k.disputeKeeper.Disputes.Set(k.ctx, dispute.DisputeId, dispute)) + + // Calculate the expected total sum + expectedTotalSum = math.NewInt(0). + Add(math.NewInt(int64(17 + 12 + 25 + 8))). // Current dispute + Add(math.NewInt(int64(9 + 6 + 14 + 4))). // Previous dispute 1 + Add(math.NewInt(int64(13 + 10 + 17 + 7))). // Previous dispute 2 + Add(math.NewInt(int64(5 + 3 + 9 + 3))) // Previous dispute 3 + + // Call the function and check the result + totalSum, err = k.disputeKeeper.GetSumOfAllGroupVotesAllRounds(k.ctx, dispute.DisputeId) + k.NoError(err) + k.True(expectedTotalSum.Equal(totalSum)) } diff --git a/x/dispute/keeper/indexes.go b/x/dispute/keeper/indexes.go index d6221326f..9c2965980 100644 --- a/x/dispute/keeper/indexes.go +++ b/x/dispute/keeper/indexes.go @@ -12,10 +12,11 @@ import ( type DisputesIndex struct { DisputeByReporter *indexes.Multi[[]byte, uint64, types.Dispute] OpenDisputes *indexes.Multi[bool, uint64, types.Dispute] + PendingExecution *indexes.Multi[bool, uint64, types.Dispute] // New index for PendingExecution } func (a DisputesIndex) IndexesList() []collections.Index[uint64, types.Dispute] { - return []collections.Index[uint64, types.Dispute]{a.DisputeByReporter, a.OpenDisputes} + return []collections.Index[uint64, types.Dispute]{a.DisputeByReporter, a.OpenDisputes, a.PendingExecution} } func NewDisputesIndex(sb *collections.SchemaBuilder) DisputesIndex { @@ -35,6 +36,13 @@ func NewDisputesIndex(sb *collections.SchemaBuilder) DisputesIndex { return dispute.Open, nil }, ), + PendingExecution: indexes.NewMulti( + sb, types.PendingExecutionIndexPrefix, "pending_execution", + collections.BoolKey, collections.Uint64Key, + func(k uint64, dispute types.Dispute) (bool, error) { + return dispute.PendingExecution, nil + }, + ), } } diff --git a/x/dispute/keeper/keeper.go b/x/dispute/keeper/keeper.go index 45c45d2bd..86ea4f5c5 100644 --- a/x/dispute/keeper/keeper.go +++ b/x/dispute/keeper/keeper.go @@ -41,7 +41,9 @@ type ( ReportersWithDelegatorsVotedBefore collections.Map[collections.Pair[[]byte, uint64], math.Int] BlockInfo collections.Map[[]byte, types.BlockInfo] DisputeFeePayer collections.Map[collections.Pair[uint64, []byte], types.PayerInfo] - Dust collections.Item[math.LegacyDec] + // dust is extra tokens leftover after truncating decimals, stored as fixed256x12 + Dust collections.Item[math.Int] + VoteCountsByGroup collections.Map[uint64, types.StakeholderVoteCounts] } ) @@ -71,7 +73,8 @@ func NewKeeper( UsersGroup: collections.NewMap(sb, types.UsersGroupPrefix, "users_group", collections.PairKeyCodec(collections.Uint64Key, collections.BytesKey), sdk.IntValue), BlockInfo: collections.NewMap(sb, types.BlockInfoPrefix, "block_info", collections.BytesKey, codec.CollValue[types.BlockInfo](cdc)), DisputeFeePayer: collections.NewMap(sb, types.DisputeFeePayerPrefix, "dispute_fee_payer", collections.PairKeyCodec(collections.Uint64Key, collections.BytesKey), codec.CollValue[types.PayerInfo](cdc)), - Dust: collections.NewItem(sb, types.DustKeyPrefix, "dust", types.LegacyDecValue), + Dust: collections.NewItem(sb, types.DustKeyPrefix, "dust", sdk.IntValue), + VoteCountsByGroup: collections.NewMap(sb, types.VoteCountsByGroupPrefix, "vote_counts_by_group", collections.Uint64Key, codec.CollValue[types.StakeholderVoteCounts](cdc)), } } diff --git a/x/dispute/keeper/msg_execute_dispute.go b/x/dispute/keeper/msg_execute_dispute.go deleted file mode 100644 index 7ab3689f0..000000000 --- a/x/dispute/keeper/msg_execute_dispute.go +++ /dev/null @@ -1,16 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/tellor-io/layer/x/dispute/types" -) - -func (k msgServer) ExecuteDispute(ctx context.Context, msg *types.MsgExecuteDispute) (*types.MsgExecuteDisputeResponse, error) { - err := k.Keeper.ExecuteVote(ctx, msg.DisputeId) - if err != nil { - return nil, err - } - - return &types.MsgExecuteDisputeResponse{}, nil -} diff --git a/x/dispute/keeper/msg_execute_dispute_test.go b/x/dispute/keeper/msg_execute_dispute_test.go deleted file mode 100644 index 616899132..000000000 --- a/x/dispute/keeper/msg_execute_dispute_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package keeper_test - -import ( - "github.com/tellor-io/layer/testutil/sample" - "github.com/tellor-io/layer/x/dispute/types" - - "cosmossdk.io/collections" - "cosmossdk.io/math" - - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -func (k *KeeperTestSuite) TestExecuteDispute() { - msgCreator := sample.AccAddressBytes() - msg := types.MsgExecuteDispute{ - CallerAddress: msgCreator.String(), - DisputeId: 1, - } - - feePayer := sample.AccAddressBytes() - - dispute := k.dispute() - dispute.BurnAmount = math.NewInt(500) - dispute.PrevDisputeIds = []uint64{1} - k.NoError(k.disputeKeeper.Disputes.Set(k.ctx, 1, dispute)) - - vote := types.Vote{ - Id: 1, - } - - k.NoError(k.disputeKeeper.Votes.Set(k.ctx, 1, vote)) - resp, err := k.msgServer.ExecuteDispute(k.ctx, &msg) - k.Error(err, "can't execute, dispute not resolved") - k.Nil(resp) - - dispute.DisputeStatus = types.Resolved - k.NoError(k.disputeKeeper.Disputes.Set(k.ctx, 1, dispute)) - resp, err = k.msgServer.ExecuteDispute(k.ctx, &msg) - k.Error(err, "vote hasn't been tallied yet") - k.Nil(resp) - - voter := sample.AccAddressBytes() - - modulAddr := authtypes.NewModuleAddress(types.ModuleName) - k.bankKeeper.On("BurnCoins", k.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(250)))).Return(nil) - k.accountKeeper.On("GetModuleAddress", types.ModuleName).Return(modulAddr, nil) - k.bankKeeper.On("InputOutputCoins", k.ctx, banktypes.Input{Address: modulAddr.String(), Coins: sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(250)))}, []banktypes.Output{{Address: voter.String(), Coins: sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(250)))}}).Return(nil, nil) - k.bankKeeper.On("InputOutputCoins", k.ctx, banktypes.Input{Address: modulAddr.String(), Coins: sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(9500)))}, []banktypes.Output{{Address: feePayer.String(), Coins: sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(9500)))}}).Return(nil, nil) - k.reporterKeeper.On("AddAmountToStake", k.ctx, feePayer, math.NewInt(10000)).Return(nil) - k.bankKeeper.On("SendCoinsFromModuleToModule", k.ctx, types.ModuleName, "bonded_tokens_pool", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(10000)))).Return(nil) - - vote.VoteResult = types.VoteResult_SUPPORT - k.NoError(k.disputeKeeper.Votes.Set(k.ctx, 1, vote)) - - k.NoError(k.disputeKeeper.Voter.Set(k.ctx, collections.Join(uint64(1), voter.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.OneInt()})) - resp, err = k.msgServer.ExecuteDispute(k.ctx, &msg) - k.NoError(err) - k.NotNil(resp) -} diff --git a/x/dispute/keeper/msg_server.go b/x/dispute/keeper/msg_server.go index cc91a7dd8..aa764c635 100644 --- a/x/dispute/keeper/msg_server.go +++ b/x/dispute/keeper/msg_server.go @@ -1,15 +1,7 @@ package keeper import ( - "context" - "errors" - - layer "github.com/tellor-io/layer/types" "github.com/tellor-io/layer/x/dispute/types" - - "cosmossdk.io/collections" - - sdk "github.com/cosmos/cosmos-sdk/types" ) type msgServer struct { @@ -23,76 +15,3 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { } var _ types.MsgServer = msgServer{} - -func (k msgServer) WithdrawFeeRefund(ctx context.Context, msg *types.MsgWithdrawFeeRefund) (*types.MsgWithdrawFeeRefundResponse, error) { - // should be ok to be called by anyone - feePayer := sdk.MustAccAddressFromBech32(msg.PayerAddress) - // check if vote executed - vote, err := k.Votes.Get(ctx, msg.Id) - if err != nil { - return nil, err - } - if !vote.Executed { - return nil, errors.New("vote not executed") - } - - payerInfo, err := k.DisputeFeePayer.Get(ctx, collections.Join(msg.Id, feePayer.Bytes())) - if err != nil { - return nil, err - } - - // dispute - dispute, err := k.Disputes.Get(ctx, msg.Id) - if err != nil { - return nil, err - } - - feeMinusBurn := dispute.SlashAmount.Sub(dispute.BurnAmount) - remainder, err := k.Dust.Get(ctx) - if err != nil { - return nil, err - } - - switch vote.VoteResult { - case types.VoteResult_INVALID, types.VoteResult_NO_QUORUM_MAJORITY_INVALID: - fraction, err := k.RefundDisputeFee(ctx, feePayer, payerInfo, dispute.FeeTotal, feeMinusBurn, dispute.HashId) - if err != nil { - return nil, err - } - remainder = remainder.Add(fraction) - case types.VoteResult_SUPPORT, types.VoteResult_NO_QUORUM_MAJORITY_SUPPORT: - fraction, err := k.RefundDisputeFee(ctx, feePayer, payerInfo, dispute.FeeTotal, feeMinusBurn, dispute.HashId) - if err != nil { - return nil, err - } - - remainder = remainder.Add(fraction) - fraction, err = k.RewardReporterBondToFeePayers(ctx, feePayer, payerInfo, dispute.FeeTotal, dispute.SlashAmount) - if err != nil { - return nil, err - } - - remainder = remainder.Add(fraction) - - default: - return nil, errors.New("invalid vote result") - } - - burnDust := remainder.TruncateInt() - - if !burnDust.IsZero() { - if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(layer.BondDenom, burnDust))); err != nil { - return nil, err - } - remainder = remainder.Sub(remainder.TruncateDec()) - } - - if err := k.Dust.Set(ctx, remainder); err != nil { - return nil, err - } - - if err := k.DisputeFeePayer.Remove(ctx, collections.Join(msg.Id, feePayer.Bytes())); err != nil { - return nil, err - } - return nil, nil -} diff --git a/x/dispute/keeper/msg_server_claim_reward.go b/x/dispute/keeper/msg_server_claim_reward.go new file mode 100644 index 000000000..e88c1ed7d --- /dev/null +++ b/x/dispute/keeper/msg_server_claim_reward.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "context" + + "github.com/tellor-io/layer/x/dispute/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) ClaimReward(ctx context.Context, msg *types.MsgClaimReward) (*types.MsgClaimRewardResponse, error) { + callerAcc, err := sdk.AccAddressFromBech32(msg.CallerAddress) + if err != nil { + return nil, err + } + cosmosCtx := sdk.UnwrapSDKContext(ctx) + err = k.Keeper.ClaimReward(cosmosCtx, callerAcc, msg.DisputeId) + if err != nil { + return nil, err + } + + return &types.MsgClaimRewardResponse{}, nil +} diff --git a/x/dispute/keeper/msg_server_vote.go b/x/dispute/keeper/msg_server_vote.go index 46c47abdb..da3c86601 100644 --- a/x/dispute/keeper/msg_server_vote.go +++ b/x/dispute/keeper/msg_server_vote.go @@ -4,6 +4,7 @@ import ( "context" "errors" "strconv" + "strings" "github.com/tellor-io/layer/x/dispute/types" @@ -25,7 +26,6 @@ func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVo if dispute.DisputeStatus != types.Voting { return nil, types.ErrDisputeNotInVotingState } - vote, err := k.Keeper.Votes.Get(ctx, msg.Id) if err != nil { if errors.Is(err, collections.ErrNotFound) { @@ -33,7 +33,6 @@ func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVo } return nil, err } - voted, err := k.Voter.Has(ctx, collections.Join(msg.Id, voterAcc.Bytes())) if err != nil { return nil, err @@ -47,40 +46,44 @@ func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVo if vote.VoteEnd.Before(ctx.BlockTime()) { return nil, types.ErrVotingPeriodEnded } - bI, err := k.BlockInfo.Get(ctx, dispute.HashId) - if err != nil { - return nil, err - } - teampower, err := k.SetTeamVote(ctx, msg.Id, voterAcc) + teampower, err := k.SetTeamVote(ctx, msg.Id, voterAcc, msg.Vote) if err != nil { return nil, err } - upower, err := k.SetVoterTips(ctx, msg.Id, voterAcc, dispute.BlockNumber) + upower, err := k.SetVoterTips(ctx, msg.Id, voterAcc, dispute.BlockNumber, msg.Vote) if err != nil { return nil, err } - upower = CalculateVotingPower(upower, bI.TotalUserTips) - repP, err := k.SetVoterReporterStake(ctx, msg.Id, voterAcc, dispute.BlockNumber) + repP, err := k.SetVoterReporterStake(ctx, msg.Id, voterAcc, dispute.BlockNumber, msg.Vote) if err != nil { return nil, err } - repP = CalculateVotingPower(repP, bI.TotalReporterPower) - acctBal, err := k.GetAccountBalance(ctx, voterAcc) + acctBal, err := k.SetTokenholderVote(ctx, msg.Id, voterAcc, dispute.BlockNumber, msg.Vote) if err != nil { return nil, err } - totalSupply := k.GetTotalSupply(ctx) - voterPower := teampower.Add(upower).Add(repP).Add(CalculateVotingPower(acctBal, totalSupply)) + // totalSupply := k.GetTotalSupply(ctx) + voterPower := teampower.Add(upower).Add(repP).Add(acctBal) if voterPower.IsZero() { return nil, errors.New("voter power is zero") } voterVote := types.Voter{ - Vote: msg.Vote, - VoterPower: voterPower, + Vote: msg.Vote, + VoterPower: voterPower, + ReporterPower: repP, + TokenholderPower: acctBal, } if err := k.Voter.Set(ctx, collections.Join(vote.Id, voterAcc.Bytes()), voterVote); err != nil { return nil, err } + + // try to tally the vote + err = k.Keeper.TallyVote(ctx, msg.Id) + if err != nil { + if !strings.EqualFold(err.Error(), types.ErrNoQuorumStillVoting.Error()) { + return nil, err + } + } ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( "voted_on_dispute", diff --git a/x/dispute/keeper/msg_server_vote_test.go b/x/dispute/keeper/msg_server_vote_test.go index 360ee3737..d22895d75 100644 --- a/x/dispute/keeper/msg_server_vote_test.go +++ b/x/dispute/keeper/msg_server_vote_test.go @@ -12,7 +12,8 @@ import ( ) func (s *KeeperTestSuite) TestVote() { - // Add dispute + // k := s.disputeKeeper + // Create dispute addr := s.TestMsgProposeDisputeFromAccount() // mock dependency modules @@ -23,6 +24,7 @@ func (s *KeeperTestSuite) TestVote() { Reporter: addr.Bytes(), }, nil) s.reporterKeeper.On("GetReporterTokensAtBlock", s.ctx, addr.Bytes(), uint64(s.ctx.BlockHeight())).Return(math.NewInt(1), nil) + s.reporterKeeper.On("GetDelegatorTokensAtBlock", s.ctx, addr.Bytes(), uint64(s.ctx.BlockHeight())).Return(math.NewInt(100), nil).Once() voteMsg := types.MsgVote{ Voter: addr.String(), @@ -50,6 +52,9 @@ func (s *KeeperTestSuite) TestVote() { keys, err := iter.PrimaryKeys() s.NoError(err) s.Equal(keys[0].K2(), addr.Bytes()) - s.Equal(vote.VoteResult, types.VoteResult_NO_TALLY) + // vote calls tally, enough ppl have voted to reach quorum + s.Equal(vote.VoteResult, types.VoteResult_SUPPORT) s.Equal(vote.Id, uint64(1)) } + +// TODO: more tests diff --git a/x/dispute/keeper/msg_server_withdraw_fee_refund.go b/x/dispute/keeper/msg_server_withdraw_fee_refund.go new file mode 100644 index 000000000..84df091b2 --- /dev/null +++ b/x/dispute/keeper/msg_server_withdraw_fee_refund.go @@ -0,0 +1,97 @@ +package keeper + +import ( + "context" + "errors" + + layertypes "github.com/tellor-io/layer/types" + "github.com/tellor-io/layer/x/dispute/types" + + "cosmossdk.io/collections" + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) WithdrawFeeRefund(ctx context.Context, msg *types.MsgWithdrawFeeRefund) (*types.MsgWithdrawFeeRefundResponse, error) { + k.Keeper.Logger(ctx).Info("WithdrawFeeRefund") + // should be ok to be called by anyone + feePayer := sdk.MustAccAddressFromBech32(msg.PayerAddress) + // dispute + dispute, err := k.Disputes.Get(ctx, msg.Id) + if err != nil { + return nil, err + } + payerInfo, err := k.DisputeFeePayer.Get(ctx, collections.Join(msg.Id, feePayer.Bytes())) + if err != nil { + return nil, err + } + remainder, err := k.Dust.Get(ctx) + if err != nil { + return nil, err + } + // handle failed underfunded dispute + if dispute.DisputeStatus == types.Failed { + feeMinusBurn := dispute.FeeTotal.Quo(math.NewInt(20)) + fraction, err := k.RefundDisputeFee(ctx, feePayer, payerInfo, dispute.FeeTotal, feeMinusBurn, dispute.HashId) + if err != nil { + return nil, err + } + remainder = remainder.Add(fraction) + } else { + // check if vote executed + vote, err := k.Votes.Get(ctx, msg.Id) + if err != nil { + return nil, err + } + + if !vote.Executed { + return nil, errors.New("vote not executed") + } + + feeMinusBurn := dispute.SlashAmount.Sub(dispute.BurnAmount) + switch vote.VoteResult { + case types.VoteResult_INVALID, types.VoteResult_NO_QUORUM_MAJORITY_INVALID: + fraction, err := k.RefundDisputeFee(ctx, feePayer, payerInfo, dispute.FeeTotal, feeMinusBurn, dispute.HashId) + if err != nil { + return nil, err + } + remainder = remainder.Add(fraction) + case types.VoteResult_SUPPORT, types.VoteResult_NO_QUORUM_MAJORITY_SUPPORT: + fraction, err := k.RefundDisputeFee(ctx, feePayer, payerInfo, dispute.FeeTotal, feeMinusBurn, dispute.HashId) + if err != nil { + return nil, err + } + + remainder = remainder.Add(fraction) + fraction, err = k.RewardReporterBondToFeePayers(ctx, feePayer, payerInfo, dispute.FeeTotal, dispute.SlashAmount) + if err != nil { + return nil, err + } + + remainder = remainder.Add(fraction) + + default: + return nil, errors.New("invalid vote result") + } + + } + + burnDust := remainder.Quo(layertypes.PowerReduction) + + if !burnDust.IsZero() { + if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(layertypes.BondDenom, burnDust))); err != nil { + return nil, err + } + remainder = remainder.Mod(layertypes.PowerReduction) + } + + if err := k.Dust.Set(ctx, remainder); err != nil { + return nil, err + } + + if err := k.DisputeFeePayer.Remove(ctx, collections.Join(msg.Id, feePayer.Bytes())); err != nil { + return nil, err + } + return nil, nil +} diff --git a/x/dispute/keeper/msg_tally_vote.go b/x/dispute/keeper/msg_tally_vote.go deleted file mode 100644 index b8fd43ff0..000000000 --- a/x/dispute/keeper/msg_tally_vote.go +++ /dev/null @@ -1,16 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/tellor-io/layer/x/dispute/types" -) - -func (k msgServer) TallyVote(ctx context.Context, msg *types.MsgTallyVote) (*types.MsgTallyVoteResponse, error) { - err := k.Keeper.TallyVote(ctx, msg.DisputeId) - if err != nil { - return nil, err - } - - return &types.MsgTallyVoteResponse{}, nil -} diff --git a/x/dispute/keeper/msg_tally_vote_test.go b/x/dispute/keeper/msg_tally_vote_test.go deleted file mode 100644 index 13aa14c4c..000000000 --- a/x/dispute/keeper/msg_tally_vote_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package keeper_test - -import ( - "github.com/tellor-io/layer/testutil/sample" - layertypes "github.com/tellor-io/layer/types" - "github.com/tellor-io/layer/x/dispute/types" - - "cosmossdk.io/collections" - "cosmossdk.io/math" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (s *KeeperTestSuite) TestMsgTallyVote() { - require := s.Require() - msgServer := s.msgServer - ctx := s.ctx - k := s.disputeKeeper - bk := s.bankKeeper - - res, err := msgServer.TallyVote(s.ctx, &types.MsgTallyVote{ - CallerAddress: "caller_address", - DisputeId: uint64(1), - }) - require.Error(err) - require.Nil(res) - - id1 := uint64(1) - userAddr := sample.AccAddressBytes() - tokenHolderAddr := sample.AccAddressBytes() - reporterAddr := sample.AccAddressBytes() - teamAddr, err := k.GetTeamAddress(ctx) - require.NoError(err) - - require.NoError(k.Votes.Set(ctx, id1, types.Vote{ - Id: id1, - VoteResult: types.VoteResult_NO_TALLY, - Executed: false, - })) - - require.NoError(k.Disputes.Set(ctx, id1, types.Dispute{ - DisputeId: id1, - HashId: []byte("hashId"), - })) - - require.NoError(k.BlockInfo.Set(ctx, []byte("hashId"), types.BlockInfo{ - TotalReporterPower: math.NewInt(250 * 1e6), - TotalUserTips: math.NewInt(250 * 1e6), - })) - bk.On("GetSupply", ctx, layertypes.BondDenom).Return(sdk.Coin{Denom: layertypes.BondDenom, Amount: math.NewInt(250 * 1e6)}, nil) - bk.On("GetSupply", ctx, layertypes.BondDenom).Return(sdk.Coin{Denom: layertypes.BondDenom, Amount: math.NewInt(250 * 1e6)}, nil) - require.ErrorContains(k.TallyVote(ctx, id1), "vote period not ended and quorum not reached") - - // set team vote (25% support) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, teamAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.NewInt(250 * 1e6)})) - _, err = k.SetTeamVote(ctx, id1, teamAddr) - require.NoError(err) - bk.On("GetBalance", ctx, teamAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, userAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, reporterAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, tokenHolderAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - require.Error(k.TallyVote(ctx, id1)) - - // set user vote (25% support) - require.NoError(k.UsersGroup.Set(ctx, collections.Join(id1, userAddr.Bytes()), math.NewInt(250*1e6))) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, userAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.NewInt(250 * 1e6)})) - - // set reporter vote (25% support) - require.NoError(k.ReportersGroup.Set(ctx, collections.Join(id1, reporterAddr.Bytes()), math.NewInt(250*1e6))) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, reporterAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.NewInt(250 * 1e6)})) - - res, err = msgServer.TallyVote(s.ctx, &types.MsgTallyVote{ - CallerAddress: "caller_address", - DisputeId: uint64(1), - }) - require.NoError(err) - require.NotNil(res) -} diff --git a/x/dispute/keeper/tally.go b/x/dispute/keeper/tally.go index 0908f9485..0f55bfe52 100644 --- a/x/dispute/keeper/tally.go +++ b/x/dispute/keeper/tally.go @@ -3,7 +3,6 @@ package keeper import ( "context" "errors" - "fmt" layertypes "github.com/tellor-io/layer/types" "github.com/tellor-io/layer/x/dispute/types" @@ -40,30 +39,23 @@ func (k Keeper) GetTotalSupply(ctx context.Context) math.Int { } // The `Ratio` function calculates the percentage ratio of `part` to `total`, scaled by a factor of 4 for the total before calculation. The result is expressed as a percentage. -func Ratio(total, part math.Int) math.LegacyDec { +// Ratio gets called on each sector of voters after votes have been summed e.g Ratio(totalUserTips, userVoteSum) +func Ratio(total, part math.Int) math.Int { if total.IsZero() { - return math.LegacyZeroDec() - } - total = total.MulRaw(4) - ratio := math.LegacyNewDecFromInt(part).Quo(math.LegacyNewDecFromInt(total)) - return ratio.MulInt64(100) -} - -// CalculateVotingPower calculates the voting power of a given number (n) divided by another number (d). -func CalculateVotingPower(n, d math.Int) math.Int { - if n.IsZero() || d.IsZero() { return math.ZeroInt() } - scalingFactor := math.NewInt(1_000_000) - return n.Mul(scalingFactor).Quo(d).MulRaw(25_000_000).Quo(scalingFactor) + total = total.MulRaw(4) + ratio := part.Mul(layertypes.PowerReduction).Quo(total) + return ratio.MulRaw(100) } -// CalculateVotingPower calculates the voting power of a given number (n) divided by another number (d). +// TallyVote determines whether the dispute vote has either reached quorum or the vote period has ended. +// If so, it calculates the given dispute round's outcome. func (k Keeper) TallyVote(ctx context.Context, id uint64) error { - numGroups := math.LegacyNewDec(4) - scaledSupport := math.LegacyZeroDec() - scaledAgainst := math.LegacyZeroDec() - scaledInvalid := math.LegacyZeroDec() + numGroups := math.NewIntFromUint64(4) + scaledSupport := math.ZeroInt() + scaledAgainst := math.ZeroInt() + scaledInvalid := math.ZeroInt() vote, err := k.Votes.Get(ctx, id) if err != nil { return err @@ -81,7 +73,17 @@ func (k Keeper) TallyVote(ctx context.Context, id uint64) error { return err } - totalRatio := math.LegacyZeroDec() + voteCounts, err := k.VoteCountsByGroup.Get(ctx, id) + if err != nil { + voteCounts = types.StakeholderVoteCounts{ + Users: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Team: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + } + } + + totalRatio := math.ZeroInt() // init tallies tallies := types.Tally{ ForVotes: k.InitVoterClasses(), @@ -89,15 +91,15 @@ func (k Keeper) TallyVote(ctx context.Context, id uint64) error { Invalid: k.InitVoterClasses(), } - teamVote, err := k.TeamVote(ctx, id) + teamAddr, err := k.GetTeamAddress(ctx) if err != nil { return err } - if teamVote.GT(math.ZeroInt()) { - teamAddr, err := k.GetTeamAddress(ctx) - if err != nil { - return err - } + teamDidVote, err := k.Voter.Has(ctx, collections.Join(id, teamAddr.Bytes())) + if err != nil { + return err + } + if teamDidVote { vote, err := k.Voter.Get(ctx, collections.Join(id, teamAddr.Bytes())) if err != nil { return err @@ -105,153 +107,97 @@ func (k Keeper) TallyVote(ctx context.Context, id uint64) error { switch vote.Vote { case types.VoteEnum_VOTE_SUPPORT: tallies.ForVotes.Team = math.OneInt() - scaledSupport = scaledSupport.Add(math.LegacyOneDec()) + scaledSupport = scaledSupport.Add(layertypes.PowerReduction) case types.VoteEnum_VOTE_AGAINST: tallies.AgainstVotes.Team = math.OneInt() - scaledAgainst = scaledAgainst.Add(math.LegacyOneDec()) + scaledAgainst = scaledAgainst.Add(layertypes.PowerReduction) case types.VoteEnum_VOTE_INVALID: tallies.Invalid.Team = math.OneInt() - scaledInvalid = scaledInvalid.Add(math.LegacyOneDec()) + scaledInvalid = scaledInvalid.Add(layertypes.PowerReduction) } - totalRatio = totalRatio.Add(math.LegacyNewDec(25)) + totalRatio = totalRatio.Add(math.NewInt(25).Mul(layertypes.PowerReduction)) } // get user group - userVoteSum := math.ZeroInt() - userRng := collections.NewPrefixedPairRange[uint64, []byte](id) - err = k.UsersGroup.Walk(ctx, userRng, func(key collections.Pair[uint64, []byte], value math.Int) (stop bool, err error) { - vote, err := k.Voter.Get(ctx, key) - if err != nil { - return true, err - } - switch vote.Vote { - case types.VoteEnum_VOTE_SUPPORT: - tallies.ForVotes.Users = tallies.ForVotes.Users.Add(value) - case types.VoteEnum_VOTE_AGAINST: - tallies.AgainstVotes.Users = tallies.AgainstVotes.Users.Add(value) - case types.VoteEnum_VOTE_INVALID: - tallies.Invalid.Users = tallies.Invalid.Users.Add(value) - } - userVoteSum = userVoteSum.Add(value) - return false, nil - }) - if err != nil { - return err - } + tallies.ForVotes.Users = math.NewIntFromUint64(voteCounts.Users.Support) + tallies.AgainstVotes.Users = math.NewIntFromUint64(voteCounts.Users.Against) + tallies.Invalid.Users = math.NewIntFromUint64(voteCounts.Users.Invalid) + userVoteSum := tallies.ForVotes.Users.Add(tallies.AgainstVotes.Users).Add(tallies.Invalid.Users) if userVoteSum.GT(math.ZeroInt()) { totalRatio = totalRatio.Add(Ratio(info.TotalUserTips, userVoteSum)) - userVoteSumDec := math.LegacyNewDecFromInt(userVoteSum) - - scaledSupport = scaledSupport.Add(math.LegacyNewDecFromInt(tallies.ForVotes.Users).Quo(userVoteSumDec)) - scaledAgainst = scaledAgainst.Add(math.LegacyNewDecFromInt(tallies.AgainstVotes.Users).Quo(userVoteSumDec)) - scaledInvalid = scaledInvalid.Add(math.LegacyNewDecFromInt(tallies.Invalid.Users).Quo(userVoteSumDec)) + scaledSupport = scaledSupport.Add(tallies.ForVotes.Users.Mul(layertypes.PowerReduction).Quo(userVoteSum)) + scaledAgainst = scaledAgainst.Add(tallies.AgainstVotes.Users.Mul(layertypes.PowerReduction).Quo(userVoteSum)) + scaledInvalid = scaledInvalid.Add(tallies.Invalid.Users.Mul(layertypes.PowerReduction).Quo(userVoteSum)) } - reporterRatio := math.LegacyZeroDec() - reporterVoteSum := math.ZeroInt() - reportersRng := collections.NewPrefixedPairRange[uint64, []byte](id) - err = k.ReportersGroup.Walk(ctx, reportersRng, func(key collections.Pair[uint64, []byte], value math.Int) (stop bool, err error) { - vote, err := k.Voter.Get(ctx, key) - if err != nil { - return true, err - } - switch vote.Vote { - case types.VoteEnum_VOTE_SUPPORT: - tallies.ForVotes.Reporters = tallies.ForVotes.Reporters.Add(value) - case types.VoteEnum_VOTE_AGAINST: - tallies.AgainstVotes.Reporters = tallies.AgainstVotes.Reporters.Add(value) - case types.VoteEnum_VOTE_INVALID: - tallies.Invalid.Reporters = tallies.Invalid.Reporters.Add(value) - } - reporterVoteSum = reporterVoteSum.Add(value) - reporterRatio = reporterRatio.Add(Ratio(info.TotalReporterPower, reporterVoteSum)) - totalRatio = totalRatio.Add(reporterRatio) - if totalRatio.GTE(math.LegacyNewDec(51)) { - return true, nil - } + // replace logic above with this + tallies.ForVotes.Reporters = math.NewIntFromUint64(voteCounts.Reporters.Support) + tallies.AgainstVotes.Reporters = math.NewIntFromUint64(voteCounts.Reporters.Against) + tallies.Invalid.Reporters = math.NewIntFromUint64(voteCounts.Reporters.Invalid) + reporterVoteSum := tallies.ForVotes.Reporters.Add(tallies.AgainstVotes.Reporters).Add(tallies.Invalid.Reporters) + reporterRatio := Ratio(info.TotalReporterPower, reporterVoteSum) + totalRatio = totalRatio.Add(reporterRatio) - return false, nil - }) - if err != nil { - return err - } if reporterVoteSum.GT(math.ZeroInt()) { - reporterVoteSumDec := math.LegacyNewDecFromInt(reporterVoteSum) - forReporters := math.LegacyNewDecFromInt(tallies.ForVotes.Reporters).Quo(reporterVoteSumDec) - againstReporters := math.LegacyNewDecFromInt(tallies.AgainstVotes.Reporters).Quo(reporterVoteSumDec) - invalidReporters := math.LegacyNewDecFromInt(tallies.Invalid.Reporters).Quo(reporterVoteSumDec) + forReporters := tallies.ForVotes.Reporters.Mul(layertypes.PowerReduction).Quo(reporterVoteSum) + againstReporters := tallies.AgainstVotes.Reporters.Mul(layertypes.PowerReduction).Quo(reporterVoteSum) + invalidReporters := tallies.Invalid.Reporters.Mul(layertypes.PowerReduction).Quo(reporterVoteSum) scaledSupport = scaledSupport.Add(forReporters) scaledAgainst = scaledAgainst.Add(againstReporters) scaledInvalid = scaledInvalid.Add(invalidReporters) } - if totalRatio.GTE(math.LegacyNewDec(51)) { + if totalRatio.GTE(math.NewInt(51).Mul(layertypes.PowerReduction)) { scaledSupport = scaledSupport.Quo(numGroups) scaledAgainst = scaledAgainst.Quo(numGroups) scaledInvalid = scaledInvalid.Quo(numGroups) - fmt.Println("quorum reached") dispute.DisputeStatus = types.Resolved dispute.Open = false + dispute.PendingExecution = true return k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, true) } - allvoters, err := k.GetVoters(ctx, id) - if err != nil { - return err - } - tokenHolderVoteSum := math.ZeroInt() tokenSupply := k.GetTotalSupply(ctx) - for _, v := range allvoters { - voterAddr := v.Key.K2() - tkHol, err := k.GetAccountBalance(ctx, voterAddr) - if err != nil { - return err - } - switch v.Value.Vote { - case types.VoteEnum_VOTE_SUPPORT: - tallies.ForVotes.TokenHolders = tallies.ForVotes.TokenHolders.Add(tkHol) - case types.VoteEnum_VOTE_AGAINST: - tallies.AgainstVotes.TokenHolders = tallies.AgainstVotes.TokenHolders.Add(tkHol) - case types.VoteEnum_VOTE_INVALID: - tallies.Invalid.TokenHolders = tallies.Invalid.TokenHolders.Add(tkHol) - } - tokenHolderVoteSum = tokenHolderVoteSum.Add(tkHol) - totalRatio = totalRatio.Add(Ratio(tokenSupply, tokenHolderVoteSum)) + // replace logic above with this + tallies.ForVotes.TokenHolders = math.NewIntFromUint64(voteCounts.Tokenholders.Support) + tallies.AgainstVotes.TokenHolders = math.NewIntFromUint64(voteCounts.Tokenholders.Against) + tallies.Invalid.TokenHolders = math.NewIntFromUint64(voteCounts.Tokenholders.Invalid) + tokenHolderVoteSum := tallies.ForVotes.TokenHolders.Add(tallies.AgainstVotes.TokenHolders).Add(tallies.Invalid.TokenHolders) + totalRatio = totalRatio.Add(Ratio(tokenSupply, tokenHolderVoteSum)) - if totalRatio.GTE(math.LegacyNewDec(51)) { - break - } - } - tokenHolderVoteSumDec := math.LegacyNewDecFromInt(tokenHolderVoteSum) if !tokenHolderVoteSum.IsZero() { - forTokenHolders := math.LegacyNewDecFromInt(tallies.ForVotes.TokenHolders).Quo(tokenHolderVoteSumDec) - againstTokenHolders := math.LegacyNewDecFromInt(tallies.AgainstVotes.TokenHolders).Quo(tokenHolderVoteSumDec) - invalidTokenHolders := math.LegacyNewDecFromInt(tallies.Invalid.TokenHolders).Quo(tokenHolderVoteSumDec) + forTokenHolders := tallies.ForVotes.TokenHolders.Mul(layertypes.PowerReduction).Quo(tokenHolderVoteSum) + againstTokenHolders := tallies.AgainstVotes.TokenHolders.Mul(layertypes.PowerReduction).Quo(tokenHolderVoteSum) + invalidTokenHolders := tallies.Invalid.TokenHolders.Mul(layertypes.PowerReduction).Quo(tokenHolderVoteSum) scaledSupport = scaledSupport.Add(forTokenHolders).Quo(numGroups) scaledAgainst = scaledAgainst.Add(againstTokenHolders).Quo(numGroups) scaledInvalid = scaledInvalid.Add(invalidTokenHolders).Quo(numGroups) } - if totalRatio.GTE(math.LegacyNewDec(51)) { + if totalRatio.GTE(math.NewInt(51).Mul(layertypes.PowerReduction)) { dispute.DisputeStatus = types.Resolved dispute.Open = false + dispute.PendingExecution = true return k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, true) } sdkctx := sdk.UnwrapSDKContext(ctx) // quorum not reached case if vote.VoteEnd.Before(sdkctx.BlockTime()) { - fmt.Println("quorum not reached") dispute.DisputeStatus = types.Unresolved // check if rounds have been exhausted or dispute has expired in order to disperse funds if dispute.DisputeEndTime.Before(sdkctx.BlockTime()) { dispute.DisputeStatus = types.Resolved dispute.Open = false + dispute.PendingExecution = true + } + allvoters, err := k.GetVoters(ctx, id) + if err != nil { + return err } if len(allvoters) == 0 { - if err := k.Disputes.Set(ctx, id, dispute); err != nil { return err } @@ -261,7 +207,7 @@ func (k Keeper) TallyVote(ctx context.Context, id uint64) error { } return k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, false) } else { - return errors.New("vote period not ended and quorum not reached") + return errors.New(types.ErrNoQuorumStillVoting.Error()) } } @@ -270,7 +216,7 @@ func (k Keeper) UpdateDispute( id uint64, dispute types.Dispute, vote types.Vote, - scaledSupport, scaledAgainst, scaledInvalid math.LegacyDec, quorum bool, + scaledSupport, scaledAgainst, scaledInvalid math.Int, quorum bool, ) error { if err := k.Disputes.Set(ctx, id, dispute); err != nil { return err diff --git a/x/dispute/keeper/tally_test.go b/x/dispute/keeper/tally_test.go index 1b41a9c8a..a7ddaf31c 100644 --- a/x/dispute/keeper/tally_test.go +++ b/x/dispute/keeper/tally_test.go @@ -1,7 +1,8 @@ package keeper_test import ( - "time" + "errors" + "fmt" "github.com/tellor-io/layer/testutil/sample" layertypes "github.com/tellor-io/layer/types" @@ -77,213 +78,393 @@ func (s *KeeperTestSuite) TestRatio() { // 10/25 --> 10/100 ratio := disputekeeper.Ratio(math.NewInt(25), math.NewInt(10)) - require.Equal(ratio, math.LegacyNewDecWithPrec(10, 0)) + fmt.Println(ratio) + require.Equal(ratio, math.NewInt(10*1e6)) // 25/25 --> 25/100 ratio = disputekeeper.Ratio(math.NewInt(25), math.NewInt(25)) - require.Equal(ratio, math.LegacyNewDecWithPrec(25, 0)) + fmt.Println(ratio) + require.Equal(ratio, math.NewInt(25*1e6)) // 0/25 --> 0/100 ratio = disputekeeper.Ratio(math.NewInt(25), math.NewInt(0)) - require.Equal(ratio, math.LegacyNewDecWithPrec(0, 0)) + fmt.Println(ratio) + require.Equal(ratio, math.NewInt(0)) // 25/0 --> 100/0 ratio = disputekeeper.Ratio(math.NewInt(0), math.NewInt(25)) - require.Equal(ratio, math.LegacyNewDecWithPrec(0, 0)) + fmt.Println(ratio) + require.Equal(ratio, math.NewInt(0)) + + // big numbers + // ex. total reporter power is 1_000_000 trb, all of them have voted + ratio = disputekeeper.Ratio(math.NewInt(1_000_000), math.NewInt(1_000_000)) + fmt.Println(ratio) + require.Equal(ratio, math.NewInt(25*1e6)) + + // ex. total reporter power is 1e14 trb, 1e13 trb have voted + ratio = disputekeeper.Ratio(math.NewInt(1e14), math.NewInt(1e14)) + fmt.Println(ratio) + require.Equal(ratio, math.NewInt(25*1e6)) } -func (s *KeeperTestSuite) TestCalculateVotingPower() { +func (s *KeeperTestSuite) TestTallyVote() { + k := s.disputeKeeper + bk := s.bankKeeper + ctx := s.ctx require := s.Require() + require.NotNil(k) + require.NotNil(ctx) - // 100/100 --> 100/400 - votingPower := disputekeeper.CalculateVotingPower(math.NewInt(100), math.NewInt(100)) - require.Equal(votingPower, math.NewInt(25*1e6)) - // 50/100 --> 50/400 - votingPower = disputekeeper.CalculateVotingPower(math.NewInt(50), math.NewInt(100)) - require.Equal(votingPower, math.NewInt(12.5*1e6)) - // 100/0 --> 100/0 - votingPower = disputekeeper.CalculateVotingPower(math.NewInt(100), math.NewInt(0)) - require.Equal(votingPower, math.NewInt(0)) - // 0/100 --> 0/400 - votingPower = disputekeeper.CalculateVotingPower(math.NewInt(0), math.NewInt(100)) - require.Equal(votingPower, math.NewInt(0)) + testCases := []struct { + name string + disputeId uint64 + setup func() + teardown func() + expectedError error + expectedVotes types.StakeholderVoteCounts + }{ + { + name: "vote already tallied", + disputeId: uint64(1), + setup: func() { + disputeId := uint64(1) + require.NoError(k.Votes.Set(ctx, uint64(1), types.Vote{ + Id: disputeId, + VoteResult: types.VoteResult_INVALID, + })) + }, + teardown: func() { + disputeId := uint64(1) + require.NoError(k.Votes.Remove(ctx, disputeId)) + }, + expectedError: errors.New("vote already tallied"), + }, + { + name: "team votes only", + disputeId: uint64(2), + setup: func() { + disputeId := uint64(2) + // get team address + teamAddr, err := k.GetTeamAddress(ctx) + require.NoError(err) + // set dispute voting status + require.NoError(k.Votes.Set(ctx, disputeId, types.Vote{ + Id: disputeId, + VoteResult: types.VoteResult_NO_TALLY, + })) + // set dispute info + require.NoError(k.Disputes.Set(ctx, disputeId, types.Dispute{ + HashId: []byte("hashId2"), + DisputeId: disputeId, + })) + // set block info + require.NoError(k.BlockInfo.Set(ctx, []byte("hashId2"), types.BlockInfo{ + TotalReporterPower: math.NewInt(50 * 1e6), + TotalUserTips: math.NewInt(50 * 1e6), + })) + // set vote counts by group + require.NoError(k.VoteCountsByGroup.Set(ctx, disputeId, types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + })) + // set team vote + require.NoError(k.Voter.Set(ctx, collections.Join(disputeId, teamAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.NewInt(25000000)})) + // mock for GetTotalSupply + bk.On("GetSupply", ctx, layertypes.BondDenom).Return(sdk.Coin{Denom: layertypes.BondDenom, Amount: math.NewInt(250 * 1e6)}, nil) + }, + teardown: func() {}, + expectedError: errors.New("vote period not ended and quorum not reached"), + expectedVotes: types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 25000000, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Users: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + }, + }, + { + name: "team votes, all users vote, quorum not reached", + disputeId: uint64(2), + setup: func() { + disputeId := uint64(2) + require.NoError(k.VoteCountsByGroup.Set(ctx, disputeId, types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 25000000, Against: 0, Invalid: 0}, + Users: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + })) + }, + teardown: func() {}, + expectedError: errors.New("vote period not ended and quorum not reached"), + expectedVotes: types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 25000000, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Users: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + }, + }, + { + name: "team votes, all users vote, reporters vote, quorum reached", + disputeId: uint64(2), + setup: func() { + disputeId := uint64(2) + require.NoError(k.VoteCountsByGroup.Set(ctx, disputeId, types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 25000000, Against: 0, Invalid: 0}, + Users: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + })) + }, + teardown: func() {}, + expectedError: nil, + expectedVotes: types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 25000000, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 0, Against: 0, Invalid: 0}, + Users: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + }, + }, + { + name: "everybody votes, quorum reached", + disputeId: uint64(3), + setup: func() { + disputeId := uint64(3) + // get team address + teamAddr, err := k.GetTeamAddress(ctx) + require.NoError(err) + // set dispute voting status + require.NoError(k.Votes.Set(ctx, disputeId, types.Vote{ + Id: disputeId, + VoteResult: types.VoteResult_NO_TALLY, + })) + // set dispute info + require.NoError(k.Disputes.Set(ctx, disputeId, types.Dispute{ + HashId: []byte("hashId3"), + DisputeId: disputeId, + })) + // set block info + require.NoError(k.BlockInfo.Set(ctx, []byte("hashId3"), types.BlockInfo{ + TotalReporterPower: math.NewInt(50 * 1e6), + TotalUserTips: math.NewInt(50 * 1e6), + })) + // set vote counts by group + require.NoError(k.VoteCountsByGroup.Set(ctx, disputeId, types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 25000000, Against: 0, Invalid: 0}, + Users: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 250000000, Against: 0, Invalid: 0}, + })) + // set team vote + require.NoError(k.Voter.Set(ctx, collections.Join(disputeId, teamAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.NewInt(25000000)})) + // mock for GetTotalSupply + bk.On("GetSupply", ctx, layertypes.BondDenom).Return(sdk.Coin{Denom: layertypes.BondDenom, Amount: math.NewInt(250 * 1e6)}, nil) + }, + teardown: func() {}, + expectedError: nil, + expectedVotes: types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 25000000, Against: 0, Invalid: 0}, + Reporters: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + Tokenholders: types.VoteCounts{Support: 250000000, Against: 0, Invalid: 0}, + Users: types.VoteCounts{Support: 50000000, Against: 0, Invalid: 0}, + }, + }, + { + name: "everybody votes, quorum reached", + disputeId: uint64(4), + setup: func() { + disputeId := uint64(4) + // get team address + teamAddr, err := k.GetTeamAddress(ctx) + require.NoError(err) + // set dispute voting status + require.NoError(k.Votes.Set(ctx, disputeId, types.Vote{ + Id: disputeId, + VoteResult: types.VoteResult_NO_TALLY, + })) + // set dispute info + require.NoError(k.Disputes.Set(ctx, disputeId, types.Dispute{ + HashId: []byte("hashId4"), + DisputeId: disputeId, + })) + // set block info + require.NoError(k.BlockInfo.Set(ctx, []byte("hashId4"), types.BlockInfo{ + TotalReporterPower: math.NewInt(60 * 1e6), + TotalUserTips: math.NewInt(60 * 1e6), + })) + // set vote counts by group + require.NoError(k.VoteCountsByGroup.Set(ctx, disputeId, types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 0, Against: 0, Invalid: 25000000}, + Users: types.VoteCounts{Support: 22500000, Against: 22500000, Invalid: 15000000}, + Reporters: types.VoteCounts{Support: 27500000, Against: 22500000, Invalid: 10000000}, + Tokenholders: types.VoteCounts{Support: 22500000, Against: 27500000, Invalid: 10000000}, + })) + // set team vote + require.NoError(k.Voter.Set(ctx, collections.Join(disputeId, teamAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_INVALID, VoterPower: math.NewInt(25000000)})) + // mock for GetTotalSupply + bk.On("GetSupply", ctx, layertypes.BondDenom).Return(sdk.Coin{Denom: layertypes.BondDenom, Amount: math.NewInt(60 * 1e6)}, nil) + }, + teardown: func() {}, + expectedError: nil, + expectedVotes: types.StakeholderVoteCounts{ + Team: types.VoteCounts{Support: 0, Against: 0, Invalid: 25000000}, + Users: types.VoteCounts{Support: 22500000, Against: 22500000, Invalid: 15000000}, + Reporters: types.VoteCounts{Support: 27500000, Against: 22500000, Invalid: 10000000}, + Tokenholders: types.VoteCounts{Support: 22500000, Against: 27500000, Invalid: 10000000}, + }, + }, + } + for _, tc := range testCases { + if tc.setup != nil { + fmt.Println(tc.name) + s.Run(tc.name, tc.setup) + } + err := k.TallyVote(ctx, tc.disputeId) + if tc.expectedError != nil { + require.Error(err) + fmt.Println("err: ", err) + require.ErrorContains(err, tc.expectedError.Error()) + } else { + require.NoError(err) + votesByGroup, err := k.VoteCountsByGroup.Get(ctx, tc.disputeId) + fmt.Println("votesByGroup: ", votesByGroup) + require.NoError(err) + require.Equal(tc.expectedVotes, votesByGroup) + dispute, err := k.Disputes.Get(ctx, tc.disputeId) + require.NoError(err) + fmt.Println("dispute: ", dispute) + } + if tc.teardown != nil { + s.Run(tc.name, tc.teardown) + } + } } -func (s *KeeperTestSuite) TestTallyVoteQuorumReachedWithoutTokenHolders() { - require := s.Require() - ctx := s.ctx +func (s *KeeperTestSuite) TestUpdateDispute() { k := s.disputeKeeper - bk := s.bankKeeper - - id1 := uint64(1) - userAddr := sample.AccAddressBytes() - tokenHolderAddr := sample.AccAddressBytes() - reporterAddr := sample.AccAddressBytes() - teamAddr, err := k.GetTeamAddress(ctx) + ctx := s.ctx + require := s.Require() + require.NotNil(k) + require.NotNil(ctx) + id := uint64(1) + dispute := types.Dispute{ + HashId: []byte("hashId"), + DisputeId: id, + DisputeCategory: types.Minor, + } + + // quorum support + vote := types.Vote{ + Id: id, + VoteResult: types.VoteResult_SUPPORT, + } + scaledSupport := math.NewInt(100) + scaledAgainst := math.ZeroInt() + scaledInvalid := math.ZeroInt() + + require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, true)) + disputeRes, err := k.Disputes.Get(ctx, id) require.NoError(err) - - require.Error(k.TallyVote(ctx, id1)) - - require.NoError(k.Votes.Set(ctx, id1, types.Vote{ - Id: id1, - VoteResult: types.VoteResult_NO_TALLY, - Executed: false, - })) - require.Error(k.TallyVote(ctx, id1)) - - require.NoError(k.Disputes.Set(ctx, id1, types.Dispute{ - DisputeId: id1, - HashId: []byte("hashId"), - })) - require.Error(k.TallyVote(ctx, id1)) - - require.NoError(k.BlockInfo.Set(ctx, []byte("hashId"), types.BlockInfo{ - TotalReporterPower: math.NewInt(250 * 1e6), - TotalUserTips: math.NewInt(250 * 1e6), - })) - bk.On("GetSupply", ctx, layertypes.BondDenom).Return(sdk.Coin{Denom: layertypes.BondDenom, Amount: math.NewInt(250 * 1e6)}, nil) - require.ErrorContains(k.TallyVote(ctx, id1), "vote period not ended and quorum not reached") - - // set team vote (25% support) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, teamAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.NewInt(250 * 1e6)})) - _, err = k.SetTeamVote(ctx, id1, teamAddr) + require.Equal(disputeRes.DisputeId, dispute.DisputeId) + require.Equal(disputeRes.HashId, dispute.HashId) + require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) + voteRes, err := k.Votes.Get(ctx, id) require.NoError(err) - bk.On("GetBalance", ctx, teamAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, userAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, reporterAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, tokenHolderAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - require.Error(k.TallyVote(ctx, id1)) - - // set user vote (25% support) - require.NoError(k.UsersGroup.Set(ctx, collections.Join(id1, userAddr.Bytes()), math.NewInt(250*1e6))) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, userAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.NewInt(250 * 1e6)})) - - // set reporter vote (25% support) - require.NoError(k.ReportersGroup.Set(ctx, collections.Join(id1, reporterAddr.Bytes()), math.NewInt(250*1e6))) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, reporterAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_SUPPORT, VoterPower: math.NewInt(250 * 1e6)})) - - // Vote ends with 75% Support - require.NoError(k.TallyVote(ctx, id1)) - dispute, err := k.Disputes.Get(ctx, id1) + require.Equal(voteRes.Id, vote.Id) + require.Equal(voteRes.VoteResult, vote.VoteResult) + + // no quorum majority support + vote = types.Vote{ + Id: id, + VoteResult: types.VoteResult_NO_QUORUM_MAJORITY_SUPPORT, + } + scaledSupport = math.NewInt(50) + scaledAgainst = math.ZeroInt() + scaledInvalid = math.ZeroInt() + + require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, false)) + disputeRes, err = k.Disputes.Get(ctx, id) require.NoError(err) - require.Equal(dispute.DisputeStatus, types.Resolved) - require.Equal(dispute.DisputeId, id1) - require.Equal(dispute.HashId, []byte("hashId")) - require.Equal(dispute.Open, false) -} - -func (s *KeeperTestSuite) TestTallyVoteQuorumReachedWithTokenHolders() { - require := s.Require() - ctx := s.ctx - k := s.disputeKeeper - bk := s.bankKeeper - - id1 := uint64(1) - userAddr := sample.AccAddressBytes() - tokenHolderAddr := sample.AccAddressBytes() - reporterAddr := sample.AccAddressBytes() - teamAddr, err := k.GetTeamAddress(ctx) + require.Equal(disputeRes.DisputeId, dispute.DisputeId) + require.Equal(disputeRes.HashId, dispute.HashId) + require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) + voteRes, err = k.Votes.Get(ctx, id) require.NoError(err) - - require.NoError(k.Votes.Set(ctx, id1, types.Vote{ - Id: id1, - VoteResult: types.VoteResult_NO_TALLY, - Executed: false, - })) - - require.NoError(k.Disputes.Set(ctx, id1, types.Dispute{ - DisputeId: id1, - HashId: []byte("hashId"), - })) - - require.NoError(k.BlockInfo.Set(ctx, []byte("hashId"), types.BlockInfo{ - TotalReporterPower: math.NewInt(250 * 1e6), - TotalUserTips: math.NewInt(250 * 1e6), - })) - bk.On("GetSupply", ctx, layertypes.BondDenom).Return(sdk.Coin{Denom: layertypes.BondDenom, Amount: math.NewInt(250 * 1e6)}, nil) - - // set team vote (25% support) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, teamAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_AGAINST, VoterPower: math.NewInt(250 * 1e6)})) - _, err = k.SetTeamVote(ctx, id1, teamAddr) + require.Equal(voteRes.Id, vote.Id) + require.Equal(voteRes.VoteResult, vote.VoteResult) + + // quorum against + vote = types.Vote{ + Id: id, + VoteResult: types.VoteResult_AGAINST, + } + scaledSupport = math.ZeroInt() + scaledAgainst = math.NewInt(100) + scaledInvalid = math.ZeroInt() + + require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, true)) + disputeRes, err = k.Disputes.Get(ctx, id) require.NoError(err) - bk.On("GetBalance", ctx, teamAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, userAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, reporterAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - bk.On("GetBalance", ctx, tokenHolderAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(250*1e6)), nil).Once() - - // set user vote (25% support) - require.NoError(k.UsersGroup.Set(ctx, collections.Join(id1, userAddr.Bytes()), math.NewInt(250*1e6))) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, userAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_AGAINST, VoterPower: math.NewInt(250 * 1e6)})) - - // set reporter vote (25% support) - require.NoError(k.ReportersGroup.Set(ctx, collections.Join(id1, reporterAddr.Bytes()), math.NewInt(1*1e6))) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, reporterAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_AGAINST, VoterPower: math.NewInt(1 * 1e6)})) - - // set token holder vote - require.NoError(k.Voter.Set(ctx, collections.Join(id1, tokenHolderAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_AGAINST, VoterPower: math.NewInt(250 * 1e6)})) - - require.NoError(k.TallyVote(ctx, id1)) - dispute, err := k.Disputes.Get(ctx, id1) + require.Equal(disputeRes.DisputeId, dispute.DisputeId) + require.Equal(disputeRes.HashId, dispute.HashId) + require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) + voteRes, err = k.Votes.Get(ctx, id) require.NoError(err) - require.Equal(dispute.DisputeStatus, types.Resolved) - require.Equal(dispute.DisputeId, id1) - require.Equal(dispute.HashId, []byte("hashId")) - require.Equal(dispute.Open, false) -} - -func (s *KeeperTestSuite) TestTallyVoteQuorumNotReachedVotePeriodEnds() { - require := s.Require() - ctx := s.ctx - k := s.disputeKeeper - bk := s.bankKeeper - - id1 := uint64(1) - userAddr := sample.AccAddressBytes() - tokenHolderAddr := sample.AccAddressBytes() - reporterAddr := sample.AccAddressBytes() - teamAddr, err := k.GetTeamAddress(ctx) + require.Equal(voteRes.Id, vote.Id) + require.Equal(voteRes.VoteResult, vote.VoteResult) + + // no quorum majority against + vote = types.Vote{ + Id: id, + VoteResult: types.VoteResult_NO_QUORUM_MAJORITY_AGAINST, + } + scaledSupport = math.ZeroInt() + scaledAgainst = math.NewInt(40) + scaledInvalid = math.ZeroInt() + + require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, false)) + disputeRes, err = k.Disputes.Get(ctx, id) require.NoError(err) - - require.NoError(k.Votes.Set(ctx, id1, types.Vote{ - Id: id1, - VoteResult: types.VoteResult_NO_TALLY, - Executed: false, - VoteEnd: ctx.BlockTime(), - })) - - require.NoError(k.Disputes.Set(ctx, id1, types.Dispute{ - DisputeId: id1, - HashId: []byte("hashId"), - })) - - ctx = ctx.WithBlockTime(ctx.BlockTime().Add(120 * time.Hour)) - require.NoError(k.BlockInfo.Set(ctx, []byte("hashId"), types.BlockInfo{ - TotalReporterPower: math.NewInt(250 * 1e6), - TotalUserTips: math.NewInt(250 * 1e6), - })) - bk.On("GetSupply", ctx, layertypes.BondDenom).Return(sdk.Coin{Denom: layertypes.BondDenom, Amount: math.NewInt(250 * 1e6)}, nil).Once() - - // set team vote (25% invalid) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, teamAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_INVALID, VoterPower: math.NewInt(250 * 1e6)})) - _, err = k.SetTeamVote(ctx, id1, teamAddr) + require.Equal(disputeRes.DisputeId, dispute.DisputeId) + require.Equal(disputeRes.HashId, dispute.HashId) + require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) + voteRes, err = k.Votes.Get(ctx, id) require.NoError(err) - bk.On("GetBalance", ctx, teamAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(1*1e6)), nil).Once() - bk.On("GetBalance", ctx, userAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(1*1e6)), nil).Once() - bk.On("GetBalance", ctx, reporterAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(1*1e6)), nil).Once() - bk.On("GetBalance", ctx, tokenHolderAddr, layertypes.BondDenom).Return(sdk.NewCoin(layertypes.BondDenom, math.NewInt(1*1e6)), nil).Once() - - // set user vote (<1 % invalid) - require.NoError(k.UsersGroup.Set(ctx, collections.Join(id1, userAddr.Bytes()), math.NewInt(1*1e6))) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, userAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_INVALID, VoterPower: math.NewInt(1 * 1e6)})) - - // set reporter vote (<1% invalid) - require.NoError(k.ReportersGroup.Set(ctx, collections.Join(id1, reporterAddr.Bytes()), math.NewInt(1*1e6))) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, reporterAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_INVALID, VoterPower: math.NewInt(1 * 1e6)})) - - // set token holder vote (<1% invalid) - require.NoError(k.Voter.Set(ctx, collections.Join(id1, tokenHolderAddr.Bytes()), types.Voter{Vote: types.VoteEnum_VOTE_INVALID, VoterPower: math.NewInt(1 * 1e6)})) - - require.NoError(k.TallyVote(ctx, id1)) - - dispute, err := k.Disputes.Get(ctx, id1) + require.Equal(voteRes.Id, vote.Id) + require.Equal(voteRes.VoteResult, vote.VoteResult) + + // quorum invalid + vote = types.Vote{ + Id: id, + VoteResult: types.VoteResult_INVALID, + } + scaledSupport = math.ZeroInt() + scaledAgainst = math.ZeroInt() + scaledInvalid = math.NewInt(51) + + require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, true)) + disputeRes, err = k.Disputes.Get(ctx, id) + require.NoError(err) + require.Equal(disputeRes.DisputeId, dispute.DisputeId) + require.Equal(disputeRes.HashId, dispute.HashId) + require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) + voteRes, err = k.Votes.Get(ctx, id) + require.NoError(err) + require.Equal(voteRes.Id, vote.Id) + require.Equal(voteRes.VoteResult, vote.VoteResult) + + // no quorum majority invalid + vote = types.Vote{ + Id: id, + VoteResult: types.VoteResult_NO_QUORUM_MAJORITY_INVALID, + } + scaledSupport = math.ZeroInt() + scaledAgainst = math.ZeroInt() + scaledInvalid = math.NewInt(49) + + require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, false)) + disputeRes, err = k.Disputes.Get(ctx, id) + require.NoError(err) + require.Equal(disputeRes.DisputeId, dispute.DisputeId) + require.Equal(disputeRes.HashId, dispute.HashId) + require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) + voteRes, err = k.Votes.Get(ctx, id) require.NoError(err) - require.Equal(dispute.DisputeStatus, types.Resolved) - require.Equal(dispute.Open, false) + require.Equal(voteRes.Id, vote.Id) + require.Equal(voteRes.VoteResult, vote.VoteResult) } diff --git a/x/dispute/keeper/vote.go b/x/dispute/keeper/vote.go index 14471c771..3445911ce 100644 --- a/x/dispute/keeper/vote.go +++ b/x/dispute/keeper/vote.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "errors" - "fmt" "github.com/tellor-io/layer/x/dispute/types" @@ -54,13 +53,32 @@ func (k Keeper) GetTeamAddress(ctx context.Context) (sdk.AccAddress, error) { return params.TeamAddress, nil } -func (k Keeper) SetTeamVote(ctx context.Context, id uint64, voter sdk.AccAddress) (math.Int, error) { +func (k Keeper) SetTeamVote(ctx context.Context, id uint64, voter sdk.AccAddress, choice types.VoteEnum) (math.Int, error) { teamAddr, err := k.GetTeamAddress(ctx) if err != nil { return math.Int{}, err } if bytes.Equal(voter, teamAddr) { + + voteCounts, err := k.VoteCountsByGroup.Get(ctx, id) + if err != nil { + if !errors.Is(err, collections.ErrNotFound) { + return math.Int{}, err + } + voteCounts = types.StakeholderVoteCounts{} + } + if choice == types.VoteEnum_VOTE_SUPPORT { + voteCounts.Team.Support = 1 + } else if choice == types.VoteEnum_VOTE_AGAINST { + voteCounts.Team.Against = 1 + } else { + voteCounts.Team.Invalid = 1 + } + err = k.VoteCountsByGroup.Set(ctx, id, voteCounts) + if err != nil { + return math.Int{}, err + } return math.NewInt(25000000), k.TeamVoter.Set(ctx, id, true) } return math.ZeroInt(), nil @@ -77,18 +95,37 @@ func (k Keeper) GetUserTotalTips(ctx context.Context, voter sdk.AccAddress, bloc return tips, nil } -func (k Keeper) SetVoterTips(ctx context.Context, id uint64, voter sdk.AccAddress, blockNumber uint64) (math.Int, error) { +func (k Keeper) SetVoterTips(ctx context.Context, id uint64, voter sdk.AccAddress, blockNumber uint64, choice types.VoteEnum) (math.Int, error) { tips, err := k.GetUserTotalTips(ctx, voter, blockNumber) if err != nil { return math.Int{}, err } if !tips.IsZero() { + voteCounts, err := k.VoteCountsByGroup.Get(ctx, id) + if err != nil { + if !errors.Is(err, collections.ErrNotFound) { + return math.Int{}, err + } + voteCounts = types.StakeholderVoteCounts{} + } + if choice == types.VoteEnum_VOTE_SUPPORT { + voteCounts.Users.Support += tips.Uint64() + } else if choice == types.VoteEnum_VOTE_AGAINST { + voteCounts.Users.Against += tips.Uint64() + } else { + voteCounts.Users.Invalid += tips.Uint64() + } + err = k.VoteCountsByGroup.Set(ctx, id, voteCounts) + if err != nil { + return math.Int{}, err + } return tips, k.UsersGroup.Set(ctx, collections.Join(id, voter.Bytes()), tips) } return math.ZeroInt(), nil } -func (k Keeper) SetVoterReporterStake(ctx context.Context, id uint64, voter sdk.AccAddress, blockNumber uint64) (math.Int, error) { +func (k Keeper) SetVoterReporterStake(ctx context.Context, id uint64, voter sdk.AccAddress, blockNumber uint64, choice types.VoteEnum) (math.Int, error) { + // get delegation delegation, err := k.reporterKeeper.Delegation(ctx, voter) if err != nil { if errors.Is(err, collections.ErrNotFound) { @@ -97,70 +134,126 @@ func (k Keeper) SetVoterReporterStake(ctx context.Context, id uint64, voter sdk. return math.Int{}, err } reporter := sdk.AccAddress(delegation.Reporter) - // Check if reporter has voted. If not, store voter tokens either full if reporter or delegation amount - // this amount the amount to reduce from reporter so total amount of delegators that voted - reporterTokensVoted, err := k.ReportersWithDelegatorsVotedBefore.Get(ctx, collections.Join(reporter.Bytes(), id)) + voterIsReporter := bytes.Equal(voter, reporter) + reporterHasVoted, err := k.Voter.Has(ctx, collections.Join(id, reporter.Bytes())) if err != nil { - if !errors.Is(err, collections.ErrNotFound) { + return math.Int{}, err + } + // voter is reporter + if voterIsReporter { + reporterTokens, err := k.reporterKeeper.GetReporterTokensAtBlock(ctx, reporter, blockNumber) + if err != nil { return math.Int{}, err } - if bytes.Equal(reporter, voter) { - reporterTokens, err := k.reporterKeeper.GetReporterTokensAtBlock(ctx, reporter, blockNumber) - if err != nil { + tokensVotedBefore, err := k.ReportersWithDelegatorsVotedBefore.Get(ctx, collections.Join(reporter.Bytes(), id)) + if err != nil { + if !errors.Is(err, collections.ErrNotFound) { return math.Int{}, err } - return reporterTokens, k.ReportersGroup.Set(ctx, collections.Join(id, voter.Bytes()), reporterTokens) + tokensVotedBefore = math.ZeroInt() } - amt, err := k.reporterKeeper.GetDelegatorTokensAtBlock(ctx, reporter, blockNumber) + reporterTokens = reporterTokens.Sub(tokensVotedBefore) + return reporterTokens, k.AddReporterVoteCount(ctx, id, reporterTokens.Uint64(), choice) + } + // voter is non-reporter selector + selectorTokens, err := k.reporterKeeper.GetDelegatorTokensAtBlock(ctx, voter, blockNumber) + if err != nil { + return math.Int{}, err + } + if reporterHasVoted { + reporterVote, err := k.Voter.Get(ctx, collections.Join(id, reporter.Bytes())) if err != nil { return math.Int{}, err } - exists, err := k.ReportersGroup.Has(ctx, collections.Join(id, reporter.Bytes())) + err = k.SubtractReporterVoteCount(ctx, id, selectorTokens.Uint64(), reporterVote.Vote) if err != nil { return math.Int{}, err } - fmt.Println("exists: ", exists) - if exists { - // get reporter tokens and reduce the amount - reporterTokens, err := k.ReportersGroup.Get(ctx, collections.Join(id, reporter.Bytes())) - if err != nil { - return math.Int{}, err - } - reporterTokens = reporterTokens.Sub(amt) - voterV, err := k.Voter.Get(ctx, collections.Join(id, reporter.Bytes())) - if err != nil { - return math.Int{}, err - } - voterV.VoterPower = voterV.VoterPower.Sub(amt) - if err := k.Voter.Set(ctx, collections.Join(id, reporter.Bytes()), voterV); err != nil { - return math.Int{}, err - } - if err := k.ReportersGroup.Set(ctx, collections.Join(id, reporter.Bytes()), reporterTokens); err != nil { - return math.Int{}, err - } - return amt, k.ReportersGroup.Set(ctx, collections.Join(id, voter.Bytes()), amt) - } - if err := k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(reporter.Bytes(), id), amt); err != nil { + // update reporter's power record for reward calculation + reporterVote.ReporterPower = reporterVote.ReporterPower.Sub(selectorTokens) + err = k.Voter.Set(ctx, collections.Join(id, reporter.Bytes()), reporterVote) + if err != nil { return math.Int{}, err } - return amt, k.ReportersGroup.Set(ctx, collections.Join(id, voter.Bytes()), amt) + return selectorTokens, k.AddReporterVoteCount(ctx, id, selectorTokens.Uint64(), choice) } - // if reporter delegators have voted before reporter, then if voter is reporter get reporter tokens at block and reduce the amount that has voted already - if bytes.Equal(reporter, voter) { - reporterTokens, err := k.reporterKeeper.GetReporterTokensAtBlock(ctx, reporter, blockNumber) - if err != nil { + delegatorTokensVoted, err := k.ReportersWithDelegatorsVotedBefore.Get(ctx, collections.Join(reporter.Bytes(), id)) + if err != nil { + if !errors.Is(err, collections.ErrNotFound) { return math.Int{}, err } - return reporterTokens.Sub(reporterTokensVoted), k.ReportersGroup.Set(ctx, collections.Join(id, voter.Bytes()), reporterTokens.Sub(reporterTokensVoted)) - } else { - amt, err := k.reporterKeeper.GetDelegatorTokensAtBlock(ctx, reporter, blockNumber) - if err != nil { + delegatorTokensVoted = math.ZeroInt() + } + delegatorTokensVoted = delegatorTokensVoted.Add(selectorTokens) + err = k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(reporter.Bytes(), id), delegatorTokensVoted) + if err != nil { + return math.Int{}, err + } + return selectorTokens, k.AddReporterVoteCount(ctx, id, selectorTokens.Uint64(), choice) +} + +func (k Keeper) SetTokenholderVote(ctx context.Context, id uint64, voter sdk.AccAddress, blockNumber uint64, choice types.VoteEnum) (math.Int, error) { + // get token balance + tokenBalance, err := k.GetAccountBalance(ctx, voter) + if err != nil { + return math.Int{}, err + } + // get tokens delegated to a reporter + selectorTokens, err := k.reporterKeeper.GetDelegatorTokensAtBlock(ctx, voter, blockNumber) + if err != nil { + if !errors.Is(err, collections.ErrNotFound) { return math.Int{}, err } - if err := k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(reporter.Bytes(), id), reporterTokensVoted.Add(amt)); err != nil { + selectorTokens = math.ZeroInt() + } + tokenBalance = tokenBalance.Add(selectorTokens) + + voteCounts, err := k.VoteCountsByGroup.Get(ctx, id) + if err != nil { + if !errors.Is(err, collections.ErrNotFound) { return math.Int{}, err } + voteCounts = types.StakeholderVoteCounts{} } + if choice == types.VoteEnum_VOTE_SUPPORT { + voteCounts.Tokenholders.Support += tokenBalance.Uint64() + } else if choice == types.VoteEnum_VOTE_AGAINST { + voteCounts.Tokenholders.Against += tokenBalance.Uint64() + } else { + voteCounts.Tokenholders.Invalid += tokenBalance.Uint64() + } + return tokenBalance, k.VoteCountsByGroup.Set(ctx, id, voteCounts) +} - return math.ZeroInt(), nil +func (k Keeper) AddReporterVoteCount(ctx context.Context, id, amount uint64, choice types.VoteEnum) error { + voteCounts, err := k.VoteCountsByGroup.Get(ctx, id) + if err != nil { + if !errors.Is(err, collections.ErrNotFound) { + return err + } + voteCounts = types.StakeholderVoteCounts{} + } + if choice == types.VoteEnum_VOTE_SUPPORT { + voteCounts.Reporters.Support += amount + } else if choice == types.VoteEnum_VOTE_AGAINST { + voteCounts.Reporters.Against += amount + } else { + voteCounts.Reporters.Invalid += amount + } + return k.VoteCountsByGroup.Set(ctx, id, voteCounts) +} + +func (k Keeper) SubtractReporterVoteCount(ctx context.Context, id, amount uint64, choice types.VoteEnum) error { + voteCounts, err := k.VoteCountsByGroup.Get(ctx, id) + if err != nil { + return err + } + if choice == types.VoteEnum_VOTE_SUPPORT { + voteCounts.Reporters.Support -= amount + } else if choice == types.VoteEnum_VOTE_AGAINST { + voteCounts.Reporters.Against -= amount + } else { + voteCounts.Reporters.Invalid -= amount + } + return k.VoteCountsByGroup.Set(ctx, id, voteCounts) } diff --git a/x/dispute/keeper/vote_test.go b/x/dispute/keeper/vote_test.go index a2faf9b55..4c89f7703 100644 --- a/x/dispute/keeper/vote_test.go +++ b/x/dispute/keeper/vote_test.go @@ -2,14 +2,18 @@ package keeper_test import ( "errors" + "fmt" "time" "github.com/tellor-io/layer/testutil/sample" + layertypes "github.com/tellor-io/layer/types" "github.com/tellor-io/layer/x/dispute/types" reportertypes "github.com/tellor-io/layer/x/reporter/types" "cosmossdk.io/collections" "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (s *KeeperTestSuite) TestInitVoterClasses() { @@ -27,39 +31,66 @@ func (s *KeeperTestSuite) TestSetStartVote() { require := s.Require() k := s.disputeKeeper ctx := s.ctx + ctx = ctx.WithBlockTime(time.Now()) - exptectedStartTime := ctx.BlockTime() - expectedEndTime := exptectedStartTime.Add(time.Hour * 48) - require.NoError(k.SetStartVote(s.ctx, 1)) - - vote, err := k.Votes.Get(s.ctx, 1) + // start vote with disputeId 1, expected end is 2 days after start + expectedStartTime := ctx.BlockTime() + expectedEndTime := expectedStartTime.Add(time.Hour * 48) + require.NoError(k.SetStartVote(ctx, 1)) + // check on vote + vote, err := k.Votes.Get(ctx, 1) require.NoError(err) - require.Equal(vote.VoteStart, exptectedStartTime) + require.Equal(vote.VoteStart, expectedStartTime) require.Equal(vote.VoteEnd, expectedEndTime) require.Equal(vote.Id, uint64(1)) + + // start vote with max disputeId, expected end is 2 days after start + ctx = ctx.WithBlockTime(time.Now().Add(1 * time.Hour)) + expectedStartTime = ctx.BlockTime() + expectedEndTime = ctx.BlockTime().Add(time.Hour * 48) + maxUint64 := ^uint64(0) + require.NoError(k.SetStartVote(ctx, maxUint64)) + // check on vote + vote, err = k.Votes.Get(ctx, maxUint64) + require.NoError(err) + require.Equal(vote.VoteStart, expectedStartTime) + require.Equal(vote.VoteEnd, expectedEndTime) + require.Equal(vote.Id, maxUint64) } -func (s *KeeperTestSuite) TestTeamVote() { +func (s *KeeperTestSuite) TestTeamVote_SetTeamVote() { require := s.Require() k := s.disputeKeeper ctx := s.ctx - teamTally, err := k.TeamVote(ctx, 1) + disputeId := uint64(1) + // team has not voted, expect 0 + teamTally, err := k.TeamVote(ctx, disputeId) require.NoError(err) require.Equal(teamTally, math.NewInt(0)) + // team votes SUPPORT, expect return 25000000 teamAddr, err := k.GetTeamAddress(ctx) require.NoError(err) - tally, err := k.SetTeamVote(ctx, 1, teamAddr) + teamVote, err := k.SetTeamVote(ctx, disputeId, teamAddr, types.VoteEnum_VOTE_SUPPORT) + require.NoError(err) + require.Equal(teamVote, math.NewInt(25000000)) + // check on vote + voted, err := k.TeamVoter.Get(ctx, disputeId) + require.True(voted) require.NoError(err) - require.Equal(tally, math.NewInt(25000000)) - tally, err = k.SetTeamVote(ctx, 1, sample.AccAddressBytes()) + votesByGroup, err := k.VoteCountsByGroup.Get(ctx, disputeId) + require.Equal(votesByGroup.Team.Against, uint64(0)) + require.Equal(votesByGroup.Team.Support, uint64(1)) + require.Equal(votesByGroup.Team.Invalid, uint64(0)) require.NoError(err) - require.Equal(tally, math.NewInt(0)) - teamTally, err = k.TeamVote(ctx, 1) + // vote from bad account, expect return 0 + badTeamVote, err := k.SetTeamVote(ctx, disputeId, sample.AccAddressBytes(), types.VoteEnum_VOTE_SUPPORT) require.NoError(err) - require.Equal(teamTally, math.NewInt(1)) + require.Equal(badTeamVote, math.NewInt(0)) + + // note: voters can only vote once } func (s *KeeperTestSuite) TestGetUserTotalTips() { @@ -67,21 +98,21 @@ func (s *KeeperTestSuite) TestGetUserTotalTips() { k := s.disputeKeeper ctx := s.ctx + // voter who has tipped 100 trb, expect return 100 voter := sample.AccAddressBytes() s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, uint64(1), voter).Return(math.NewInt(100), nil).Once() - userTips, err := k.GetUserTotalTips(ctx, voter, 1) require.NoError(err) require.Equal(userTips, math.NewInt(100)) - s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, uint64(1), voter).Return(math.NewInt(100), collections.ErrNotFound).Once() - + // get voter who has not tipped before, expect return 0 + s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, uint64(1), voter).Return(math.ZeroInt(), collections.ErrNotFound).Once() userTips, err = k.GetUserTotalTips(ctx, voter, 1) require.NoError(err) - require.Equal(userTips, math.NewInt(0)) - - s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, uint64(1), voter).Return(math.NewInt(100), errors.New("error")).Once() + require.Equal(userTips, math.ZeroInt()) + // get non collections not found err, expect return math.Int{} + s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, uint64(1), voter).Return(math.Int{}, errors.New("error")).Once() userTips, err = k.GetUserTotalTips(ctx, voter, 1) require.Error(err) require.Equal(userTips, math.Int{}) @@ -91,20 +122,46 @@ func (s *KeeperTestSuite) TestSetVoterTips() { require := s.Require() k := s.disputeKeeper ctx := s.ctx + ctx = ctx.WithBlockHeight(10) - voter := sample.AccAddressBytes() - s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, uint64(1), voter).Return(math.NewInt(100), nil).Once() - tips, err := k.SetVoterTips(ctx, uint64(1), voter, 1) + disputeId := uint64(1) + blockNum := uint64(ctx.BlockHeight()) + // user1 has tipped 100 trb, votes support + user1 := sample.AccAddressBytes() + s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, blockNum, user1).Return(math.NewInt(100), nil).Once() + tips, err := k.SetVoterTips(ctx, disputeId, user1, uint64(10), types.VoteEnum_VOTE_SUPPORT) require.NoError(err) require.Equal(tips, math.NewInt(100)) + // check on vote + votesByGroup, err := k.VoteCountsByGroup.Get(ctx, disputeId) + require.Equal(votesByGroup.Users.Against, uint64(0)) + require.Equal(votesByGroup.Users.Support, uint64(100)) + require.Equal(votesByGroup.Users.Invalid, uint64(0)) + require.NoError(err) - s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, uint64(1), voter).Return(math.NewInt(0), nil).Once() - tips, err = k.SetVoterTips(ctx, uint64(1), voter, 1) + // user2 has tipped 200 trb, votes against + user2 := sample.AccAddressBytes() + s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, blockNum, user2).Return(math.NewInt(200), nil).Once() + tips, err = k.SetVoterTips(ctx, disputeId, user2, uint64(10), types.VoteEnum_VOTE_AGAINST) + require.NoError(err) + require.Equal(tips, math.NewInt(200)) + // check on vote + votesByGroup, err = k.VoteCountsByGroup.Get(ctx, disputeId) + require.Equal(votesByGroup.Users.Against, uint64(200)) + require.Equal(votesByGroup.Users.Support, uint64(100)) + require.Equal(votesByGroup.Users.Invalid, uint64(0)) + require.NoError(err) + + // nonUser, expect return 0 + nonUser := sample.AccAddressBytes() + s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, blockNum, nonUser).Return(math.NewInt(0), nil).Once() + tips, err = k.SetVoterTips(ctx, disputeId, nonUser, blockNum, types.VoteEnum_VOTE_SUPPORT) require.NoError(err) require.Equal(tips, math.NewInt(0)) - s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, uint64(1), voter).Return(math.NewInt(100), errors.New("error")).Once() - tips, err = k.SetVoterTips(ctx, uint64(1), voter, 1) + // non collections not found error on GetUserTotalTips, expect return math.Int{}, err + s.oracleKeeper.On("GetTipsAtBlockForTipper", ctx, blockNum, nonUser).Return(math.NewInt(0), errors.New("error")).Once() + tips, err = k.SetVoterTips(ctx, disputeId, nonUser, blockNum, types.VoteEnum_VOTE_SUPPORT) require.Error(err) require.Equal(tips, math.Int{}) } @@ -114,277 +171,351 @@ func (s *KeeperTestSuite) TestSetVoterReportStake() { k := s.disputeKeeper rk := s.reporterKeeper ctx := s.ctx + ctx = ctx.WithBlockHeight(10) + + blockNum := uint64(10) + disputeId := uint64(1) reporter := sample.AccAddressBytes() selector := sample.AccAddressBytes() - blockNum := uint64(0) - id := uint64(1) - - // delegation not found, collections not found - rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{}, collections.ErrNotFound).Once() - reporterTokens, err := k.SetVoterReporterStake(ctx, id, reporter, blockNum) - require.NoError(err) - require.Equal(reporterTokens, math.ZeroInt()) - // delegation not found, not collections not found err - rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{}, errors.New("error")).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, reporter, blockNum) - require.Error(err) - require.Equal(reporterTokens, math.Int{}) - - // delegation found, ReportersWithDelegatorsVotedBefore empty, voter is reporter, error with GetReporterTokensAtBlock - rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - rk.On("GetReporterTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(100*1e6), errors.New("error")).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, reporter, blockNum) - require.Error(err) - require.Equal(reporterTokens, math.Int{}) - - // delegation found, ReportersWithDelegatorsVotedBefore empty, voter is reporter, no error with GetReporterTokensAtBlock, reportersgroup does not exist - rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - rk.On("GetReporterTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(100*1e6), nil).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, reporter, blockNum) - require.NoError(err) - require.Equal(reporterTokens, math.NewInt(100*1e6)) - reporterTokens, err = k.ReportersGroup.Get(ctx, collections.Join(id, reporter.Bytes())) - require.NoError(err) - require.Equal(reporterTokens, math.NewInt(100*1e6)) - - // delegation found, ReportersWithDelegatorsVotedBefore empty, voter is reporter, no error with GetReporterTokensAtBlock, reportersgroup exists - rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - rk.On("GetReporterTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(100*1e6), nil).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, reporter, blockNum) - require.NoError(err) - require.Equal(reporterTokens, math.NewInt(100*1e6)) - reporterTokens, err = k.ReportersGroup.Get(ctx, collections.Join(id, reporter.Bytes())) - require.NoError(err) - require.Equal(reporterTokens, math.NewInt(100*1e6)) - - // delegation found, ReportersWithDelegatorsVotedBefore empty, voter is delegator, error with GetDelegatorTokensAtBlock - rk.On("Delegation", ctx, selector).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - rk.On("GetDelegatorTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(50*1e6), errors.New("error")).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, selector, blockNum) - require.Error(err) - require.Equal(reporterTokens, math.Int{}) - - // delegation found, ReportersWithDelegatorsVotedBefore empty, voter is delegator, no error with GetDelegatorTokensAtBlock, reportersgroup set, voter not set - rk.On("Delegation", ctx, selector).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - rk.On("GetDelegatorTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(50*1e6), nil).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, selector, blockNum) - require.Error(err) - require.Equal(reporterTokens, math.Int{}) - - // delegation found, ReportersWithDelegatorsVotedBefore empty, voter is selector, no error with GetDelegatorTokensAtBlock, reportersgroup set, voter set - rk.On("Delegation", ctx, selector).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - rk.On("GetDelegatorTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(50*1e6), nil).Once() - require.NoError(k.Voter.Set(ctx, collections.Join(id, reporter.Bytes()), types.Voter{ - Vote: types.VoteEnum_VOTE_SUPPORT, - VoterPower: math.NewInt(50 * 1e6), - })) - reporterTokens, err = k.SetVoterReporterStake(ctx, id, selector, blockNum) - require.NoError(err) - require.Equal(reporterTokens, math.NewInt(50*1e6)) - - // clear ReportersGroup to get outside exists block - require.NoError(k.ReportersGroup.Remove(ctx, collections.Join(id, reporter.Bytes()))) - // delegation found, ReportersWithDelegatorsVotedBefore empty, voter is selector, no error with GetDelegatorTokensAtBlock, reportersgroup empty - rk.On("Delegation", ctx, selector).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - rk.On("GetDelegatorTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(50*1e6), nil).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, selector, blockNum) - require.NoError(err) - require.Equal(reporterTokens, math.NewInt(50*1e6)) - // clear ReportersWithDelegatorsVotedBefore - require.NoError(k.ReportersWithDelegatorsVotedBefore.Remove(ctx, collections.Join(selector.Bytes(), id))) - - // delegation found, ReportersWithDelegatorsVotedBefore set (selector has voted), voter is reporter, error with GetReporterTokensAtBlock - rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - require.NoError(k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(selector.Bytes(), id), math.NewInt(50*1e6))) - rk.On("GetReporterTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(100*1e6), errors.New("error")).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, reporter, blockNum) - require.Error(err) - require.Equal(reporterTokens, math.Int{}) - - // delegation found, ReportersWithDelegatorsVotedBefore set (selector has voted), voter is reporter, error with GetReporterTokensAtBlock - rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - require.NoError(k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(selector.Bytes(), id), math.NewInt(50*1e6))) - rk.On("GetReporterTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(100*1e6), nil).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, reporter, blockNum) - require.NoError(err) - require.Equal(reporterTokens, math.NewInt(100*1e6).Sub(math.NewInt(50*1e6))) - - // delegation found, ReportersWithDelegatorsBefore set (selector has voted), voter is selector, no error with GetDelegatorTokensAtBlock, selctor has voted with all of their tokens already - rk.On("Delegation", ctx, selector).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - require.NoError(k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(selector.Bytes(), id), math.NewInt(50*1e6))) - rk.On("GetDelegatorTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(50*1e6), nil).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, selector, blockNum) - require.NoError(err) - require.Equal(reporterTokens, math.ZeroInt()) - selectorTokens, err := k.ReportersWithDelegatorsVotedBefore.Get(ctx, collections.Join(selector.Bytes(), id)) - require.NoError(err) - require.Equal(selectorTokens, math.NewInt(50*1e6)) - - // delegation found, ReportersWithDelegatorsBefore set (selector has voted), voter is selector, no error with GetDelegatorTokensAtBlock, selctor has voted already - rk.On("Delegation", ctx, selector).Return(reportertypes.Selection{ - Reporter: reporter, - }, nil).Once() - require.NoError(k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(selector.Bytes(), id), math.NewInt(50*1e6))) - rk.On("GetDelegatorTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(60*1e6), nil).Once() - reporterTokens, err = k.SetVoterReporterStake(ctx, id, selector, blockNum) - require.NoError(err) - require.Equal(reporterTokens, math.ZeroInt()) - selectorTokens, err = k.ReportersWithDelegatorsVotedBefore.Get(ctx, collections.Join(reporter.Bytes(), id)) - require.NoError(err) - require.Equal(selectorTokens, math.NewInt(160*1e6)) + testCases := []struct { + name string + voter sdk.AccAddress + setup func() + expectedError bool + expectedTokens math.Int + expectedVote types.StakeholderVoteCounts + teardown func() + }{ + { + name: "delegation not found, collections not found", + voter: reporter, + setup: func() { + rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{}, collections.ErrNotFound).Once() + }, + expectedError: false, + expectedTokens: math.ZeroInt(), + expectedVote: types.StakeholderVoteCounts{}, + }, + { + name: "delegation not found, not collections not found", + voter: reporter, + setup: func() { + rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{}, errors.New("error!")).Once() + }, + expectedError: true, + expectedTokens: math.Int{}, + expectedVote: types.StakeholderVoteCounts{}, + }, + { + name: "voter is reporter, error on GetReporterTokensAtBlock", + voter: reporter, + setup: func() { + rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{ + Reporter: reporter, + }, nil).Once() + rk.On("GetReporterTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.Int{}, errors.New("error!")).Once() + }, + expectedError: true, + expectedTokens: math.Int{}, + expectedVote: types.StakeholderVoteCounts{}, + }, + { + name: "voter is reporter, hasnt voted with any reporter tokens", + voter: reporter, + setup: func() { + rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{ + Reporter: reporter, + }, nil).Once() + // reporter has 100 tokens, hasnt voted with any of them + rk.On("GetReporterTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(100), nil).Once() + }, + expectedError: false, + expectedTokens: math.NewInt(100), + expectedVote: types.StakeholderVoteCounts{ + Reporters: types.VoteCounts{ + Support: 100, + Against: 0, + Invalid: 0, + }, + }, + teardown: func() { + require.NoError(k.VoteCountsByGroup.Remove(ctx, disputeId)) + }, + }, + { + name: "voter is reporter, has voted with some reporter tokens", + voter: reporter, + setup: func() { + rk.On("Delegation", ctx, reporter).Return(reportertypes.Selection{ + Reporter: reporter, + }, nil).Once() + // reporter has 100 tokens, has voted with 50 of them + rk.On("GetReporterTokensAtBlock", ctx, reporter.Bytes(), blockNum).Return(math.NewInt(100), nil).Once() + require.NoError(k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(reporter.Bytes(), disputeId), math.NewInt(50))) + }, + expectedError: false, + expectedTokens: math.NewInt(50), + expectedVote: types.StakeholderVoteCounts{ + Reporters: types.VoteCounts{ + Support: 50, + Against: 0, + Invalid: 0, + }, + }, + teardown: func() { + require.NoError(k.ReportersWithDelegatorsVotedBefore.Remove(ctx, collections.Join(reporter.Bytes(), disputeId))) + require.NoError(k.VoteCountsByGroup.Remove(ctx, disputeId)) + }, + }, + { + name: "voter is selector, reporter has not voted", + voter: selector, + setup: func() { + rk.On("Delegation", ctx, selector).Return(reportertypes.Selection{ + Reporter: reporter, + }, nil).Once() + // selector has 100 selected to reporter + rk.On("GetDelegatorTokensAtBlock", ctx, selector.Bytes(), blockNum).Return(math.NewInt(100), nil).Once() + }, + expectedError: false, + expectedTokens: math.NewInt(100), + expectedVote: types.StakeholderVoteCounts{ + Reporters: types.VoteCounts{ + Support: 100, + Against: 0, + Invalid: 0, + }, + }, + teardown: func() { + require.NoError(k.VoteCountsByGroup.Remove(ctx, disputeId)) + require.NoError(k.ReportersWithDelegatorsVotedBefore.Remove(ctx, collections.Join(reporter.Bytes(), disputeId))) + }, + }, + { + name: "voter is selector, reporter has voted", + voter: selector, + setup: func() { + rk.On("Delegation", ctx, selector).Return(reportertypes.Selection{ + Reporter: reporter, + }, nil).Once() + require.NoError(k.ReportersGroup.Set(ctx, collections.Join(disputeId, reporter.Bytes()), math.NewInt(50))) + // selector has 100 selected to reporter + rk.On("GetDelegatorTokensAtBlock", ctx, selector.Bytes(), blockNum).Return(math.NewInt(100), nil).Once() + // reporter has voted against with 150 + require.NoError(k.Voter.Set(ctx, collections.Join(disputeId, reporter.Bytes()), types.Voter{ + Vote: types.VoteEnum_VOTE_AGAINST, + VoterPower: math.NewInt(150), + })) + require.NoError(k.VoteCountsByGroup.Set(ctx, disputeId, types.StakeholderVoteCounts{ + Reporters: types.VoteCounts{ + Against: 150, + }, + })) + require.NoError(k.ReportersWithDelegatorsVotedBefore.Set(ctx, collections.Join(reporter.Bytes(), disputeId), math.NewInt(50))) + }, + expectedError: false, + expectedTokens: math.NewInt(100), + expectedVote: types.StakeholderVoteCounts{ + Reporters: types.VoteCounts{ + Support: 100, + Against: 50, + Invalid: 0, + }, + }, + teardown: func() { + require.NoError(k.ReportersWithDelegatorsVotedBefore.Remove(ctx, collections.Join(reporter.Bytes(), disputeId))) + require.NoError(k.VoteCountsByGroup.Remove(ctx, disputeId)) + }, + }, + } + for _, tc := range testCases { + if tc.setup != nil { + s.Run(tc.name, tc.setup) + } + tokensVoted, err := k.SetVoterReporterStake(ctx, disputeId, tc.voter, blockNum, types.VoteEnum_VOTE_SUPPORT) + if tc.expectedError { + require.Error(err) + } else { + require.NoError(err) + } + require.Equal(tc.expectedTokens, tokensVoted) + if tc.expectedVote != (types.StakeholderVoteCounts{}) { + votesByGroup, err := k.VoteCountsByGroup.Get(ctx, disputeId) + fmt.Println("votesByGroup", votesByGroup) + require.Equal(tc.expectedVote, votesByGroup) + require.NoError(err) + } + if tc.teardown != nil { + s.Run(tc.name, tc.teardown) + } + } } -func (s *KeeperTestSuite) TestUpdateDispute() { +func (s *KeeperTestSuite) TestSetTokenholderVote() { + require := s.Require() k := s.disputeKeeper + bk := s.bankKeeper + rk := s.reporterKeeper ctx := s.ctx - require := s.Require() - require.NotNil(k) - require.NotNil(ctx) - id := uint64(1) - dispute := types.Dispute{ - HashId: []byte("hashId"), - DisputeId: id, - DisputeCategory: types.Minor, + ctx = ctx.WithBlockHeight(10) + + disputeId := uint64(1) + blockNum := uint64(10) + tokenHolder := sample.AccAddressBytes() + // reporter := sample.AccAddressBytes() + + testCases := []struct { + name string + voter sdk.AccAddress + setup func() + expectedError bool + expectedTokens math.Int + expectedVote types.StakeholderVoteCounts + teardown func() + }{ + { + name: "err from GetDelegatorTokensAtBlock ", + voter: tokenHolder, + setup: func() { + // 100 free floating + bk.On("GetBalance", ctx, tokenHolder, layertypes.BondDenom).Return(sdk.Coin{ + Denom: layertypes.BondDenom, + Amount: math.NewInt(100), + }, nil).Once() + rk.On("GetDelegatorTokensAtBlock", ctx, tokenHolder.Bytes(), blockNum).Return(math.Int{}, errors.New("error!")).Once() + }, + expectedError: true, + expectedTokens: math.Int{}, + expectedVote: types.StakeholderVoteCounts{}, + teardown: nil, + }, + { + name: "err from VoteCountsByGroup", + voter: tokenHolder, + setup: func() { + // 100 free floating + bk.On("GetBalance", ctx, tokenHolder, layertypes.BondDenom).Return(sdk.Coin{ + Denom: layertypes.BondDenom, + Amount: math.NewInt(100), + }, nil).Once() + rk.On("GetDelegatorTokensAtBlock", ctx, tokenHolder.Bytes(), blockNum).Return(math.ZeroInt(), errors.New("error!")).Once() + }, + expectedError: true, + expectedTokens: math.Int{}, + expectedVote: types.StakeholderVoteCounts{}, + teardown: nil, + }, + { + name: "no delegated token, vote success", + voter: tokenHolder, + setup: func() { + // 200 free floating, 0 delegated, 0 selected + bk.On("GetBalance", ctx, tokenHolder, layertypes.BondDenom).Return(sdk.Coin{ + Denom: layertypes.BondDenom, + Amount: math.NewInt(200), + }, nil).Once() + rk.On("GetDelegatorTokensAtBlock", ctx, tokenHolder.Bytes(), blockNum).Return(math.ZeroInt(), nil).Once() + }, + expectedError: false, + expectedTokens: math.NewInt(200), + expectedVote: types.StakeholderVoteCounts{ + Tokenholders: types.VoteCounts{ + Support: 200, + }, + }, + teardown: func() { + require.NoError(k.VoteCountsByGroup.Remove(ctx, disputeId)) + }, + }, + { + name: "delegated token, vote success", + voter: tokenHolder, + setup: func() { + // 200 free floating, 100 delegated, 10 selected + bk.On("GetBalance", ctx, tokenHolder, layertypes.BondDenom).Return(sdk.Coin{ + Denom: layertypes.BondDenom, + Amount: math.NewInt(200), + }, nil).Once() + rk.On("GetDelegatorTokensAtBlock", ctx, tokenHolder.Bytes(), blockNum).Return(math.NewInt(100), nil).Once() + }, + expectedError: false, + expectedTokens: math.NewInt(300), + expectedVote: types.StakeholderVoteCounts{ + Tokenholders: types.VoteCounts{ + Support: 300, + }, + }, + teardown: func() { + require.NoError(k.VoteCountsByGroup.Remove(ctx, disputeId)) + }, + }, } - - // quorum support - vote := types.Vote{ - Id: id, - VoteResult: types.VoteResult_SUPPORT, + for _, tc := range testCases { + if tc.setup != nil { + tc.setup() + } + tokensVoted, err := k.SetTokenholderVote(ctx, disputeId, tc.voter, blockNum, types.VoteEnum_VOTE_SUPPORT) + if tc.expectedError { + require.Error(err) + } else { + require.NoError(err) + } + require.Equal(tokensVoted, tc.expectedTokens) + if tc.expectedVote != (types.StakeholderVoteCounts{}) { + votesByGroup, err := k.VoteCountsByGroup.Get(ctx, disputeId) + require.Equal(votesByGroup, tc.expectedVote) + require.NoError(err) + } + if tc.teardown != nil { + tc.teardown() + } } - scaledSupport := math.LegacyNewDec(100) - scaledAgainst := math.LegacyNewDec(0) - scaledInvalid := math.LegacyNewDec(0) +} - require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, true)) - disputeRes, err := k.Disputes.Get(ctx, id) - require.NoError(err) - require.Equal(disputeRes.DisputeId, dispute.DisputeId) - require.Equal(disputeRes.HashId, dispute.HashId) - require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) - voteRes, err := k.Votes.Get(ctx, id) - require.NoError(err) - require.Equal(voteRes.Id, vote.Id) - require.Equal(voteRes.VoteResult, vote.VoteResult) +func (s *KeeperTestSuite) TestAddAndSubtractReporterVoteCount() { + require := s.Require() + k := s.disputeKeeper + ctx := s.ctx - // no quorum majority support - vote = types.Vote{ - Id: id, - VoteResult: types.VoteResult_NO_QUORUM_MAJORITY_SUPPORT, - } - scaledSupport = math.LegacyNewDec(50) - scaledAgainst = math.LegacyNewDec(0) - scaledInvalid = math.LegacyNewDec(0) + ctx = ctx.WithBlockHeight(10) + ctx = ctx.WithBlockTime(time.Now()) + disputeId := uint64(1) - require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, false)) - disputeRes, err = k.Disputes.Get(ctx, id) + // add 100 support + err := k.AddReporterVoteCount(ctx, disputeId, 100, types.VoteEnum_VOTE_SUPPORT) require.NoError(err) - require.Equal(disputeRes.DisputeId, dispute.DisputeId) - require.Equal(disputeRes.HashId, dispute.HashId) - require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) - voteRes, err = k.Votes.Get(ctx, id) + votesByGroup, err := k.VoteCountsByGroup.Get(ctx, disputeId) require.NoError(err) - require.Equal(voteRes.Id, vote.Id) - require.Equal(voteRes.VoteResult, vote.VoteResult) - - // quorum against - vote = types.Vote{ - Id: id, - VoteResult: types.VoteResult_AGAINST, - } - scaledSupport = math.LegacyNewDec(0) - scaledAgainst = math.LegacyNewDec(100) - scaledInvalid = math.LegacyNewDec(0) + require.Equal(votesByGroup.Reporters.Support, uint64(100)) - require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, true)) - disputeRes, err = k.Disputes.Get(ctx, id) + err = k.SubtractReporterVoteCount(ctx, disputeId, 100, types.VoteEnum_VOTE_SUPPORT) require.NoError(err) - require.Equal(disputeRes.DisputeId, dispute.DisputeId) - require.Equal(disputeRes.HashId, dispute.HashId) - require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) - voteRes, err = k.Votes.Get(ctx, id) + votesByGroup, err = k.VoteCountsByGroup.Get(ctx, disputeId) require.NoError(err) - require.Equal(voteRes.Id, vote.Id) - require.Equal(voteRes.VoteResult, vote.VoteResult) + require.Equal(votesByGroup.Reporters.Support, uint64(0)) - // no quorum majority against - vote = types.Vote{ - Id: id, - VoteResult: types.VoteResult_NO_QUORUM_MAJORITY_AGAINST, - } - scaledSupport = math.LegacyNewDec(0) - scaledAgainst = math.LegacyNewDec(40) - scaledInvalid = math.LegacyNewDec(0) - - require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, false)) - disputeRes, err = k.Disputes.Get(ctx, id) + err = k.AddReporterVoteCount(ctx, disputeId, 100, types.VoteEnum_VOTE_AGAINST) require.NoError(err) - require.Equal(disputeRes.DisputeId, dispute.DisputeId) - require.Equal(disputeRes.HashId, dispute.HashId) - require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) - voteRes, err = k.Votes.Get(ctx, id) + votesByGroup, err = k.VoteCountsByGroup.Get(ctx, disputeId) require.NoError(err) - require.Equal(voteRes.Id, vote.Id) - require.Equal(voteRes.VoteResult, vote.VoteResult) - - // quorum invalid - vote = types.Vote{ - Id: id, - VoteResult: types.VoteResult_INVALID, - } - scaledSupport = math.LegacyNewDec(0) - scaledAgainst = math.LegacyNewDec(0) - scaledInvalid = math.LegacyNewDec(51) + require.Equal(votesByGroup.Reporters.Against, uint64(100)) - require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, true)) - disputeRes, err = k.Disputes.Get(ctx, id) + err = k.SubtractReporterVoteCount(ctx, disputeId, 100, types.VoteEnum_VOTE_AGAINST) require.NoError(err) - require.Equal(disputeRes.DisputeId, dispute.DisputeId) - require.Equal(disputeRes.HashId, dispute.HashId) - require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) - voteRes, err = k.Votes.Get(ctx, id) + votesByGroup, err = k.VoteCountsByGroup.Get(ctx, disputeId) require.NoError(err) - require.Equal(voteRes.Id, vote.Id) - require.Equal(voteRes.VoteResult, vote.VoteResult) + require.Equal(votesByGroup.Reporters.Against, uint64(0)) - // no quorum majority invalid - vote = types.Vote{ - Id: id, - VoteResult: types.VoteResult_NO_QUORUM_MAJORITY_INVALID, - } - scaledSupport = math.LegacyNewDec(0) - scaledAgainst = math.LegacyNewDec(0) - scaledInvalid = math.LegacyNewDec(49) + err = k.AddReporterVoteCount(ctx, disputeId, 100, types.VoteEnum_VOTE_INVALID) + require.NoError(err) + votesByGroup, err = k.VoteCountsByGroup.Get(ctx, disputeId) + require.NoError(err) + require.Equal(votesByGroup.Reporters.Invalid, uint64(100)) - require.NoError(k.UpdateDispute(ctx, id, dispute, vote, scaledSupport, scaledAgainst, scaledInvalid, false)) - disputeRes, err = k.Disputes.Get(ctx, id) + err = k.SubtractReporterVoteCount(ctx, disputeId, 100, types.VoteEnum_VOTE_INVALID) require.NoError(err) - require.Equal(disputeRes.DisputeId, dispute.DisputeId) - require.Equal(disputeRes.HashId, dispute.HashId) - require.Equal(disputeRes.DisputeCategory, dispute.DisputeCategory) - voteRes, err = k.Votes.Get(ctx, id) + votesByGroup, err = k.VoteCountsByGroup.Get(ctx, disputeId) require.NoError(err) - require.Equal(voteRes.Id, vote.Id) - require.Equal(voteRes.VoteResult, vote.VoteResult) + require.Equal(votesByGroup.Reporters.Invalid, uint64(0)) } diff --git a/x/dispute/types/codec.go b/x/dispute/types/codec.go index e3d3712ee..43ec101bf 100644 --- a/x/dispute/types/codec.go +++ b/x/dispute/types/codec.go @@ -11,9 +11,8 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgProposeDispute{}, "dispute/ProposeDispute", nil) cdc.RegisterConcrete(&MsgAddFeeToDispute{}, "dispute/AddFeeToDispute", nil) cdc.RegisterConcrete(&MsgVote{}, "dispute/Vote", nil) - cdc.RegisterConcrete(&MsgTallyVote{}, "dispute/TallyVote", nil) - cdc.RegisterConcrete(&MsgExecuteDispute{}, "dispute/ExecuteDispute", nil) cdc.RegisterConcrete(&MsgWithdrawFeeRefund{}, "dispute/WithdrawFeeRefund", nil) + cdc.RegisterConcrete(&MsgClaimReward{}, "dispute/ClaimReward", nil) // this line is used by starport scaffolding # 2 } @@ -23,9 +22,8 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgAddFeeToDispute{}, &MsgVote{}, &MsgUpdateTeam{}, - &MsgTallyVote{}, - &MsgExecuteDispute{}, &MsgWithdrawFeeRefund{}, + &MsgClaimReward{}, ) // this line is used by starport scaffolding # 3 diff --git a/x/dispute/types/dispute.pb.go b/x/dispute/types/dispute.pb.go index 5682b76c5..36b6bb52a 100644 --- a/x/dispute/types/dispute.pb.go +++ b/x/dispute/types/dispute.pb.go @@ -142,6 +142,11 @@ type Dispute struct { BlockNumber uint64 `protobuf:"varint,15,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` Open bool `protobuf:"varint,16,opt,name=open,proto3" json:"open,omitempty"` AdditionalEvidence []*types.MicroReport `protobuf:"bytes,17,rep,name=additional_evidence,json=additionalEvidence,proto3" json:"additional_evidence,omitempty"` + // total tokens allocated to voters + VoterReward cosmossdk_io_math.Int `protobuf:"bytes,18,opt,name=voter_reward,json=voterReward,proto3,customtype=cosmossdk.io/math.Int" json:"voter_reward"` + // pending execution is true if the dispute has reached quorum and is pending execution. + // however, if a new dispute round begins, this is set to false again + PendingExecution bool `protobuf:"varint,19,opt,name=pending_execution,json=pendingExecution,proto3" json:"pending_execution,omitempty"` } func (m *Dispute) Reset() { *m = Dispute{} } @@ -268,6 +273,13 @@ func (m *Dispute) GetAdditionalEvidence() []*types.MicroReport { return nil } +func (m *Dispute) GetPendingExecution() bool { + if m != nil { + return m.PendingExecution + } + return false +} + // PayerInfo defines the payer info of a dispute // fee payer's info that was involved in paying the dispute fee in order to start the dispute type PayerInfo struct { @@ -368,69 +380,72 @@ func init() { func init() { proto.RegisterFile("layer/dispute/dispute.proto", fileDescriptor_2a5d4b70d69c78b5) } var fileDescriptor_2a5d4b70d69c78b5 = []byte{ - // 991 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x4d, 0x6e, 0xdb, 0x46, - 0x14, 0x16, 0x63, 0xc5, 0x96, 0x46, 0xb2, 0xc5, 0x4c, 0x92, 0x86, 0x56, 0x52, 0x99, 0x75, 0x11, - 0x54, 0x71, 0x61, 0x12, 0x4e, 0x4f, 0x20, 0x59, 0x74, 0x4a, 0xc3, 0x96, 0x84, 0x91, 0xe4, 0xa0, - 0x05, 0x0a, 0x82, 0x12, 0x47, 0xf2, 0x34, 0xe4, 0x0c, 0x31, 0x1c, 0xb9, 0xf5, 0x0d, 0x0a, 0xad, - 0x72, 0x01, 0xad, 0x7a, 0x85, 0xee, 0xbb, 0xe8, 0x26, 0xcb, 0xa0, 0xab, 0xa2, 0x8b, 0xb4, 0xb0, - 0x81, 0xde, 0xa1, 0xbb, 0x82, 0x43, 0x32, 0xf2, 0x4f, 0x50, 0x40, 0x59, 0x91, 0xf3, 0xde, 0xf7, - 0xbe, 0xf9, 0xde, 0xfb, 0x86, 0x43, 0xf0, 0xd8, 0x77, 0xcf, 0x31, 0x37, 0x3d, 0x12, 0x85, 0x53, - 0x81, 0xb3, 0xa7, 0x11, 0x72, 0x26, 0x18, 0x5c, 0x97, 0x49, 0x23, 0x0d, 0x56, 0x6b, 0x23, 0x16, - 0x05, 0x2c, 0x32, 0x87, 0x6e, 0x84, 0xcd, 0xb3, 0xbd, 0x21, 0x16, 0xee, 0x9e, 0x39, 0x62, 0x84, - 0x26, 0xf0, 0xea, 0x66, 0x92, 0x77, 0xe4, 0xca, 0x4c, 0x16, 0x69, 0xea, 0xc1, 0x84, 0x4d, 0x58, - 0x12, 0x8f, 0xdf, 0xd2, 0xe8, 0xd6, 0x84, 0xb1, 0x89, 0x8f, 0x4d, 0xb9, 0x1a, 0x4e, 0xc7, 0xa6, - 0x20, 0x01, 0x8e, 0x84, 0x1b, 0x84, 0x19, 0x20, 0x51, 0xc7, 0xb8, 0x3b, 0xf2, 0xb1, 0x19, 0x90, - 0x11, 0x67, 0x0e, 0xc7, 0x21, 0xe3, 0x22, 0x01, 0x6c, 0xff, 0xbb, 0x06, 0xd6, 0x5a, 0x89, 0x3c, - 0xf8, 0x08, 0xac, 0x9d, 0xba, 0xd1, 0xa9, 0x43, 0x3c, 0x4d, 0xd1, 0x95, 0x7a, 0x19, 0xad, 0xc6, - 0x4b, 0xdb, 0x83, 0x9f, 0x02, 0x90, 0xb6, 0x10, 0xe7, 0xee, 0xe8, 0x4a, 0x3d, 0x8f, 0x8a, 0x69, - 0xc4, 0xf6, 0xa0, 0x0d, 0xd4, 0x2c, 0x3d, 0x72, 0x05, 0x9e, 0x30, 0x7e, 0xae, 0xad, 0xe8, 0x4a, - 0x7d, 0xe3, 0x79, 0xcd, 0xb8, 0x36, 0x00, 0x23, 0xdd, 0x69, 0x3f, 0x45, 0xa1, 0x8a, 0x77, 0x3d, - 0x00, 0x8f, 0x40, 0x29, 0xa3, 0x1a, 0x63, 0xac, 0xe5, 0x75, 0xa5, 0x5e, 0x6c, 0x7e, 0xf9, 0xe6, - 0xdd, 0x56, 0xee, 0xcf, 0x77, 0x5b, 0x0f, 0x93, 0x89, 0x44, 0xde, 0x2b, 0x83, 0x30, 0x33, 0x70, - 0xc5, 0xa9, 0x61, 0x53, 0xf1, 0xfb, 0x2f, 0xbb, 0x20, 0x1d, 0x95, 0x4d, 0x05, 0xca, 0x94, 0x1e, - 0x60, 0x0c, 0xf7, 0xc1, 0x46, 0xc6, 0x16, 0x09, 0x57, 0x4c, 0x23, 0xed, 0xae, 0x94, 0xf5, 0xe4, - 0xc3, 0xb2, 0x7a, 0x12, 0x83, 0xd6, 0xbd, 0xab, 0x4b, 0x88, 0x00, 0xbc, 0x42, 0xc2, 0x85, 0x13, - 0xcf, 0x58, 0x5b, 0xd5, 0x95, 0x7a, 0xe9, 0x79, 0xd5, 0x48, 0x0c, 0x30, 0x32, 0x03, 0x8c, 0x7e, - 0x66, 0x40, 0xb3, 0x10, 0xab, 0x7e, 0xfd, 0xd7, 0x96, 0x82, 0xd4, 0x05, 0x21, 0x17, 0x31, 0x00, - 0xb6, 0x17, 0x13, 0xc3, 0xd4, 0x4b, 0x18, 0xd7, 0x96, 0x60, 0xcc, 0xda, 0xb2, 0xa8, 0x27, 0xf9, - 0x0c, 0x70, 0xff, 0xba, 0xc6, 0xa1, 0xcf, 0x46, 0xaf, 0xb4, 0x82, 0x74, 0xea, 0xde, 0xd5, 0xed, - 0x9b, 0x71, 0x02, 0x7e, 0x0e, 0xb2, 0x26, 0x1d, 0xce, 0xa6, 0xd4, 0xd3, 0x8a, 0x12, 0x59, 0x4e, - 0x83, 0x28, 0x8e, 0xc1, 0x36, 0x28, 0x47, 0x7e, 0x7c, 0x1e, 0xdc, 0x80, 0x4d, 0xa9, 0xd0, 0xc0, - 0xf2, 0x66, 0x94, 0x24, 0x41, 0x43, 0xd6, 0xc7, 0xde, 0x0e, 0xa7, 0x9c, 0x66, 0x74, 0xa5, 0x8f, - 0xf0, 0x36, 0xae, 0x4f, 0xd9, 0x0e, 0x81, 0x4a, 0x28, 0x11, 0xc4, 0xf5, 0x1d, 0x7c, 0x46, 0x3c, - 0x4c, 0x47, 0x58, 0x2b, 0xcb, 0x11, 0x6e, 0xa6, 0xee, 0x26, 0x87, 0xde, 0x38, 0x8e, 0x0f, 0x3d, - 0x92, 0x67, 0xbe, 0x99, 0x8f, 0x77, 0x43, 0x95, 0xb4, 0xd0, 0x4a, 0xeb, 0xe0, 0xd7, 0xa0, 0x38, - 0xc6, 0xd8, 0x11, 0x4c, 0xb8, 0xbe, 0xb6, 0xbe, 0xbc, 0xae, 0xc2, 0x18, 0xe3, 0x7e, 0x5c, 0x0c, - 0xeb, 0x40, 0x0d, 0x39, 0x3e, 0x73, 0x16, 0x9f, 0x4b, 0xa4, 0x6d, 0xe8, 0x2b, 0xf5, 0x3c, 0xda, - 0x88, 0xe3, 0xad, 0xec, 0x9b, 0x89, 0xe0, 0x67, 0xa0, 0x2c, 0x4d, 0x72, 0xe8, 0x34, 0x18, 0x62, - 0xae, 0x55, 0xa4, 0x03, 0x25, 0x19, 0x6b, 0xcb, 0x10, 0x84, 0x20, 0xcf, 0x42, 0x4c, 0x35, 0x55, - 0x57, 0xea, 0x05, 0x24, 0xdf, 0xe1, 0x21, 0xb8, 0xef, 0x7a, 0x1e, 0x11, 0x84, 0xd1, 0xab, 0x9d, - 0xdf, 0xd3, 0x57, 0xfe, 0xb7, 0x73, 0x04, 0x17, 0x55, 0x59, 0xdb, 0xdb, 0x01, 0x28, 0x76, 0x63, - 0xbc, 0x4d, 0xc7, 0x0c, 0xee, 0x83, 0xd5, 0xd4, 0x18, 0x65, 0xf9, 0x01, 0xa4, 0xa5, 0xf0, 0x31, - 0x28, 0x8e, 0x39, 0x0b, 0x9c, 0x21, 0xa3, 0xc9, 0x3d, 0x51, 0x40, 0x85, 0x38, 0xd0, 0x64, 0xd4, - 0xdb, 0xfe, 0x55, 0x01, 0x45, 0x79, 0xfc, 0xe4, 0x7e, 0xdf, 0x81, 0x07, 0x72, 0xde, 0xe9, 0x75, - 0x84, 0xb9, 0x13, 0xb2, 0x1f, 0x30, 0xff, 0x98, 0xdd, 0xa1, 0x24, 0x42, 0x29, 0x4f, 0x37, 0xa6, - 0x81, 0x3d, 0x50, 0x49, 0xe8, 0xa7, 0x11, 0xe6, 0x8e, 0x20, 0x61, 0x24, 0xf5, 0x2c, 0xc9, 0xbc, - 0x2e, 0x39, 0x06, 0x11, 0xe6, 0x7d, 0x12, 0x46, 0x3b, 0xbf, 0x29, 0xa0, 0x72, 0xe3, 0x0a, 0x83, - 0x7b, 0xe0, 0x49, 0xcb, 0xee, 0x75, 0x07, 0x7d, 0xcb, 0xd9, 0x6f, 0xf4, 0xad, 0x17, 0x1d, 0xf4, - 0x8d, 0x33, 0x68, 0xf7, 0xba, 0xd6, 0xbe, 0x7d, 0x60, 0x5b, 0x2d, 0x35, 0x57, 0xad, 0xcc, 0xe6, - 0x7a, 0x69, 0x40, 0xa3, 0x10, 0x8f, 0xc8, 0x98, 0x60, 0x0f, 0x3e, 0x03, 0xda, 0xad, 0x92, 0x97, - 0x0d, 0xd4, 0xb6, 0xdb, 0x2f, 0x54, 0xa5, 0x5a, 0x9a, 0xcd, 0xf5, 0xb5, 0x97, 0x2e, 0xa7, 0x84, - 0x4e, 0xe0, 0x53, 0xf0, 0xc9, 0x2d, 0xe8, 0xb1, 0xdd, 0xee, 0x20, 0xf5, 0x4e, 0xb5, 0x38, 0x9b, - 0xeb, 0x77, 0x8f, 0x09, 0x65, 0xfc, 0xc3, 0xb0, 0xc6, 0x61, 0x07, 0xa9, 0x2b, 0x29, 0xcc, 0xfd, - 0x9e, 0xf1, 0x6a, 0xfe, 0xa7, 0x9f, 0x6b, 0xb9, 0x9d, 0x7f, 0x14, 0xb0, 0x7e, 0xed, 0xc6, 0x83, - 0x5f, 0x2c, 0xca, 0x7b, 0xfd, 0x46, 0x7f, 0xd0, 0x73, 0xba, 0xc8, 0x3a, 0xe9, 0xf4, 0x2d, 0x35, - 0x97, 0xc8, 0xe9, 0x72, 0x7c, 0xc6, 0x04, 0x86, 0x4f, 0xc1, 0xc3, 0x1b, 0xc0, 0x93, 0x4e, 0x3f, - 0x91, 0x0d, 0x66, 0x73, 0x7d, 0xf5, 0x84, 0x89, 0x58, 0xf5, 0x33, 0xf0, 0xe8, 0x06, 0x0c, 0x59, - 0xbd, 0xce, 0xd1, 0x89, 0xd5, 0x52, 0xef, 0x54, 0xcb, 0xb3, 0xb9, 0x5e, 0x40, 0x38, 0x62, 0xfe, - 0x19, 0xf6, 0xe0, 0x2e, 0xd8, 0xbc, 0x01, 0x1d, 0xb4, 0xdf, 0x83, 0x57, 0xaa, 0x1b, 0xb3, 0xb9, - 0x0e, 0x06, 0x94, 0x67, 0xf0, 0xdb, 0x02, 0x0e, 0x1a, 0xf6, 0x91, 0xd5, 0x52, 0xf3, 0x89, 0x80, - 0x03, 0x97, 0xf8, 0xd8, 0x4b, 0x1a, 0x6d, 0xb6, 0xde, 0x5c, 0xd4, 0x94, 0xb7, 0x17, 0x35, 0xe5, - 0xef, 0x8b, 0x9a, 0xf2, 0xfa, 0xb2, 0x96, 0x7b, 0x7b, 0x59, 0xcb, 0xfd, 0x71, 0x59, 0xcb, 0x7d, - 0xbb, 0x33, 0x21, 0xe2, 0x74, 0x3a, 0x34, 0x46, 0x2c, 0x30, 0x05, 0xf6, 0x7d, 0xc6, 0x77, 0x09, - 0x33, 0x93, 0x7f, 0xe5, 0x8f, 0xef, 0xff, 0xe5, 0xe2, 0x3c, 0xc4, 0xd1, 0x70, 0x55, 0xde, 0xc4, - 0x5f, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x76, 0x7f, 0x38, 0xd2, 0xe9, 0x07, 0x00, 0x00, + // 1035 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x17, 0x15, 0x6d, 0xc5, 0x96, 0x46, 0xb2, 0x45, 0x8f, 0x93, 0x2f, 0xb4, 0x92, 0x4f, 0x66, 0x5d, + 0x04, 0x55, 0x1c, 0x98, 0x84, 0xd3, 0x27, 0x90, 0x2c, 0x3a, 0xa5, 0x61, 0x4b, 0xc2, 0x48, 0x72, + 0xd0, 0x02, 0x05, 0x41, 0x89, 0x23, 0x79, 0x1a, 0x6a, 0x86, 0x18, 0x8e, 0x9c, 0xf8, 0x0d, 0x0a, + 0xad, 0xf2, 0x02, 0x5a, 0xf5, 0x15, 0xba, 0xef, 0xa2, 0x9b, 0x2c, 0x83, 0xae, 0x8a, 0x2e, 0xd2, + 0xc2, 0x06, 0xfa, 0x08, 0x5d, 0x17, 0x1c, 0x92, 0xfe, 0x0d, 0x0a, 0xc8, 0x2b, 0x71, 0xee, 0x3d, + 0xf7, 0xcc, 0xb9, 0x73, 0x2e, 0x87, 0x02, 0x4f, 0x7c, 0xf7, 0x0c, 0x73, 0xd3, 0x23, 0x61, 0x30, + 0x11, 0x38, 0xfd, 0x35, 0x02, 0xce, 0x04, 0x83, 0x2b, 0x32, 0x69, 0x24, 0xc1, 0x72, 0x65, 0xc0, + 0xc2, 0x31, 0x0b, 0xcd, 0xbe, 0x1b, 0x62, 0xf3, 0x74, 0xb7, 0x8f, 0x85, 0xbb, 0x6b, 0x0e, 0x18, + 0xa1, 0x31, 0xbc, 0xbc, 0x11, 0xe7, 0x1d, 0xb9, 0x32, 0xe3, 0x45, 0x92, 0x7a, 0x38, 0x62, 0x23, + 0x16, 0xc7, 0xa3, 0xa7, 0x24, 0xba, 0x39, 0x62, 0x6c, 0xe4, 0x63, 0x53, 0xae, 0xfa, 0x93, 0xa1, + 0x29, 0xc8, 0x18, 0x87, 0xc2, 0x1d, 0x07, 0x29, 0x20, 0x56, 0xc7, 0xb8, 0x3b, 0xf0, 0xb1, 0x39, + 0x26, 0x03, 0xce, 0x1c, 0x8e, 0x03, 0xc6, 0x45, 0x0c, 0xd8, 0xfa, 0x27, 0x07, 0x96, 0x1b, 0xb1, + 0x3c, 0xf8, 0x18, 0x2c, 0x9f, 0xb8, 0xe1, 0x89, 0x43, 0x3c, 0x4d, 0xd1, 0x95, 0x6a, 0x11, 0x2d, + 0x45, 0x4b, 0xdb, 0x83, 0xff, 0x07, 0x20, 0x69, 0x21, 0xca, 0x2d, 0xe8, 0x4a, 0x35, 0x8b, 0xf2, + 0x49, 0xc4, 0xf6, 0xa0, 0x0d, 0xd4, 0x34, 0x3d, 0x70, 0x05, 0x1e, 0x31, 0x7e, 0xa6, 0x2d, 0xea, + 0x4a, 0x75, 0xf5, 0x65, 0xc5, 0xb8, 0x71, 0x00, 0x46, 0xb2, 0xd3, 0x5e, 0x82, 0x42, 0x25, 0xef, + 0x66, 0x00, 0x1e, 0x82, 0x42, 0x4a, 0x35, 0xc4, 0x58, 0xcb, 0xea, 0x4a, 0x35, 0x5f, 0x7f, 0xf1, + 0xe1, 0xd3, 0x66, 0xe6, 0x8f, 0x4f, 0x9b, 0x8f, 0xe2, 0x13, 0x09, 0xbd, 0x37, 0x06, 0x61, 0xe6, + 0xd8, 0x15, 0x27, 0x86, 0x4d, 0xc5, 0x6f, 0x3f, 0xef, 0x80, 0xe4, 0xa8, 0x6c, 0x2a, 0x50, 0xaa, + 0x74, 0x1f, 0x63, 0xb8, 0x07, 0x56, 0x53, 0xb6, 0x50, 0xb8, 0x62, 0x12, 0x6a, 0x0f, 0xa4, 0xac, + 0xa7, 0x9f, 0x97, 0xd5, 0x91, 0x18, 0xb4, 0xe2, 0x5d, 0x5f, 0x42, 0x04, 0xe0, 0x35, 0x12, 0x2e, + 0x9c, 0xe8, 0x8c, 0xb5, 0x25, 0x5d, 0xa9, 0x16, 0x5e, 0x96, 0x8d, 0xd8, 0x00, 0x23, 0x35, 0xc0, + 0xe8, 0xa6, 0x06, 0xd4, 0x73, 0x91, 0xea, 0xf7, 0x7f, 0x6e, 0x2a, 0x48, 0xbd, 0x22, 0xe4, 0x22, + 0x02, 0xc0, 0xe6, 0xd5, 0x89, 0x61, 0xea, 0xc5, 0x8c, 0xcb, 0x73, 0x30, 0xa6, 0x6d, 0x59, 0xd4, + 0x93, 0x7c, 0x06, 0x58, 0xbf, 0xa9, 0xb1, 0xef, 0xb3, 0xc1, 0x1b, 0x2d, 0x27, 0x9d, 0x5a, 0xbb, + 0xbe, 0x7d, 0x3d, 0x4a, 0xc0, 0x2f, 0x41, 0xda, 0xa4, 0xc3, 0xd9, 0x84, 0x7a, 0x5a, 0x5e, 0x22, + 0x8b, 0x49, 0x10, 0x45, 0x31, 0xd8, 0x04, 0xc5, 0xd0, 0x8f, 0xe6, 0xc1, 0x1d, 0xb3, 0x09, 0x15, + 0x1a, 0x98, 0xdf, 0x8c, 0x82, 0x24, 0xa8, 0xc9, 0xfa, 0xc8, 0xdb, 0xfe, 0x84, 0xd3, 0x94, 0xae, + 0x70, 0x0f, 0x6f, 0xa3, 0xfa, 0x84, 0xed, 0x00, 0xa8, 0x84, 0x12, 0x41, 0x5c, 0xdf, 0xc1, 0xa7, + 0xc4, 0xc3, 0x74, 0x80, 0xb5, 0xa2, 0x3c, 0xc2, 0x8d, 0xc4, 0xdd, 0x78, 0xe8, 0x8d, 0xa3, 0x68, + 0xe8, 0x91, 0x9c, 0xf9, 0x7a, 0x36, 0xda, 0x0d, 0x95, 0x92, 0x42, 0x2b, 0xa9, 0x83, 0xdf, 0x80, + 0xfc, 0x10, 0x63, 0x47, 0x30, 0xe1, 0xfa, 0xda, 0xca, 0xfc, 0xba, 0x72, 0x43, 0x8c, 0xbb, 0x51, + 0x31, 0xac, 0x02, 0x35, 0xe0, 0xf8, 0xd4, 0xb9, 0x7a, 0x5d, 0x42, 0x6d, 0x55, 0x5f, 0xac, 0x66, + 0xd1, 0x6a, 0x14, 0x6f, 0xa4, 0xef, 0x4c, 0x08, 0xbf, 0x00, 0x45, 0x69, 0x92, 0x43, 0x27, 0xe3, + 0x3e, 0xe6, 0x5a, 0x49, 0x3a, 0x50, 0x90, 0xb1, 0xa6, 0x0c, 0x41, 0x08, 0xb2, 0x2c, 0xc0, 0x54, + 0x53, 0x75, 0xa5, 0x9a, 0x43, 0xf2, 0x19, 0x1e, 0x80, 0x75, 0xd7, 0xf3, 0x88, 0x20, 0x8c, 0x5e, + 0xef, 0x7c, 0x4d, 0x5f, 0xfc, 0xcf, 0xce, 0x11, 0xbc, 0xaa, 0xba, 0x6c, 0xbb, 0x09, 0x8a, 0xa7, + 0x4c, 0x60, 0xee, 0x70, 0xfc, 0xd6, 0xe5, 0x9e, 0x06, 0xef, 0x61, 0xb0, 0x24, 0x40, 0xb2, 0x1e, + 0xbe, 0x00, 0x6b, 0x01, 0xa6, 0x1e, 0xa1, 0x23, 0x07, 0xbf, 0xc3, 0x83, 0x49, 0xb4, 0x9d, 0xb6, + 0x2e, 0xc5, 0xab, 0x49, 0xc2, 0x4a, 0xe3, 0x5b, 0x63, 0x90, 0x6f, 0x47, 0x62, 0x6d, 0x3a, 0x64, + 0x70, 0x0f, 0x2c, 0x25, 0x53, 0xa1, 0xcc, 0xaf, 0x21, 0x29, 0x85, 0x4f, 0x40, 0x7e, 0xc8, 0xd9, + 0xd8, 0xe9, 0x33, 0x1a, 0x5f, 0x52, 0x39, 0x94, 0x8b, 0x02, 0x75, 0x46, 0xbd, 0xad, 0x5f, 0x14, + 0x90, 0x97, 0xb3, 0x2f, 0xf7, 0xfb, 0x1e, 0x3c, 0x94, 0x66, 0x27, 0x77, 0x21, 0xe6, 0x4e, 0xc0, + 0xde, 0x62, 0x7e, 0x9f, 0xdd, 0xa1, 0x24, 0x42, 0x09, 0x4f, 0x3b, 0xa2, 0x81, 0x1d, 0x50, 0x8a, + 0xe9, 0x27, 0x21, 0xe6, 0x8e, 0x20, 0x41, 0x28, 0xf5, 0xcc, 0xc9, 0xbc, 0x22, 0x39, 0x7a, 0x21, + 0xe6, 0x5d, 0x12, 0x84, 0xdb, 0xbf, 0x2a, 0xa0, 0x74, 0xeb, 0xfe, 0x84, 0xbb, 0xe0, 0x69, 0xc3, + 0xee, 0xb4, 0x7b, 0x5d, 0xcb, 0xd9, 0xab, 0x75, 0xad, 0x57, 0x2d, 0xf4, 0xad, 0xd3, 0x6b, 0x76, + 0xda, 0xd6, 0x9e, 0xbd, 0x6f, 0x5b, 0x0d, 0x35, 0x53, 0x2e, 0x4d, 0x67, 0x7a, 0xa1, 0x47, 0xc3, + 0x00, 0x0f, 0xc8, 0x90, 0x60, 0x0f, 0x3e, 0x07, 0xda, 0x9d, 0x92, 0xd7, 0x35, 0xd4, 0xb4, 0x9b, + 0xaf, 0x54, 0xa5, 0x5c, 0x98, 0xce, 0xf4, 0xe5, 0xd7, 0x2e, 0xa7, 0x84, 0x8e, 0xe0, 0x33, 0xf0, + 0xbf, 0x3b, 0xd0, 0x23, 0xbb, 0xd9, 0x42, 0xea, 0x42, 0x39, 0x3f, 0x9d, 0xe9, 0x0f, 0x8e, 0x08, + 0x65, 0xfc, 0xf3, 0xb0, 0xda, 0x41, 0x0b, 0xa9, 0x8b, 0x09, 0xcc, 0xfd, 0x81, 0xf1, 0x72, 0xf6, + 0xc7, 0x9f, 0x2a, 0x99, 0xed, 0xbf, 0x15, 0xb0, 0x72, 0xe3, 0xba, 0x85, 0x5f, 0x5d, 0x95, 0x77, + 0xba, 0xb5, 0x6e, 0xaf, 0xe3, 0xb4, 0x91, 0x75, 0xdc, 0xea, 0x5a, 0x6a, 0x26, 0x96, 0xd3, 0xe6, + 0x38, 0x9a, 0x32, 0xf8, 0x0c, 0x3c, 0xba, 0x05, 0x3c, 0x6e, 0x75, 0x63, 0xd9, 0x60, 0x3a, 0xd3, + 0x97, 0x8e, 0x99, 0x88, 0x54, 0x3f, 0x07, 0x8f, 0x6f, 0xc1, 0x90, 0xd5, 0x69, 0x1d, 0x1e, 0x5b, + 0x0d, 0x75, 0xa1, 0x5c, 0x9c, 0xce, 0xf4, 0x1c, 0xc2, 0x21, 0xf3, 0x4f, 0xb1, 0x07, 0x77, 0xc0, + 0xc6, 0x2d, 0x68, 0xaf, 0x79, 0x09, 0x5e, 0x2c, 0xaf, 0x4e, 0x67, 0x3a, 0xe8, 0x51, 0x9e, 0xc2, + 0xef, 0x0a, 0xd8, 0xaf, 0xd9, 0x87, 0x56, 0x43, 0xcd, 0xc6, 0x02, 0xf6, 0x5d, 0xe2, 0x63, 0x2f, + 0x6e, 0xb4, 0xde, 0xf8, 0x70, 0x5e, 0x51, 0x3e, 0x9e, 0x57, 0x94, 0xbf, 0xce, 0x2b, 0xca, 0xfb, + 0x8b, 0x4a, 0xe6, 0xe3, 0x45, 0x25, 0xf3, 0xfb, 0x45, 0x25, 0xf3, 0xdd, 0xf6, 0x88, 0x88, 0x93, + 0x49, 0xdf, 0x18, 0xb0, 0xb1, 0x29, 0xb0, 0xef, 0x33, 0xbe, 0x43, 0x98, 0x19, 0x7f, 0xa8, 0xdf, + 0x5d, 0xfe, 0x91, 0x10, 0x67, 0x01, 0x0e, 0xfb, 0x4b, 0xf2, 0x33, 0xf0, 0xf5, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x1a, 0xbd, 0xcb, 0xb2, 0x66, 0x08, 0x00, 0x00, } func (m *Dispute) Marshal() (dAtA []byte, err error) { @@ -453,6 +468,30 @@ func (m *Dispute) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.PendingExecution { + i-- + if m.PendingExecution { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + { + size := m.VoterReward.Size() + i -= size + if _, err := m.VoterReward.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintDispute(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 if len(m.AdditionalEvidence) > 0 { for iNdEx := len(m.AdditionalEvidence) - 1; iNdEx >= 0; iNdEx-- { { @@ -760,6 +799,11 @@ func (m *Dispute) Size() (n int) { n += 2 + l + sovDispute(uint64(l)) } } + l = m.VoterReward.Size() + n += 2 + l + sovDispute(uint64(l)) + if m.PendingExecution { + n += 3 + } return n } @@ -1338,6 +1382,60 @@ func (m *Dispute) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VoterReward", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDispute + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoterReward.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingExecution", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PendingExecution = bool(v != 0) default: iNdEx = preIndex skippy, err := skipDispute(dAtA[iNdEx:]) diff --git a/x/dispute/types/errors.go b/x/dispute/types/errors.go index c498eb570..6f335c4ad 100644 --- a/x/dispute/types/errors.go +++ b/x/dispute/types/errors.go @@ -20,4 +20,5 @@ var ( ErrInvalidFeeDenom = sdkerrors.Register(ModuleName, 11, "invalid fee denom") ErrInvalidDisputeCategory = sdkerrors.Register(ModuleName, 12, "invalid dispute category") ErrInvalidSigner = sdkerrors.Register(ModuleName, 13, "expected teamaccount as only signer for updateTeam message") + ErrNoQuorumStillVoting = sdkerrors.Register(ModuleName, 14, "vote period not ended and quorum not reached") ) diff --git a/x/dispute/types/keys.go b/x/dispute/types/keys.go index af2a0b1ae..a9e17910d 100644 --- a/x/dispute/types/keys.go +++ b/x/dispute/types/keys.go @@ -34,6 +34,8 @@ var ( OpenDisputesIndexPrefix = collections.NewPrefix(14) DisputeFeePayerPrefix = collections.NewPrefix(15) DustKeyPrefix = collections.NewPrefix(16) + VoteCountsByGroupPrefix = collections.NewPrefix(17) + PendingExecutionIndexPrefix = collections.NewPrefix(18) ) func KeyPrefix(p string) []byte { diff --git a/x/dispute/types/stakeholder_vote_counts.go b/x/dispute/types/stakeholder_vote_counts.go new file mode 100644 index 000000000..332c83a0b --- /dev/null +++ b/x/dispute/types/stakeholder_vote_counts.go @@ -0,0 +1,32 @@ +package types + +import ( + "github.com/gogo/protobuf/proto" +) + +type StakeholderVoteCounts struct { + Users VoteCounts `protobuf:"bytes,1,opt,name=users,proto3"` + Reporters VoteCounts `protobuf:"bytes,2,opt,name=reporters,proto3"` + Tokenholders VoteCounts `protobuf:"bytes,3,opt,name=tokenholders,proto3"` + Team VoteCounts `protobuf:"bytes,4,opt,name=team,proto3"` +} + +type VoteCounts struct { + Support uint64 `protobuf:"varint,1,opt,name=support,proto3"` + Against uint64 `protobuf:"varint,2,opt,name=against,proto3"` + Invalid uint64 `protobuf:"varint,3,opt,name=invalid,proto3"` +} + +// Ensure WithdrawalId implements proto.Message +var _ proto.Message = &StakeholderVoteCounts{} + +// ProtoMessage is a no-op method to satisfy the proto.Message interface +func (*StakeholderVoteCounts) ProtoMessage() {} + +// Reset is a no-op method to satisfy the proto.Message interface +func (*StakeholderVoteCounts) Reset() {} + +// String returns a string representation, satisfying the proto.Message interface +func (m *StakeholderVoteCounts) String() string { + return proto.CompactTextString(m) +} diff --git a/x/dispute/types/tx.pb.go b/x/dispute/types/tx.pb.go index 2d4548f54..e6181b3a7 100644 --- a/x/dispute/types/tx.pb.go +++ b/x/dispute/types/tx.pb.go @@ -223,182 +223,6 @@ func (m *MsgWithdrawFeeRefundResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawFeeRefundResponse proto.InternalMessageInfo -type MsgExecuteDispute struct { - CallerAddress string `protobuf:"bytes,1,opt,name=caller_address,json=callerAddress,proto3" json:"caller_address,omitempty"` - DisputeId uint64 `protobuf:"varint,2,opt,name=dispute_id,json=disputeId,proto3" json:"dispute_id,omitempty"` -} - -func (m *MsgExecuteDispute) Reset() { *m = MsgExecuteDispute{} } -func (m *MsgExecuteDispute) String() string { return proto.CompactTextString(m) } -func (*MsgExecuteDispute) ProtoMessage() {} -func (*MsgExecuteDispute) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{4} -} -func (m *MsgExecuteDispute) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecuteDispute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecuteDispute.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgExecuteDispute) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecuteDispute.Merge(m, src) -} -func (m *MsgExecuteDispute) XXX_Size() int { - return m.Size() -} -func (m *MsgExecuteDispute) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecuteDispute.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExecuteDispute proto.InternalMessageInfo - -func (m *MsgExecuteDispute) GetCallerAddress() string { - if m != nil { - return m.CallerAddress - } - return "" -} - -func (m *MsgExecuteDispute) GetDisputeId() uint64 { - if m != nil { - return m.DisputeId - } - return 0 -} - -type MsgExecuteDisputeResponse struct { -} - -func (m *MsgExecuteDisputeResponse) Reset() { *m = MsgExecuteDisputeResponse{} } -func (m *MsgExecuteDisputeResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExecuteDisputeResponse) ProtoMessage() {} -func (*MsgExecuteDisputeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{5} -} -func (m *MsgExecuteDisputeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecuteDisputeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecuteDisputeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgExecuteDisputeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecuteDisputeResponse.Merge(m, src) -} -func (m *MsgExecuteDisputeResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgExecuteDisputeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecuteDisputeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExecuteDisputeResponse proto.InternalMessageInfo - -type MsgTallyVote struct { - CallerAddress string `protobuf:"bytes,1,opt,name=caller_address,json=callerAddress,proto3" json:"caller_address,omitempty"` - DisputeId uint64 `protobuf:"varint,2,opt,name=dispute_id,json=disputeId,proto3" json:"dispute_id,omitempty"` -} - -func (m *MsgTallyVote) Reset() { *m = MsgTallyVote{} } -func (m *MsgTallyVote) String() string { return proto.CompactTextString(m) } -func (*MsgTallyVote) ProtoMessage() {} -func (*MsgTallyVote) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{6} -} -func (m *MsgTallyVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTallyVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTallyVote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgTallyVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTallyVote.Merge(m, src) -} -func (m *MsgTallyVote) XXX_Size() int { - return m.Size() -} -func (m *MsgTallyVote) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTallyVote.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTallyVote proto.InternalMessageInfo - -func (m *MsgTallyVote) GetCallerAddress() string { - if m != nil { - return m.CallerAddress - } - return "" -} - -func (m *MsgTallyVote) GetDisputeId() uint64 { - if m != nil { - return m.DisputeId - } - return 0 -} - -type MsgTallyVoteResponse struct { -} - -func (m *MsgTallyVoteResponse) Reset() { *m = MsgTallyVoteResponse{} } -func (m *MsgTallyVoteResponse) String() string { return proto.CompactTextString(m) } -func (*MsgTallyVoteResponse) ProtoMessage() {} -func (*MsgTallyVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{7} -} -func (m *MsgTallyVoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTallyVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTallyVoteResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgTallyVoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTallyVoteResponse.Merge(m, src) -} -func (m *MsgTallyVoteResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgTallyVoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTallyVoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTallyVoteResponse proto.InternalMessageInfo - type MsgProposeDispute struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` Report *types.MicroReport `protobuf:"bytes,2,opt,name=report,proto3" json:"report,omitempty"` @@ -411,7 +235,7 @@ func (m *MsgProposeDispute) Reset() { *m = MsgProposeDispute{} } func (m *MsgProposeDispute) String() string { return proto.CompactTextString(m) } func (*MsgProposeDispute) ProtoMessage() {} func (*MsgProposeDispute) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{8} + return fileDescriptor_3a591d7bef5d6e8a, []int{4} } func (m *MsgProposeDispute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -482,7 +306,7 @@ func (m *MsgProposeDisputeResponse) Reset() { *m = MsgProposeDisputeResp func (m *MsgProposeDisputeResponse) String() string { return proto.CompactTextString(m) } func (*MsgProposeDisputeResponse) ProtoMessage() {} func (*MsgProposeDisputeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{9} + return fileDescriptor_3a591d7bef5d6e8a, []int{5} } func (m *MsgProposeDisputeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -522,7 +346,7 @@ func (m *MsgAddFeeToDispute) Reset() { *m = MsgAddFeeToDispute{} } func (m *MsgAddFeeToDispute) String() string { return proto.CompactTextString(m) } func (*MsgAddFeeToDispute) ProtoMessage() {} func (*MsgAddFeeToDispute) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{10} + return fileDescriptor_3a591d7bef5d6e8a, []int{6} } func (m *MsgAddFeeToDispute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -586,7 +410,7 @@ func (m *MsgAddFeeToDisputeResponse) Reset() { *m = MsgAddFeeToDisputeRe func (m *MsgAddFeeToDisputeResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddFeeToDisputeResponse) ProtoMessage() {} func (*MsgAddFeeToDisputeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{11} + return fileDescriptor_3a591d7bef5d6e8a, []int{7} } func (m *MsgAddFeeToDisputeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -625,7 +449,7 @@ func (m *MsgVote) Reset() { *m = MsgVote{} } func (m *MsgVote) String() string { return proto.CompactTextString(m) } func (*MsgVote) ProtoMessage() {} func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{12} + return fileDescriptor_3a591d7bef5d6e8a, []int{8} } func (m *MsgVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -682,7 +506,7 @@ func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } func (*MsgVoteResponse) ProtoMessage() {} func (*MsgVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{13} + return fileDescriptor_3a591d7bef5d6e8a, []int{9} } func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -720,7 +544,7 @@ func (m *MsgUpdateTeam) Reset() { *m = MsgUpdateTeam{} } func (m *MsgUpdateTeam) String() string { return proto.CompactTextString(m) } func (*MsgUpdateTeam) ProtoMessage() {} func (*MsgUpdateTeam) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{14} + return fileDescriptor_3a591d7bef5d6e8a, []int{10} } func (m *MsgUpdateTeam) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -770,7 +594,7 @@ func (m *MsgUpdateTeamResponse) Reset() { *m = MsgUpdateTeamResponse{} } func (m *MsgUpdateTeamResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateTeamResponse) ProtoMessage() {} func (*MsgUpdateTeamResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3a591d7bef5d6e8a, []int{15} + return fileDescriptor_3a591d7bef5d6e8a, []int{11} } func (m *MsgUpdateTeamResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -799,15 +623,99 @@ func (m *MsgUpdateTeamResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateTeamResponse proto.InternalMessageInfo +type MsgClaimReward struct { + CallerAddress string `protobuf:"bytes,1,opt,name=caller_address,json=callerAddress,proto3" json:"caller_address,omitempty"` + DisputeId uint64 `protobuf:"varint,2,opt,name=dispute_id,json=disputeId,proto3" json:"dispute_id,omitempty"` +} + +func (m *MsgClaimReward) Reset() { *m = MsgClaimReward{} } +func (m *MsgClaimReward) String() string { return proto.CompactTextString(m) } +func (*MsgClaimReward) ProtoMessage() {} +func (*MsgClaimReward) Descriptor() ([]byte, []int) { + return fileDescriptor_3a591d7bef5d6e8a, []int{12} +} +func (m *MsgClaimReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimReward.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgClaimReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimReward.Merge(m, src) +} +func (m *MsgClaimReward) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimReward) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimReward.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimReward proto.InternalMessageInfo + +func (m *MsgClaimReward) GetCallerAddress() string { + if m != nil { + return m.CallerAddress + } + return "" +} + +func (m *MsgClaimReward) GetDisputeId() uint64 { + if m != nil { + return m.DisputeId + } + return 0 +} + +type MsgClaimRewardResponse struct { +} + +func (m *MsgClaimRewardResponse) Reset() { *m = MsgClaimRewardResponse{} } +func (m *MsgClaimRewardResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClaimRewardResponse) ProtoMessage() {} +func (*MsgClaimRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3a591d7bef5d6e8a, []int{13} +} +func (m *MsgClaimRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimRewardResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgClaimRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimRewardResponse.Merge(m, src) +} +func (m *MsgClaimRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimRewardResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgAddEvidence)(nil), "layer.dispute.MsgAddEvidence") proto.RegisterType((*MsgAddEvidenceResponse)(nil), "layer.dispute.MsgAddEvidenceResponse") proto.RegisterType((*MsgWithdrawFeeRefund)(nil), "layer.dispute.MsgWithdrawFeeRefund") proto.RegisterType((*MsgWithdrawFeeRefundResponse)(nil), "layer.dispute.MsgWithdrawFeeRefundResponse") - proto.RegisterType((*MsgExecuteDispute)(nil), "layer.dispute.MsgExecuteDispute") - proto.RegisterType((*MsgExecuteDisputeResponse)(nil), "layer.dispute.MsgExecuteDisputeResponse") - proto.RegisterType((*MsgTallyVote)(nil), "layer.dispute.MsgTallyVote") - proto.RegisterType((*MsgTallyVoteResponse)(nil), "layer.dispute.MsgTallyVoteResponse") proto.RegisterType((*MsgProposeDispute)(nil), "layer.dispute.MsgProposeDispute") proto.RegisterType((*MsgProposeDisputeResponse)(nil), "layer.dispute.MsgProposeDisputeResponse") proto.RegisterType((*MsgAddFeeToDispute)(nil), "layer.dispute.MsgAddFeeToDispute") @@ -816,68 +724,68 @@ func init() { proto.RegisterType((*MsgVoteResponse)(nil), "layer.dispute.MsgVoteResponse") proto.RegisterType((*MsgUpdateTeam)(nil), "layer.dispute.MsgUpdateTeam") proto.RegisterType((*MsgUpdateTeamResponse)(nil), "layer.dispute.MsgUpdateTeamResponse") + proto.RegisterType((*MsgClaimReward)(nil), "layer.dispute.MsgClaimReward") + proto.RegisterType((*MsgClaimRewardResponse)(nil), "layer.dispute.MsgClaimRewardResponse") } func init() { proto.RegisterFile("layer/dispute/tx.proto", fileDescriptor_3a591d7bef5d6e8a) } var fileDescriptor_3a591d7bef5d6e8a = []byte{ - // 885 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x4f, 0xe3, 0x46, - 0x14, 0xc6, 0x49, 0x80, 0xf2, 0x80, 0xb0, 0xb8, 0x14, 0x8c, 0x61, 0xbd, 0x69, 0xb6, 0x2b, 0xa5, - 0xac, 0x6a, 0x37, 0xec, 0xa1, 0x12, 0x87, 0x4a, 0xcb, 0x2e, 0x48, 0x7b, 0xb0, 0xb4, 0x72, 0x69, - 0x2b, 0x55, 0x2b, 0x45, 0x8e, 0xfd, 0x30, 0x96, 0x62, 0x8f, 0x35, 0xe3, 0x00, 0xb9, 0x55, 0x3d, - 0xb4, 0xd7, 0xfd, 0x09, 0xfd, 0x09, 0x7b, 0xec, 0x2f, 0xa8, 0xf6, 0xb8, 0xc7, 0x9e, 0xaa, 0x0a, - 0x0e, 0xfb, 0x37, 0x2a, 0x7b, 0xc6, 0x03, 0x8e, 0x2d, 0xc2, 0xa1, 0x3d, 0x25, 0x79, 0xdf, 0x37, - 0xf3, 0x7d, 0xef, 0xbd, 0x79, 0x93, 0x81, 0xcd, 0x91, 0x3b, 0x41, 0x6a, 0xf9, 0x21, 0x4b, 0xc6, - 0x29, 0x5a, 0xe9, 0xa5, 0x99, 0x50, 0x92, 0x12, 0x75, 0x35, 0x8f, 0x9b, 0x22, 0xae, 0x1b, 0x1e, - 0x61, 0x11, 0x61, 0xd6, 0xd0, 0x65, 0x68, 0x9d, 0xf7, 0x87, 0x98, 0xba, 0x7d, 0xcb, 0x23, 0x61, - 0xcc, 0xe9, 0xfa, 0x96, 0xc0, 0x23, 0x16, 0x58, 0xe7, 0xfd, 0xec, 0x43, 0x00, 0x1b, 0x01, 0x09, - 0x48, 0xfe, 0xd5, 0xca, 0xbe, 0x89, 0xe8, 0x4e, 0x59, 0x55, 0x7c, 0x0a, 0x50, 0x2b, 0x83, 0xe7, - 0x44, 0x22, 0x8f, 0x38, 0x42, 0xa8, 0xeb, 0x8d, 0xd0, 0x8a, 0x42, 0x8f, 0x92, 0x01, 0xc5, 0x84, - 0xd0, 0x94, 0x13, 0xba, 0xbf, 0x2b, 0xd0, 0xb6, 0x59, 0xf0, 0xdc, 0xf7, 0x8f, 0xce, 0x43, 0x1f, - 0x63, 0x0f, 0xd5, 0x27, 0xd0, 0xf6, 0xdc, 0xd1, 0x08, 0xe9, 0xc0, 0xf5, 0x7d, 0x8a, 0x8c, 0x69, - 0x4a, 0x47, 0xe9, 0x2d, 0x39, 0xab, 0x3c, 0xfa, 0x9c, 0x07, 0xd5, 0x87, 0x00, 0x42, 0x70, 0x10, - 0xfa, 0x5a, 0xa3, 0xa3, 0xf4, 0x5a, 0xce, 0x92, 0x88, 0xbc, 0xf2, 0xd5, 0x67, 0xb0, 0xc8, 0x85, - 0x98, 0xd6, 0xec, 0x34, 0x7b, 0xcb, 0xfb, 0xdb, 0x26, 0x2f, 0x10, 0xf7, 0x62, 0xda, 0x99, 0x17, - 0x27, 0x67, 0x38, 0x05, 0xf3, 0xe0, 0xd3, 0x5f, 0x3e, 0xbe, 0xdb, 0x9b, 0x52, 0xef, 0x6a, 0xb0, - 0x59, 0x76, 0xe8, 0x20, 0x4b, 0x48, 0xcc, 0xb0, 0xfb, 0x9b, 0x02, 0x1b, 0x36, 0x0b, 0x7e, 0x0c, - 0xd3, 0x33, 0x9f, 0xba, 0x17, 0xc7, 0x88, 0x0e, 0x9e, 0x8e, 0x63, 0xff, 0xbe, 0x29, 0x3c, 0x86, - 0xd5, 0x24, 0xf3, 0x24, 0x59, 0x8d, 0x9c, 0xb5, 0x92, 0x07, 0x0b, 0x52, 0x1b, 0x1a, 0xa1, 0xaf, - 0x35, 0xf3, 0xfc, 0x1a, 0xa1, 0x5f, 0xef, 0xd1, 0x80, 0xdd, 0x3a, 0x23, 0xd2, 0x69, 0x0c, 0xeb, - 0x36, 0x0b, 0x8e, 0x2e, 0xd1, 0x1b, 0xa7, 0xf8, 0x92, 0x17, 0xe9, 0xbf, 0x29, 0x74, 0xbd, 0x9f, - 0x1d, 0xd8, 0xae, 0xe8, 0x49, 0x33, 0x21, 0xac, 0xd8, 0x2c, 0x38, 0x71, 0x47, 0xa3, 0xc9, 0x0f, - 0xe4, 0xff, 0xf5, 0xb1, 0x99, 0x37, 0x48, 0x4a, 0x49, 0x0b, 0x6f, 0x1b, 0x79, 0x41, 0x5e, 0x53, - 0x92, 0x10, 0x26, 0x0b, 0xa2, 0xc1, 0xa2, 0x47, 0xd1, 0x4d, 0x09, 0x15, 0x0e, 0x8a, 0x9f, 0x6a, - 0x1f, 0x16, 0xf8, 0x19, 0xc9, 0x75, 0xef, 0x3c, 0x4c, 0x82, 0xa8, 0xbe, 0x82, 0x07, 0x85, 0x5d, - 0xcf, 0x4d, 0x31, 0x20, 0x74, 0x92, 0x77, 0xb1, 0xbd, 0x6f, 0x98, 0xa5, 0x51, 0x35, 0x85, 0xfc, - 0x0b, 0xc1, 0x72, 0xd6, 0xfc, 0x72, 0x40, 0xed, 0x43, 0xf3, 0x14, 0x51, 0x6b, 0x09, 0x69, 0x3e, - 0xb9, 0x66, 0x36, 0xd9, 0xa6, 0x98, 0x6c, 0xf3, 0x05, 0x09, 0xe3, 0xc3, 0xd6, 0xfb, 0xbf, 0x1f, - 0xcd, 0x39, 0x19, 0x57, 0xed, 0xe6, 0x47, 0x6b, 0x70, 0x4a, 0x49, 0x34, 0x18, 0x92, 0xd8, 0xd7, - 0xe6, 0x3b, 0x4a, 0xef, 0x13, 0x67, 0x39, 0x71, 0x27, 0xc7, 0x94, 0x44, 0x87, 0x24, 0xf6, 0x0f, - 0x56, 0xb2, 0x8a, 0x15, 0x29, 0x8a, 0x96, 0x95, 0x2b, 0x22, 0xeb, 0xf5, 0x87, 0x02, 0x2a, 0x1f, - 0x82, 0x63, 0xc4, 0x13, 0x32, 0xbb, 0x60, 0x33, 0xa6, 0xf3, 0x1b, 0x58, 0x70, 0x23, 0x32, 0x8e, - 0xd3, 0xbc, 0x24, 0xf7, 0x48, 0x4a, 0xd0, 0xab, 0x79, 0xb5, 0x66, 0xe5, 0xb5, 0x0b, 0x7a, 0xd5, - 0xb9, 0x4c, 0xec, 0x0c, 0x16, 0x6d, 0x16, 0xe4, 0xc7, 0x70, 0x03, 0xe6, 0xb3, 0x9b, 0xab, 0x48, - 0x85, 0xff, 0x10, 0xe3, 0xd7, 0x28, 0xc6, 0x4f, 0x7d, 0x0a, 0xad, 0x0c, 0x10, 0xad, 0xdc, 0x9a, - 0x6a, 0x65, 0xb6, 0xd1, 0x51, 0x3c, 0x8e, 0x9c, 0x9c, 0x74, 0x00, 0x99, 0x13, 0xbe, 0x51, 0x77, - 0x1d, 0xd6, 0x84, 0x92, 0x14, 0xff, 0x55, 0x81, 0x55, 0x9b, 0x05, 0xdf, 0x27, 0xbe, 0x9b, 0xe2, - 0x09, 0xba, 0x91, 0xfa, 0x35, 0x6c, 0x78, 0x63, 0x4a, 0x31, 0x4e, 0x07, 0x29, 0xba, 0xd1, 0xd4, - 0x40, 0xa8, 0x02, 0xcb, 0xa8, 0xc5, 0x54, 0xf4, 0xe0, 0x41, 0x8c, 0x17, 0x65, 0x36, 0xbf, 0x46, - 0xda, 0x31, 0x5e, 0xdc, 0x62, 0x1e, 0x6c, 0x67, 0x66, 0x6a, 0xb7, 0xef, 0x6e, 0xc1, 0x67, 0x25, - 0x1f, 0x85, 0xc3, 0xfd, 0x3f, 0xe7, 0xa1, 0x69, 0xb3, 0x40, 0x7d, 0x03, 0xed, 0xa9, 0x59, 0xe9, - 0x4c, 0x65, 0x5e, 0x39, 0x3b, 0x7a, 0x6f, 0x16, 0xa3, 0x50, 0x51, 0x07, 0xb0, 0x36, 0x7d, 0xb2, - 0x3e, 0xaf, 0x2e, 0x9e, 0xa2, 0xe8, 0x5f, 0xce, 0xa4, 0x48, 0x81, 0x6f, 0xa1, 0x95, 0xb7, 0x78, - 0xb3, 0xba, 0x24, 0x8b, 0xeb, 0x46, 0x7d, 0x5c, 0xae, 0x7f, 0x0d, 0x70, 0xab, 0x49, 0xbb, 0x55, - 0xf6, 0x0d, 0xaa, 0x7f, 0x71, 0x17, 0x2a, 0x77, 0xb4, 0x61, 0xe9, 0xe6, 0x02, 0xdc, 0xa9, 0x2e, - 0x91, 0xa0, 0xfe, 0xf8, 0x0e, 0x50, 0x6e, 0xf7, 0x06, 0xda, 0x53, 0x97, 0x7b, 0x4d, 0x7f, 0xca, - 0x8c, 0xba, 0xfe, 0xd4, 0x5f, 0xd8, 0x2a, 0xc2, 0x7a, 0xf5, 0x3f, 0xae, 0xc6, 0x57, 0x85, 0xa4, - 0x3f, 0xbd, 0x07, 0x49, 0xca, 0x7c, 0x07, 0xcb, 0xb7, 0xdf, 0x01, 0x0f, 0x6b, 0xfb, 0x5b, 0xc0, - 0xfa, 0x93, 0x3b, 0xe1, 0x62, 0x53, 0x7d, 0xfe, 0xe7, 0x8f, 0xef, 0xf6, 0x94, 0xc3, 0x97, 0xef, - 0xaf, 0x0c, 0xe5, 0xc3, 0x95, 0xa1, 0xfc, 0x73, 0x65, 0x28, 0x6f, 0xaf, 0x8d, 0xb9, 0x0f, 0xd7, - 0xc6, 0xdc, 0x5f, 0xd7, 0xc6, 0xdc, 0x4f, 0x7b, 0x41, 0x98, 0x9e, 0x8d, 0x87, 0xa6, 0x47, 0x22, - 0x2b, 0xc5, 0xd1, 0x88, 0xd0, 0xaf, 0x42, 0x62, 0xf1, 0x77, 0xcb, 0xe5, 0xcd, 0x33, 0x6b, 0x92, - 0x20, 0x1b, 0x2e, 0xe4, 0x8f, 0x96, 0x67, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xe4, 0xee, - 0xf4, 0x84, 0x09, 0x00, 0x00, + // 850 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xc1, 0x6e, 0xdb, 0x46, + 0x10, 0x35, 0x25, 0xd9, 0x6e, 0xc6, 0xb1, 0x1c, 0x6f, 0x5d, 0x9b, 0x66, 0x1c, 0x46, 0x55, 0x1a, + 0x40, 0x75, 0x50, 0xb2, 0x72, 0x0e, 0x05, 0x7c, 0x28, 0x10, 0x3b, 0x31, 0x90, 0x83, 0x80, 0x80, + 0x4d, 0x5b, 0xa0, 0x28, 0x20, 0xac, 0xb8, 0x63, 0x9a, 0xa8, 0xc8, 0x25, 0x76, 0x29, 0x3b, 0xbe, + 0x15, 0x3d, 0xb4, 0xd7, 0x7c, 0x42, 0x3f, 0x21, 0xc7, 0x7e, 0x42, 0x8e, 0x39, 0xf6, 0x54, 0x14, + 0xf6, 0x21, 0xb7, 0x7e, 0x43, 0x41, 0xee, 0x92, 0x91, 0x44, 0x41, 0xf2, 0x21, 0x27, 0x91, 0xf3, + 0xde, 0xce, 0xbc, 0x99, 0x7d, 0xbb, 0x14, 0x6c, 0x0f, 0xe9, 0x25, 0x0a, 0x97, 0x85, 0x32, 0x19, + 0xa5, 0xe8, 0xa6, 0xaf, 0x9c, 0x44, 0xf0, 0x94, 0x93, 0xf5, 0x3c, 0xee, 0xe8, 0xb8, 0x65, 0xfb, + 0x5c, 0x46, 0x5c, 0xba, 0x03, 0x2a, 0xd1, 0x3d, 0xef, 0x0e, 0x30, 0xa5, 0x5d, 0xd7, 0xe7, 0x61, + 0xac, 0xe8, 0xd6, 0x8e, 0xc6, 0x23, 0x19, 0xb8, 0xe7, 0xdd, 0xec, 0x47, 0x03, 0x5b, 0x01, 0x0f, + 0x78, 0xfe, 0xe8, 0x66, 0x4f, 0x3a, 0x7a, 0x77, 0xb2, 0xaa, 0xfe, 0xd5, 0xa0, 0x39, 0x09, 0x9e, + 0xf3, 0x12, 0xb9, 0xaf, 0x10, 0x2e, 0xa8, 0x3f, 0x44, 0x37, 0x0a, 0x7d, 0xc1, 0xfb, 0x02, 0x13, + 0x2e, 0x52, 0x45, 0x68, 0xff, 0x69, 0x40, 0xb3, 0x27, 0x83, 0x27, 0x8c, 0x3d, 0x3b, 0x0f, 0x19, + 0xc6, 0x3e, 0x92, 0x87, 0xd0, 0xf4, 0xe9, 0x70, 0x88, 0xa2, 0x4f, 0x19, 0x13, 0x28, 0xa5, 0x69, + 0xb4, 0x8c, 0xce, 0x2d, 0x6f, 0x5d, 0x45, 0x9f, 0xa8, 0x20, 0xb9, 0x07, 0xa0, 0x0b, 0xf6, 0x43, + 0x66, 0xd6, 0x5a, 0x46, 0xa7, 0xe1, 0xdd, 0xd2, 0x91, 0xe7, 0x8c, 0x3c, 0x86, 0x55, 0x55, 0x48, + 0x9a, 0xf5, 0x56, 0xbd, 0xb3, 0x76, 0xb0, 0xeb, 0xa8, 0x01, 0x29, 0x2d, 0x4e, 0x2f, 0xd3, 0xe2, + 0xe5, 0x0c, 0xaf, 0x60, 0x1e, 0x7e, 0xfa, 0xdb, 0xfb, 0x37, 0xfb, 0x53, 0xd5, 0xdb, 0x26, 0x6c, + 0x4f, 0x2a, 0xf4, 0x50, 0x26, 0x3c, 0x96, 0xd8, 0xfe, 0xc3, 0x80, 0xad, 0x9e, 0x0c, 0x7e, 0x0c, + 0xd3, 0x33, 0x26, 0xe8, 0xc5, 0x09, 0xa2, 0x87, 0xa7, 0xa3, 0x98, 0xdd, 0xb4, 0x85, 0x07, 0xb0, + 0x9e, 0x64, 0x9a, 0x4a, 0x56, 0x2d, 0x67, 0xdd, 0xce, 0x83, 0x05, 0xa9, 0x09, 0xb5, 0x90, 0x99, + 0xf5, 0xbc, 0xbf, 0x5a, 0xc8, 0x66, 0x6b, 0xb4, 0x61, 0x6f, 0x96, 0x90, 0x52, 0xe9, 0xeb, 0x1a, + 0x6c, 0xf6, 0x64, 0xf0, 0x42, 0xf0, 0x84, 0x4b, 0x7c, 0xaa, 0xa6, 0x44, 0x4c, 0x58, 0xf5, 0x05, + 0xd2, 0x94, 0x0b, 0xad, 0xaf, 0x78, 0x25, 0x5d, 0x58, 0x51, 0x33, 0xc9, 0x25, 0xcd, 0x1d, 0x9e, + 0x26, 0x92, 0xe7, 0x70, 0xa7, 0xd8, 0x0f, 0x9f, 0xa6, 0x18, 0x70, 0x71, 0x99, 0xab, 0x6e, 0x1e, + 0xd8, 0xce, 0x84, 0x35, 0x1d, 0x5d, 0xfe, 0x58, 0xb3, 0xbc, 0x0d, 0x36, 0x19, 0x20, 0x5d, 0xa8, + 0x9f, 0x22, 0x9a, 0x0d, 0x5d, 0x5a, 0x39, 0xd5, 0xc9, 0x9c, 0xec, 0x68, 0x27, 0x3b, 0xc7, 0x3c, + 0x8c, 0x8f, 0x1a, 0x6f, 0xff, 0xb9, 0xbf, 0xe4, 0x65, 0x5c, 0xd2, 0xce, 0x47, 0xd9, 0x3f, 0x15, + 0x3c, 0xea, 0x0f, 0x78, 0xcc, 0xcc, 0xe5, 0x96, 0xd1, 0xf9, 0xc4, 0x5b, 0x4b, 0xe8, 0xe5, 0x89, + 0xe0, 0xd1, 0x11, 0x8f, 0xd9, 0xe1, 0xed, 0x6c, 0x72, 0x45, 0x8b, 0xed, 0xbb, 0xb0, 0x5b, 0x99, + 0x48, 0x39, 0xaf, 0xbf, 0x0c, 0x20, 0x6a, 0xd3, 0x4f, 0x10, 0x5f, 0xf2, 0xc5, 0x03, 0x5b, 0xe0, + 0xc6, 0x6f, 0x60, 0x85, 0x46, 0x7c, 0x14, 0xa7, 0xf9, 0x48, 0x6e, 0xd0, 0x94, 0xa6, 0x57, 0xfb, + 0x6a, 0x2c, 0xea, 0x6b, 0x0f, 0xac, 0xaa, 0xf2, 0xb2, 0xb1, 0x33, 0x58, 0xed, 0xc9, 0xe0, 0x07, + 0x9e, 0x22, 0xd9, 0x82, 0xe5, 0xec, 0xa4, 0x16, 0xad, 0xa8, 0x17, 0x6d, 0xb7, 0x5a, 0x61, 0x37, + 0xf2, 0x08, 0x1a, 0x19, 0xa0, 0xb7, 0x72, 0x67, 0x6a, 0x2b, 0xb3, 0x44, 0xcf, 0xe2, 0x51, 0xe4, + 0xe5, 0xa4, 0x43, 0xc8, 0x94, 0xa8, 0x44, 0xed, 0x4d, 0xd8, 0xd0, 0x95, 0xca, 0xe2, 0xbf, 0x1b, + 0xb0, 0xde, 0x93, 0xc1, 0xf7, 0x09, 0xa3, 0x29, 0xbe, 0x44, 0x1a, 0x91, 0xaf, 0x61, 0xcb, 0x1f, + 0x09, 0x81, 0x71, 0xda, 0x4f, 0x91, 0x46, 0x53, 0xc7, 0x85, 0x68, 0x2c, 0xa3, 0x16, 0xc7, 0xa1, + 0x03, 0x77, 0x62, 0xbc, 0x98, 0x64, 0xab, 0x63, 0xd3, 0x8c, 0xf1, 0x62, 0x8c, 0x79, 0xb8, 0x9b, + 0x89, 0x99, 0x99, 0xbe, 0xbd, 0x03, 0x9f, 0x4d, 0xe8, 0x28, 0x15, 0xfe, 0x92, 0xdf, 0x46, 0xc7, + 0x43, 0x1a, 0x46, 0x1e, 0x5e, 0x50, 0xc1, 0x3e, 0xce, 0x6d, 0x34, 0xef, 0x62, 0x19, 0x2b, 0x56, + 0xc8, 0x38, 0xf8, 0xaf, 0x01, 0xf5, 0x9e, 0x0c, 0xc8, 0xcf, 0xd0, 0x9c, 0x3a, 0xb2, 0xad, 0xa9, + 0x0d, 0xa8, 0x58, 0xd8, 0xea, 0x2c, 0x62, 0x14, 0x55, 0x48, 0x1f, 0x36, 0xa6, 0x0d, 0xfe, 0x79, + 0x75, 0xf1, 0x14, 0xc5, 0xfa, 0x72, 0x21, 0xa5, 0x2c, 0xf0, 0x2d, 0x34, 0x72, 0xa7, 0x6d, 0x57, + 0x97, 0x64, 0x71, 0xcb, 0x9e, 0x1d, 0x2f, 0xd7, 0xbf, 0x00, 0x18, 0xf3, 0xca, 0x5e, 0x95, 0xfd, + 0x01, 0xb5, 0xbe, 0x98, 0x87, 0x96, 0x19, 0x11, 0x36, 0xab, 0xb7, 0xf5, 0x83, 0xea, 0xd2, 0x0a, + 0xc9, 0x7a, 0x74, 0x03, 0x52, 0x59, 0xe6, 0x3b, 0x58, 0x1b, 0xff, 0xa2, 0xdd, 0x9b, 0x39, 0xb2, + 0x02, 0xb6, 0x1e, 0xce, 0x85, 0xc7, 0x93, 0x8e, 0x1b, 0x73, 0x46, 0xd2, 0x31, 0x78, 0x56, 0xd2, + 0x19, 0x4e, 0xb3, 0x96, 0x7f, 0x7d, 0xff, 0x66, 0xdf, 0x38, 0x7a, 0xfa, 0xf6, 0xca, 0x36, 0xde, + 0x5d, 0xd9, 0xc6, 0xbf, 0x57, 0xb6, 0xf1, 0xfa, 0xda, 0x5e, 0x7a, 0x77, 0x6d, 0x2f, 0xfd, 0x7d, + 0x6d, 0x2f, 0xfd, 0xb4, 0x1f, 0x84, 0xe9, 0xd9, 0x68, 0xe0, 0xf8, 0x3c, 0x72, 0x53, 0x1c, 0x0e, + 0xb9, 0xf8, 0x2a, 0xe4, 0xae, 0xfa, 0xac, 0xbf, 0xfa, 0xf0, 0x2f, 0xe4, 0x32, 0x41, 0x39, 0x58, + 0xc9, 0xbf, 0xe9, 0x8f, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x97, 0x28, 0x95, 0x1e, 0xa3, 0x08, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -896,10 +804,9 @@ type MsgClient interface { AddFeeToDispute(ctx context.Context, in *MsgAddFeeToDispute, opts ...grpc.CallOption) (*MsgAddFeeToDisputeResponse, error) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) UpdateTeam(ctx context.Context, in *MsgUpdateTeam, opts ...grpc.CallOption) (*MsgUpdateTeamResponse, error) - TallyVote(ctx context.Context, in *MsgTallyVote, opts ...grpc.CallOption) (*MsgTallyVoteResponse, error) - ExecuteDispute(ctx context.Context, in *MsgExecuteDispute, opts ...grpc.CallOption) (*MsgExecuteDisputeResponse, error) WithdrawFeeRefund(ctx context.Context, in *MsgWithdrawFeeRefund, opts ...grpc.CallOption) (*MsgWithdrawFeeRefundResponse, error) AddEvidence(ctx context.Context, in *MsgAddEvidence, opts ...grpc.CallOption) (*MsgAddEvidenceResponse, error) + ClaimReward(ctx context.Context, in *MsgClaimReward, opts ...grpc.CallOption) (*MsgClaimRewardResponse, error) } type msgClient struct { @@ -946,24 +853,6 @@ func (c *msgClient) UpdateTeam(ctx context.Context, in *MsgUpdateTeam, opts ...g return out, nil } -func (c *msgClient) TallyVote(ctx context.Context, in *MsgTallyVote, opts ...grpc.CallOption) (*MsgTallyVoteResponse, error) { - out := new(MsgTallyVoteResponse) - err := c.cc.Invoke(ctx, "/layer.dispute.Msg/TallyVote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ExecuteDispute(ctx context.Context, in *MsgExecuteDispute, opts ...grpc.CallOption) (*MsgExecuteDisputeResponse, error) { - out := new(MsgExecuteDisputeResponse) - err := c.cc.Invoke(ctx, "/layer.dispute.Msg/ExecuteDispute", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) WithdrawFeeRefund(ctx context.Context, in *MsgWithdrawFeeRefund, opts ...grpc.CallOption) (*MsgWithdrawFeeRefundResponse, error) { out := new(MsgWithdrawFeeRefundResponse) err := c.cc.Invoke(ctx, "/layer.dispute.Msg/WithdrawFeeRefund", in, out, opts...) @@ -982,16 +871,24 @@ func (c *msgClient) AddEvidence(ctx context.Context, in *MsgAddEvidence, opts .. return out, nil } +func (c *msgClient) ClaimReward(ctx context.Context, in *MsgClaimReward, opts ...grpc.CallOption) (*MsgClaimRewardResponse, error) { + out := new(MsgClaimRewardResponse) + err := c.cc.Invoke(ctx, "/layer.dispute.Msg/ClaimReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { ProposeDispute(context.Context, *MsgProposeDispute) (*MsgProposeDisputeResponse, error) AddFeeToDispute(context.Context, *MsgAddFeeToDispute) (*MsgAddFeeToDisputeResponse, error) Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) UpdateTeam(context.Context, *MsgUpdateTeam) (*MsgUpdateTeamResponse, error) - TallyVote(context.Context, *MsgTallyVote) (*MsgTallyVoteResponse, error) - ExecuteDispute(context.Context, *MsgExecuteDispute) (*MsgExecuteDisputeResponse, error) WithdrawFeeRefund(context.Context, *MsgWithdrawFeeRefund) (*MsgWithdrawFeeRefundResponse, error) AddEvidence(context.Context, *MsgAddEvidence) (*MsgAddEvidenceResponse, error) + ClaimReward(context.Context, *MsgClaimReward) (*MsgClaimRewardResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1010,18 +907,15 @@ func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVote func (*UnimplementedMsgServer) UpdateTeam(ctx context.Context, req *MsgUpdateTeam) (*MsgUpdateTeamResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateTeam not implemented") } -func (*UnimplementedMsgServer) TallyVote(ctx context.Context, req *MsgTallyVote) (*MsgTallyVoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TallyVote not implemented") -} -func (*UnimplementedMsgServer) ExecuteDispute(ctx context.Context, req *MsgExecuteDispute) (*MsgExecuteDisputeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExecuteDispute not implemented") -} func (*UnimplementedMsgServer) WithdrawFeeRefund(ctx context.Context, req *MsgWithdrawFeeRefund) (*MsgWithdrawFeeRefundResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method WithdrawFeeRefund not implemented") } func (*UnimplementedMsgServer) AddEvidence(ctx context.Context, req *MsgAddEvidence) (*MsgAddEvidenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddEvidence not implemented") } +func (*UnimplementedMsgServer) ClaimReward(ctx context.Context, req *MsgClaimReward) (*MsgClaimRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimReward not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1099,74 +993,56 @@ func _Msg_UpdateTeam_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Msg_TallyVote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTallyVote) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).TallyVote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/layer.dispute.Msg/TallyVote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).TallyVote(ctx, req.(*MsgTallyVote)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ExecuteDispute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExecuteDispute) +func _Msg_WithdrawFeeRefund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawFeeRefund) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).ExecuteDispute(ctx, in) + return srv.(MsgServer).WithdrawFeeRefund(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/layer.dispute.Msg/ExecuteDispute", + FullMethod: "/layer.dispute.Msg/WithdrawFeeRefund", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ExecuteDispute(ctx, req.(*MsgExecuteDispute)) + return srv.(MsgServer).WithdrawFeeRefund(ctx, req.(*MsgWithdrawFeeRefund)) } return interceptor(ctx, in, info, handler) } -func _Msg_WithdrawFeeRefund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgWithdrawFeeRefund) +func _Msg_AddEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddEvidence) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).WithdrawFeeRefund(ctx, in) + return srv.(MsgServer).AddEvidence(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/layer.dispute.Msg/WithdrawFeeRefund", + FullMethod: "/layer.dispute.Msg/AddEvidence", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).WithdrawFeeRefund(ctx, req.(*MsgWithdrawFeeRefund)) + return srv.(MsgServer).AddEvidence(ctx, req.(*MsgAddEvidence)) } return interceptor(ctx, in, info, handler) } -func _Msg_AddEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAddEvidence) +func _Msg_ClaimReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimReward) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AddEvidence(ctx, in) + return srv.(MsgServer).ClaimReward(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/layer.dispute.Msg/AddEvidence", + FullMethod: "/layer.dispute.Msg/ClaimReward", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AddEvidence(ctx, req.(*MsgAddEvidence)) + return srv.(MsgServer).ClaimReward(ctx, req.(*MsgClaimReward)) } return interceptor(ctx, in, info, handler) } @@ -1191,14 +1067,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateTeam", Handler: _Msg_UpdateTeam_Handler, }, - { - MethodName: "TallyVote", - Handler: _Msg_TallyVote_Handler, - }, - { - MethodName: "ExecuteDispute", - Handler: _Msg_ExecuteDispute_Handler, - }, { MethodName: "WithdrawFeeRefund", Handler: _Msg_WithdrawFeeRefund_Handler, @@ -1207,6 +1075,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AddEvidence", Handler: _Msg_AddEvidence_Handler, }, + { + MethodName: "ClaimReward", + Handler: _Msg_ClaimReward_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "layer/dispute/tx.proto", @@ -1349,7 +1221,7 @@ func (m *MsgWithdrawFeeRefundResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *MsgExecuteDispute) Marshal() (dAtA []byte, err error) { +func (m *MsgProposeDispute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1359,133 +1231,17 @@ func (m *MsgExecuteDispute) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgExecuteDispute) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgProposeDispute) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgExecuteDispute) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgProposeDispute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.DisputeId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.DisputeId)) - i-- - dAtA[i] = 0x10 - } - if len(m.CallerAddress) > 0 { - i -= len(m.CallerAddress) - copy(dAtA[i:], m.CallerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.CallerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgExecuteDisputeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgExecuteDisputeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExecuteDisputeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgTallyVote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTallyVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTallyVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DisputeId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.DisputeId)) - i-- - dAtA[i] = 0x10 - } - if len(m.CallerAddress) > 0 { - i -= len(m.CallerAddress) - copy(dAtA[i:], m.CallerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.CallerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgTallyVoteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTallyVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTallyVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgProposeDispute) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgProposeDispute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgProposeDispute) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PayFromBond { + if m.PayFromBond { i-- if m.PayFromBond { dAtA[i] = 1 @@ -1756,6 +1512,64 @@ func (m *MsgUpdateTeamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgClaimReward) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgClaimReward) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DisputeId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DisputeId)) + i-- + dAtA[i] = 0x10 + } + if len(m.CallerAddress) > 0 { + i -= len(m.CallerAddress) + copy(dAtA[i:], m.CallerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.CallerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgClaimRewardResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgClaimRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1827,56 +1641,6 @@ func (m *MsgWithdrawFeeRefundResponse) Size() (n int) { return n } -func (m *MsgExecuteDispute) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CallerAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.DisputeId != 0 { - n += 1 + sovTx(uint64(m.DisputeId)) - } - return n -} - -func (m *MsgExecuteDisputeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgTallyVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CallerAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.DisputeId != 0 { - n += 1 + sovTx(uint64(m.DisputeId)) - } - return n -} - -func (m *MsgTallyVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *MsgProposeDispute) Size() (n int) { if m == nil { return 0 @@ -1995,381 +1759,38 @@ func (m *MsgUpdateTeamResponse) Size() (n int) { return n } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgAddEvidence) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgAddEvidence: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddEvidence: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CallerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CallerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) - } - m.DisputeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DisputeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reports", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reports = append(m.Reports, &types.MicroReport{}) - if err := m.Reports[len(m.Reports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgAddEvidenceResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgAddEvidenceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgWithdrawFeeRefund) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgWithdrawFeeRefund: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawFeeRefund: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CallerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CallerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PayerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PayerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgWithdrawFeeRefundResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgWithdrawFeeRefundResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawFeeRefundResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } +func (m *MsgClaimReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CallerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.DisputeId != 0 { + n += 1 + sovTx(uint64(m.DisputeId)) } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *MsgClaimRewardResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } -func (m *MsgExecuteDispute) Unmarshal(dAtA []byte) error { +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAddEvidence) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2392,10 +1813,10 @@ func (m *MsgExecuteDispute) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgExecuteDispute: wiretype end group for non-group") + return fmt.Errorf("proto: MsgAddEvidence: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecuteDispute: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgAddEvidence: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2449,6 +1870,40 @@ func (m *MsgExecuteDispute) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reports = append(m.Reports, &types.MicroReport{}) + if err := m.Reports[len(m.Reports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2470,7 +1925,7 @@ func (m *MsgExecuteDispute) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgExecuteDisputeResponse) Unmarshal(dAtA []byte) error { +func (m *MsgAddEvidenceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2493,10 +1948,10 @@ func (m *MsgExecuteDisputeResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgExecuteDisputeResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgAddEvidenceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecuteDisputeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgAddEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2520,7 +1975,7 @@ func (m *MsgExecuteDisputeResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgTallyVote) Unmarshal(dAtA []byte) error { +func (m *MsgWithdrawFeeRefund) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2543,10 +1998,10 @@ func (m *MsgTallyVote) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgTallyVote: wiretype end group for non-group") + return fmt.Errorf("proto: MsgWithdrawFeeRefund: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTallyVote: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgWithdrawFeeRefund: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2582,10 +2037,42 @@ func (m *MsgTallyVote) Unmarshal(dAtA []byte) error { m.CallerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PayerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - m.DisputeId = 0 + m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2595,7 +2082,7 @@ func (m *MsgTallyVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DisputeId |= uint64(b&0x7F) << shift + m.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2621,7 +2108,7 @@ func (m *MsgTallyVote) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgTallyVoteResponse) Unmarshal(dAtA []byte) error { +func (m *MsgWithdrawFeeRefundResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2644,10 +2131,10 @@ func (m *MsgTallyVoteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgTallyVoteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgWithdrawFeeRefundResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTallyVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgWithdrawFeeRefundResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3449,6 +2936,157 @@ func (m *MsgUpdateTeamResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgClaimReward) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgClaimReward: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimReward: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CallerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) + } + m.DisputeId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DisputeId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgClaimRewardResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgClaimRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/dispute/types/vote.pb.go b/x/dispute/types/vote.pb.go index 50aa83df3..47e88c05e 100644 --- a/x/dispute/types/vote.pb.go +++ b/x/dispute/types/vote.pb.go @@ -174,8 +174,11 @@ func (m *Vote) GetExecuted() bool { } type Voter struct { - Vote VoteEnum `protobuf:"varint,1,opt,name=vote,proto3,enum=layer.dispute.VoteEnum" json:"vote,omitempty"` - VoterPower cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=voter_power,json=voterPower,proto3,customtype=cosmossdk.io/math.Int" json:"voter_power"` + Vote VoteEnum `protobuf:"varint,1,opt,name=vote,proto3,enum=layer.dispute.VoteEnum" json:"vote,omitempty"` + VoterPower cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=voter_power,json=voterPower,proto3,customtype=cosmossdk.io/math.Int" json:"voter_power"` + ReporterPower cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=reporter_power,json=reporterPower,proto3,customtype=cosmossdk.io/math.Int" json:"reporter_power"` + TokenholderPower cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=tokenholder_power,json=tokenholderPower,proto3,customtype=cosmossdk.io/math.Int" json:"tokenholder_power"` + RewardClaimed bool `protobuf:"varint,5,opt,name=reward_claimed,json=rewardClaimed,proto3" json:"reward_claimed,omitempty"` } func (m *Voter) Reset() { *m = Voter{} } @@ -218,6 +221,13 @@ func (m *Voter) GetVote() VoteEnum { return VoteEnum_VOTE_INVALID } +func (m *Voter) GetRewardClaimed() bool { + if m != nil { + return m.RewardClaimed + } + return false +} + func init() { proto.RegisterEnum("layer.dispute.VoteResult", VoteResult_name, VoteResult_value) proto.RegisterEnum("layer.dispute.VoteEnum", VoteEnum_name, VoteEnum_value) @@ -228,39 +238,43 @@ func init() { func init() { proto.RegisterFile("layer/dispute/vote.proto", fileDescriptor_1b528b9404bfff75) } var fileDescriptor_1b528b9404bfff75 = []byte{ - // 509 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x4d, 0x6e, 0xda, 0x40, - 0x18, 0xf5, 0x10, 0x48, 0xc8, 0x90, 0x22, 0x34, 0x6a, 0x55, 0xc3, 0xc2, 0xa0, 0xac, 0x10, 0x51, - 0xc6, 0x12, 0x5d, 0x75, 0x53, 0xd5, 0x28, 0xa8, 0x72, 0x45, 0x30, 0x35, 0x06, 0x29, 0xdd, 0x58, - 0x06, 0x4f, 0x1d, 0xab, 0x36, 0x63, 0xd9, 0xe3, 0x36, 0x6c, 0x7b, 0x82, 0x5c, 0xa1, 0x77, 0xe8, - 0x21, 0xb2, 0x8c, 0xba, 0xaa, 0xba, 0x48, 0x2b, 0x38, 0x41, 0x6f, 0x50, 0x8d, 0xff, 0x68, 0xa4, - 0x66, 0x91, 0x95, 0xe7, 0x7d, 0xef, 0xbd, 0xef, 0x7b, 0x9e, 0xf9, 0xa0, 0xe8, 0x59, 0x6b, 0x12, - 0xca, 0xb6, 0x1b, 0x05, 0x31, 0x23, 0xf2, 0x27, 0xca, 0x08, 0x0e, 0x42, 0xca, 0x28, 0x7a, 0x92, - 0x30, 0x38, 0x63, 0x5a, 0xcd, 0x25, 0x8d, 0x7c, 0x1a, 0x99, 0x09, 0x29, 0xa7, 0x20, 0x55, 0xb6, - 0x9e, 0x3a, 0xd4, 0xa1, 0x69, 0x9d, 0x9f, 0xb2, 0x6a, 0xdb, 0xa1, 0xd4, 0xf1, 0x88, 0x9c, 0xa0, - 0x45, 0xfc, 0x41, 0x66, 0xae, 0x4f, 0x22, 0x66, 0xf9, 0x41, 0x26, 0x68, 0xde, 0x1f, 0xcd, 0x2c, - 0xcf, 0x5b, 0xa7, 0xd4, 0xf1, 0x1f, 0x00, 0xcb, 0x73, 0xca, 0x08, 0xaa, 0xc3, 0x92, 0x6b, 0x8b, - 0xa0, 0x03, 0xba, 0x65, 0xbd, 0xe4, 0xda, 0x68, 0x00, 0x0f, 0x79, 0xc4, 0x29, 0xb3, 0x42, 0x26, - 0x96, 0x3a, 0xa0, 0x5b, 0xeb, 0xb7, 0x70, 0x3a, 0x08, 0xe7, 0x83, 0xb0, 0x91, 0x0f, 0x1a, 0x54, - 0x6f, 0xee, 0xda, 0xc2, 0xf5, 0xaf, 0x36, 0xd0, 0x77, 0x36, 0xf4, 0x0a, 0x1e, 0x70, 0x30, 0x5c, - 0xd9, 0xe2, 0xde, 0x23, 0x3a, 0xe4, 0x26, 0xf4, 0x12, 0x42, 0x7e, 0xd4, 0x49, 0x14, 0x7b, 0x4c, - 0x2c, 0x77, 0x40, 0xb7, 0xde, 0x6f, 0xe2, 0x7b, 0xb7, 0x85, 0xe7, 0x85, 0x40, 0xff, 0x47, 0x8c, - 0x5a, 0xb0, 0x4a, 0xae, 0xc8, 0x32, 0x66, 0xc4, 0x16, 0x2b, 0x1d, 0xd0, 0xad, 0xea, 0x05, 0x3e, - 0xfe, 0x02, 0x60, 0x85, 0xdb, 0x42, 0x74, 0x02, 0xcb, 0xdc, 0x93, 0xfc, 0x76, 0xbd, 0xff, 0xfc, - 0x3f, 0xad, 0x87, 0xab, 0xd8, 0xd7, 0x13, 0x11, 0x1a, 0xc1, 0x1a, 0xff, 0x86, 0x66, 0x40, 0x3f, - 0x93, 0x30, 0xb9, 0x93, 0xc3, 0xc1, 0x09, 0x4f, 0xfd, 0xf3, 0xae, 0xfd, 0x2c, 0x7d, 0xa7, 0xc8, - 0xfe, 0x88, 0x5d, 0x2a, 0xfb, 0x16, 0xbb, 0xc4, 0xea, 0x8a, 0x7d, 0xff, 0x76, 0x0a, 0xb3, 0x07, - 0x54, 0x57, 0x59, 0xc0, 0x70, 0xc2, 0xed, 0xbd, 0xaf, 0x00, 0xc2, 0x5d, 0x76, 0x74, 0x04, 0xab, - 0x63, 0xcd, 0x34, 0x94, 0xd1, 0xe8, 0xa2, 0x21, 0xa0, 0x1a, 0x3c, 0x98, 0xce, 0x26, 0x13, 0x4d, - 0x37, 0x1a, 0x80, 0x03, 0xe5, 0x8d, 0xa2, 0x8e, 0xa7, 0x46, 0xa3, 0xc4, 0x81, 0x3a, 0x9e, 0x2b, - 0x23, 0xf5, 0xac, 0xb1, 0x87, 0x24, 0xd8, 0x1a, 0x6b, 0xe6, 0xbb, 0x99, 0xa6, 0xcf, 0xce, 0xcd, - 0x73, 0xe5, 0xad, 0xa6, 0xab, 0xc6, 0x85, 0x99, 0x3b, 0xcb, 0x0f, 0xf0, 0x79, 0xb3, 0xca, 0x03, - 0x7c, 0xde, 0x7f, 0xbf, 0xf7, 0x1a, 0x56, 0xf3, 0x3b, 0x40, 0x0d, 0x78, 0x34, 0xd7, 0x8c, 0x61, - 0xc1, 0x0a, 0x45, 0x65, 0x97, 0x34, 0xaf, 0x14, 0x71, 0x07, 0x67, 0x37, 0x1b, 0x09, 0xdc, 0x6e, - 0x24, 0xf0, 0x7b, 0x23, 0x81, 0xeb, 0xad, 0x24, 0xdc, 0x6e, 0x25, 0xe1, 0xc7, 0x56, 0x12, 0xde, - 0xf7, 0x1c, 0x97, 0x5d, 0xc6, 0x0b, 0xbc, 0xa4, 0xbe, 0xcc, 0x88, 0xe7, 0xd1, 0xf0, 0xd4, 0xa5, - 0x72, 0xba, 0xa8, 0x57, 0xbb, 0x55, 0x5d, 0x07, 0x24, 0x5a, 0xec, 0x27, 0xeb, 0xf2, 0xe2, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0xee, 0xd8, 0xe4, 0x43, 0x03, 0x00, 0x00, + // 565 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x41, 0x6e, 0xda, 0x40, + 0x14, 0x86, 0x3d, 0xc4, 0x49, 0xc8, 0x10, 0x90, 0x3b, 0x6a, 0x55, 0xc3, 0xc2, 0xa0, 0x48, 0x95, + 0x10, 0x51, 0x6c, 0x89, 0xae, 0xba, 0xa9, 0x0a, 0x0d, 0xaa, 0x5c, 0x11, 0x4c, 0x8d, 0x41, 0x4d, + 0x37, 0x96, 0xc1, 0x53, 0xb0, 0x62, 0x33, 0x96, 0x3d, 0x6e, 0xc2, 0x2d, 0x72, 0x85, 0xde, 0xa1, + 0x87, 0xc8, 0x32, 0xea, 0xa6, 0x55, 0x17, 0x69, 0x05, 0x27, 0xe8, 0x0d, 0xaa, 0xb1, 0xb1, 0x49, + 0xa4, 0x66, 0xc1, 0xca, 0xf3, 0xde, 0xff, 0xde, 0xf7, 0x7e, 0xcf, 0xd3, 0x40, 0xd1, 0xb5, 0x16, + 0x38, 0x50, 0x6c, 0x27, 0xf4, 0x23, 0x8a, 0x95, 0x2f, 0x84, 0x62, 0xd9, 0x0f, 0x08, 0x25, 0xa8, + 0x18, 0x2b, 0xf2, 0x5a, 0xa9, 0x94, 0x27, 0x24, 0xf4, 0x48, 0x68, 0xc6, 0xa2, 0x92, 0x04, 0x49, + 0x65, 0xe5, 0xe9, 0x94, 0x4c, 0x49, 0x92, 0x67, 0xa7, 0x75, 0xb6, 0x3a, 0x25, 0x64, 0xea, 0x62, + 0x25, 0x8e, 0xc6, 0xd1, 0x67, 0x85, 0x3a, 0x1e, 0x0e, 0xa9, 0xe5, 0xf9, 0xeb, 0x82, 0xf2, 0xc3, + 0xd1, 0xd4, 0x72, 0xdd, 0x45, 0x22, 0x1d, 0xfd, 0x05, 0x90, 0x1f, 0x11, 0x8a, 0x51, 0x09, 0xe6, + 0x1c, 0x5b, 0x04, 0x35, 0x50, 0xe7, 0xf5, 0x9c, 0x63, 0xa3, 0x36, 0x3c, 0x60, 0x16, 0x07, 0xd4, + 0x0a, 0xa8, 0x98, 0xab, 0x81, 0x7a, 0xa1, 0x59, 0x91, 0x93, 0x41, 0x72, 0x3a, 0x48, 0x36, 0xd2, + 0x41, 0xed, 0xfc, 0xcd, 0x5d, 0x95, 0xbb, 0xfe, 0x5d, 0x05, 0xfa, 0xa6, 0x0d, 0xbd, 0x86, 0xfb, + 0x2c, 0xe8, 0xcc, 0x6d, 0x71, 0x67, 0x0b, 0x42, 0xda, 0x84, 0x5e, 0x41, 0xc8, 0x8e, 0x3a, 0x0e, + 0x23, 0x97, 0x8a, 0x7c, 0x0d, 0xd4, 0x4b, 0xcd, 0xb2, 0xfc, 0xe0, 0xb6, 0xe4, 0x51, 0x56, 0xa0, + 0xdf, 0x2b, 0x46, 0x15, 0x98, 0xc7, 0x57, 0x78, 0x12, 0x51, 0x6c, 0x8b, 0xbb, 0x35, 0x50, 0xcf, + 0xeb, 0x59, 0x7c, 0xf4, 0x23, 0x07, 0x77, 0x59, 0x5b, 0x80, 0x8e, 0x21, 0xcf, 0x7a, 0xe2, 0xdf, + 0x2e, 0x35, 0x9f, 0xff, 0x07, 0xdd, 0x99, 0x47, 0x9e, 0x1e, 0x17, 0xa1, 0x2e, 0x2c, 0xb0, 0x6f, + 0x60, 0xfa, 0xe4, 0x12, 0x07, 0xf1, 0x9d, 0x1c, 0xb4, 0x8f, 0x99, 0xeb, 0x5f, 0x77, 0xd5, 0x67, + 0xc9, 0x9e, 0x42, 0xfb, 0x42, 0x76, 0x88, 0xe2, 0x59, 0x74, 0x26, 0xab, 0x73, 0xfa, 0xfd, 0xdb, + 0x09, 0x5c, 0x2f, 0x50, 0x9d, 0xaf, 0x0d, 0x06, 0x7d, 0xd6, 0x8e, 0x74, 0x58, 0x0a, 0xb0, 0x4f, + 0x82, 0x0d, 0x70, 0x67, 0x7b, 0x60, 0x31, 0x45, 0x24, 0xcc, 0x8f, 0xf0, 0x09, 0x25, 0x17, 0x78, + 0x3e, 0x23, 0xae, 0x9d, 0x61, 0xf9, 0xed, 0xb1, 0xc2, 0x3d, 0x4a, 0x42, 0x7e, 0xc1, 0xdc, 0x5e, + 0x5a, 0x81, 0x6d, 0x4e, 0x5c, 0xcb, 0xf1, 0xb2, 0x4b, 0x2d, 0x26, 0xd9, 0xb7, 0x49, 0xb2, 0xf1, + 0x15, 0x40, 0xb8, 0x59, 0x08, 0x3a, 0x84, 0xf9, 0x9e, 0x66, 0x1a, 0xad, 0x6e, 0xf7, 0x5c, 0xe0, + 0x50, 0x01, 0xee, 0x0f, 0x86, 0xfd, 0xbe, 0xa6, 0x1b, 0x02, 0x60, 0x41, 0xeb, 0x5d, 0x4b, 0xed, + 0x0d, 0x0c, 0x21, 0xc7, 0x02, 0xb5, 0x37, 0x6a, 0x75, 0xd5, 0x53, 0x61, 0x07, 0x49, 0xb0, 0xd2, + 0xd3, 0xcc, 0x0f, 0x43, 0x4d, 0x1f, 0x9e, 0x99, 0x67, 0xad, 0xf7, 0x9a, 0xae, 0x1a, 0xe7, 0x66, + 0xda, 0xc9, 0x3f, 0xa2, 0xa7, 0xb0, 0xdd, 0x47, 0xf4, 0x94, 0xbf, 0xd7, 0x78, 0x03, 0xf3, 0xe9, + 0x62, 0x91, 0x00, 0x0f, 0x47, 0x9a, 0xd1, 0xc9, 0x54, 0x2e, 0xcb, 0x6c, 0x9c, 0xa6, 0x99, 0xcc, + 0x6e, 0xfb, 0xf4, 0x66, 0x29, 0x81, 0xdb, 0xa5, 0x04, 0xfe, 0x2c, 0x25, 0x70, 0xbd, 0x92, 0xb8, + 0xdb, 0x95, 0xc4, 0xfd, 0x5c, 0x49, 0xdc, 0xa7, 0xc6, 0xd4, 0xa1, 0xb3, 0x68, 0x2c, 0x4f, 0x88, + 0xa7, 0x50, 0xec, 0xba, 0x24, 0x38, 0x71, 0x88, 0x92, 0xbc, 0xbe, 0xab, 0xcd, 0xfb, 0x5b, 0xf8, + 0x38, 0x1c, 0xef, 0xc5, 0x6f, 0xe0, 0xe5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6c, 0xfd, 0x3f, + 0x10, 0x18, 0x04, 0x00, 0x00, } func (m *Vote) Marshal() (dAtA []byte, err error) { @@ -342,6 +356,36 @@ func (m *Voter) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.RewardClaimed { + i-- + if m.RewardClaimed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size := m.TokenholderPower.Size() + i -= size + if _, err := m.TokenholderPower.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintVote(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.ReporterPower.Size() + i -= size + if _, err := m.ReporterPower.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintVote(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a { size := m.VoterPower.Size() i -= size @@ -404,6 +448,13 @@ func (m *Voter) Size() (n int) { } l = m.VoterPower.Size() n += 1 + l + sovVote(uint64(l)) + l = m.ReporterPower.Size() + n += 1 + l + sovVote(uint64(l)) + l = m.TokenholderPower.Size() + n += 1 + l + sovVote(uint64(l)) + if m.RewardClaimed { + n += 2 + } return n } @@ -669,6 +720,94 @@ func (m *Voter) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReporterPower", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVote + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVote + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVote + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ReporterPower.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenholderPower", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVote + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVote + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVote + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TokenholderPower.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardClaimed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVote + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RewardClaimed = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVote(dAtA[iNdEx:]) diff --git a/x/oracle/keeper/cycle_list.go b/x/oracle/keeper/cycle_list.go index 271844766..f63c98c90 100644 --- a/x/oracle/keeper/cycle_list.go +++ b/x/oracle/keeper/cycle_list.go @@ -3,7 +3,6 @@ package keeper import ( "context" "errors" - "fmt" "strconv" "github.com/tellor-io/layer/utils" @@ -39,7 +38,6 @@ func (k Keeper) RotateQueries(ctx context.Context) error { queryMeta, err := k.CurrentQuery(ctx, queryId) if err == nil && queryMeta.Expiration > uint64(blockHeight) { - fmt.Println("query is not expired, skipping rotation") return nil } @@ -85,9 +83,7 @@ func (k Keeper) RotateQueries(ctx context.Context) error { } // if query has a tip don't generate a new query but extend if revealing time is expired - fmt.Println("querymeta.Amount:", querymeta.Amount) if !querymeta.Amount.IsZero() { - fmt.Println("inside tipped part of rotate queries") querymeta.CycleList = true if querymeta.Expiration <= uint64(blockHeight) && !querymeta.HasRevealedReports { // wrong, shouldn't use same query if expired diff --git a/x/reporter/keeper/distribution.go b/x/reporter/keeper/distribution.go index 478821855..15d9f9f5f 100644 --- a/x/reporter/keeper/distribution.go +++ b/x/reporter/keeper/distribution.go @@ -98,7 +98,7 @@ func (k Keeper) ReturnSlashedTokens(ctx context.Context, amt math.Int, hashId [] shareAmt := math.NewUint(source.Amount.Uint64()) if extra.IsPositive() { // add extra tokens based on the share of the delegator - shareAmt = math.NewUint(source.Amount.Uint64()).Quo(math.NewUint(snapshot.Total.Uint64())).Mul(math.NewUint(amt.Uint64())) + shareAmt = math.NewUint(source.Amount.Uint64()).Mul(math.NewUint(amt.Uint64())).Quo(math.NewUint(snapshot.Total.Uint64())) } _, err = k.stakingKeeper.Delegate(ctx, delAddr, math.NewInt(int64(shareAmt.Uint64())), tokenSrc, val, false) if err != nil { diff --git a/x/reporter/keeper/reporter.go b/x/reporter/keeper/reporter.go index d516c46ac..39b75cfc5 100644 --- a/x/reporter/keeper/reporter.go +++ b/x/reporter/keeper/reporter.go @@ -116,7 +116,8 @@ func (k Keeper) ReporterStake(ctx context.Context, repAddr sdk.AccAddress) (math return true } if val.IsBonded() { - delTokens := val.TokensFromShares(delegation.Shares).TruncateInt() + delTokensDec := val.TokensFromShares(delegation.Shares) + delTokens := delTokensDec.TruncateInt() totalTokens = totalTokens.Add(delTokens) delegates = append(delegates, &types.TokenOriginInfo{DelegatorAddress: selectorAddr, ValidatorAddress: valAddr.Bytes(), Amount: delTokens}) } diff --git a/x/reporter/keeper/withdraw.go b/x/reporter/keeper/withdraw.go index c1e3f8dc9..521101940 100644 --- a/x/reporter/keeper/withdraw.go +++ b/x/reporter/keeper/withdraw.go @@ -158,15 +158,14 @@ func (k Keeper) EscrowReporterStake(ctx context.Context, reporterAddr sdk.AccAdd totalTokens := layertypes.PowerReduction.MulRaw(int64(power)) disputeTokens := make([]*types.TokenOriginInfo, 0) - leftover := amt + leftover := math.NewUint(amt.Uint64() * 1e6) for i, del := range report.TokenOrigins { - - delegatorShare := math.LegacyNewDecFromInt(del.Amount).Quo(math.LegacyNewDecFromInt(totalTokens)).Mul(math.LegacyNewDecFromInt(amt)) - - leftover = leftover.Sub(delegatorShare.TruncateInt()) + truncDelAmount := math.NewUint(del.Amount.Uint64()).QuoUint64(layertypes.PowerReduction.Uint64()).MulUint64(layertypes.PowerReduction.Uint64()) + delegatorShare := truncDelAmount.MulUint64(amt.Uint64()).MulUint64(1e6).Quo(math.NewUint(totalTokens.Uint64())) + leftover = leftover.Sub(delegatorShare) if i == len(report.TokenOrigins)-1 { - delegatorShare = delegatorShare.Add(leftover.ToLegacyDec()) + delegatorShare = delegatorShare.Add(leftover) } delAddr := sdk.AccAddress(del.DelegatorAddress) @@ -176,28 +175,30 @@ func (k Keeper) EscrowReporterStake(ctx context.Context, reporterAddr sdk.AccAdd if err != nil { return err } - storedAmount := delegatorShare.TruncateInt().Sub(remaining) + storedAmount := delegatorShare.Sub(math.NewUint(remaining.Uint64())) + storedAmountFixed6 := storedAmount.Quo(math.NewUint(1e6)) if !storedAmount.IsZero() { disputeTokens = append(disputeTokens, &types.TokenOriginInfo{ DelegatorAddress: del.DelegatorAddress, ValidatorAddress: del.ValidatorAddress, - Amount: storedAmount, + Amount: math.NewIntFromUint64(storedAmountFixed6.Uint64()), }) } + remainingFixed6 := remaining.Quo(math.NewUint(1e6)) if !remaining.IsZero() { dstVAl, err := k.getDstValidator(ctx, delAddr, valAddr) if err != nil { return err } - _, err = k.undelegate(ctx, delAddr, dstVAl, math.LegacyNewDecFromInt(remaining)) + _, err = k.undelegate(ctx, delAddr, dstVAl, remaining) if err != nil { return err } disputeTokens = append(disputeTokens, &types.TokenOriginInfo{ DelegatorAddress: del.DelegatorAddress, ValidatorAddress: dstVAl, - Amount: remaining, + Amount: math.NewIntFromUint64(remainingFixed6.Uint64()), }) } } @@ -225,26 +226,28 @@ func (k Keeper) getDstValidator(ctx context.Context, delAddr sdk.AccAddress, val return nil, errors.New("redelegation to destination validator not found") } -func (k Keeper) deductUnbondingDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, tokens math.Int) (math.Int, error) { +func (k Keeper) deductUnbondingDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, tokens math.Uint) (math.Uint, error) { ubd, err := k.stakingKeeper.GetUnbondingDelegation(ctx, delAddr, valAddr) if err != nil { - return math.Int{}, err + return math.Uint{}, err } + if len(ubd.Entries) == 0 { - return math.Int{}, types.ErrNoUnbondingDelegationEntries + return math.Uint{}, types.ErrNoUnbondingDelegationEntries } - removeAmt := math.ZeroInt() + removeAmt := math.ZeroUint() for i, u := range ubd.Entries { - if u.Balance.LT(tokens) { - tokens = tokens.Sub(u.Balance) - removeAmt = removeAmt.Add(u.Balance) + normalizedBalance := math.NewUint(u.Balance.Uint64() * 1e6) + if normalizedBalance.LT(tokens) { + tokens = tokens.Sub(normalizedBalance) + removeAmt = removeAmt.Add(normalizedBalance) ubd.RemoveEntry(int64(i)) } else { - u.Balance = u.Balance.Sub(tokens) - u.InitialBalance = u.InitialBalance.Sub(tokens) + u.Balance = math.NewIntFromUint64(normalizedBalance.Sub(tokens).QuoUint64(1e6).Uint64()) + u.InitialBalance = u.InitialBalance.Sub(math.NewIntFromUint64(tokens.QuoUint64(1e6).Uint64())) ubd.Entries[i] = u removeAmt = removeAmt.Add(tokens) - tokens = math.ZeroInt() + tokens = math.ZeroUint() break } } @@ -255,52 +258,54 @@ func (k Keeper) deductUnbondingDelegation(ctx context.Context, delAddr sdk.AccAd err = k.stakingKeeper.SetUnbondingDelegation(ctx, ubd) } if err != nil { - return math.Int{}, err + return math.Uint{}, err } - err = k.tokensToDispute(ctx, stakingtypes.NotBondedPoolName, removeAmt) + err = k.tokensToDispute(ctx, stakingtypes.NotBondedPoolName, (math.NewInt(int64(removeAmt.Uint64())).QuoRaw(1e6))) if err != nil { - return math.Int{}, err + return math.Uint{}, err } return tokens, nil } -func (k Keeper) deductFromdelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, delTokens math.LegacyDec) (math.LegacyDec, error) { +func (k Keeper) deductFromdelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, delTokens math.Uint) (math.Uint, error) { // get delegation del, err := k.stakingKeeper.GetDelegation(ctx, delAddr, valAddr) if err != nil { if errors.Is(err, stakingtypes.ErrNoDelegation) { return delTokens, nil } - return math.LegacyDec{}, err + return math.Uint{}, err } validator, err := k.stakingKeeper.GetValidator(ctx, valAddr) if err != nil { - return math.LegacyDec{}, err + return math.Uint{}, err } // convert current delegation shares to tokens currentTokens := validator.TokensFromShares(del.Shares) + tokensFromShare := math.NewUint(currentTokens.BigInt().Uint64() * 1e6) // normalize to match with the normalized delTokens shares := del.Shares - if currentTokens.GTE(delTokens) { - shares, err = validator.SharesFromTokens(delTokens.TruncateInt()) + if tokensFromShare.GTE(delTokens) { + shares, err = validator.SharesFromTokens(math.Int(delTokens.QuoUint64(1e6))) if err != nil { - return math.LegacyDec{}, err + return math.Uint{}, err } - delTokens = math.LegacyZeroDec() + delTokens = math.ZeroUint() } else { - delTokens = delTokens.Sub(currentTokens) + delTokens = delTokens.Sub(tokensFromShare) } - if !shares.IsZero() { + if !tokensFromShare.IsZero() { removedTokens, err := k.stakingKeeper.Unbond(ctx, delAddr, valAddr, shares) if err != nil { - return math.LegacyDec{}, err + return math.Uint{}, err } err = k.MoveTokensFromValidator(ctx, validator, removedTokens) if err != nil { - return math.LegacyDec{}, err + return math.Uint{}, err } } + // returning normalized version of delTokens return delTokens, nil } @@ -318,30 +323,31 @@ func (k Keeper) MoveTokensFromValidator(ctx context.Context, validator stakingty } func (k Keeper) tokensToDispute(ctx context.Context, fromPool string, amount math.Int) error { + fmt.Println("Tokens to dispute: ", amount) return k.bankKeeper.SendCoinsFromModuleToModule(ctx, fromPool, disputetypes.ModuleName, sdk.NewCoins(sdk.NewCoin(layertypes.BondDenom, amount))) } -func (k Keeper) undelegate(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, delTokens math.LegacyDec) (math.Int, error) { +func (k Keeper) undelegate(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, delTokens math.Uint) (math.Uint, error) { remainingFromdel, err := k.deductFromdelegation(ctx, delAddr, valAddr, delTokens) if err != nil { - return math.Int{}, err + return math.Uint{}, err } // if tokens are still remaining after removing from delegation, then it could be one of two cases // the delegator is unbonding or the delegator has redelegated to another validator if remainingFromdel.IsZero() { - return math.ZeroInt(), nil + return math.ZeroUint(), nil } - remainingUnbonding, err := k.deductUnbondingDelegation(ctx, delAddr, valAddr, remainingFromdel.TruncateInt()) + remainingUnbonding, err := k.deductUnbondingDelegation(ctx, delAddr, valAddr, remainingFromdel) if err != nil { if errors.Is(err, stakingtypes.ErrNoUnbondingDelegation) { - return remainingFromdel.TruncateInt(), nil + return remainingFromdel, nil } - return math.Int{}, err + return math.Uint{}, err } if remainingUnbonding.IsZero() { - return math.ZeroInt(), nil + return math.ZeroUint(), nil } return remainingUnbonding, nil } diff --git a/x/reporter/keeper/withdraw_test.go b/x/reporter/keeper/withdraw_test.go index fa1f5c22d..2d973d5d9 100644 --- a/x/reporter/keeper/withdraw_test.go +++ b/x/reporter/keeper/withdraw_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "fmt" "testing" "github.com/stretchr/testify/mock" @@ -177,19 +178,21 @@ func TestEscrowReporterStakeUnbondingdelegations(t *testing.T) { DelegatorAddress: selector2.String(), ValidatorAddress: sdk.ValAddress(valAddr1).String(), Entries: []stakingtypes.UnbondingDelegationEntry{ - {CreationHeight: ctx.BlockHeight(), InitialBalance: math.NewInt(500000001), Balance: math.NewInt(500000001)}, + {CreationHeight: ctx.BlockHeight(), InitialBalance: math.NewInt(500000000), Balance: math.NewInt(500000000)}, }, }).Return(nil) sk.On("GetValidator", ctx, sdk.ValAddress(valAddr1)).Return(validator1, nil) sk.On("GetValidator", ctx, sdk.ValAddress(valAddr2)).Return(validator2, nil) - sk.On("Unbond", ctx, reporterAddr, sdk.ValAddress(valAddr1), delegation1.Shares.Quo(math.LegacyNewDec(2)).Sub(math.LegacyOneDec())).Return(stake.QuoRaw(2).SubRaw(1), nil) - sk.On("Unbond", ctx, selector3, sdk.ValAddress(valAddr2), math.LegacyNewDec(500000002)).Return(math.NewInt(500000002), nil) + fmt.Println("Val 1: ", valAddr1) + fmt.Println("Reporter: ", reporterAddr) + sk.On("Unbond", ctx, reporterAddr, sdk.ValAddress(valAddr1), delegation1.Shares.Quo(math.LegacyNewDec(2))).Return(stake.QuoRaw(2), nil) + sk.On("Unbond", ctx, selector3, sdk.ValAddress(valAddr2), math.LegacyNewDec(500000000)).Return(math.NewInt(500000000), nil) - bk.On("SendCoinsFromModuleToModule", ctx, stakingtypes.BondedPoolName, "dispute", sdk.NewCoins(sdk.NewCoin("loya", stake.QuoRaw(2).SubRaw(1)))).Return(nil) - bk.On("SendCoinsFromModuleToModule", ctx, stakingtypes.NotBondedPoolName, "dispute", sdk.NewCoins(sdk.NewCoin("loya", stake.QuoRaw(2).SubRaw(1)))).Return(nil) - bk.On("SendCoinsFromModuleToModule", ctx, stakingtypes.BondedPoolName, "dispute", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(500000002)))).Return(nil) + bk.On("SendCoinsFromModuleToModule", ctx, stakingtypes.BondedPoolName, "dispute", sdk.NewCoins(sdk.NewCoin("loya", stake.QuoRaw(2)))).Return(nil) + bk.On("SendCoinsFromModuleToModule", ctx, stakingtypes.NotBondedPoolName, "dispute", sdk.NewCoins(sdk.NewCoin("loya", stake.QuoRaw(2)))).Return(nil) + bk.On("SendCoinsFromModuleToModule", ctx, stakingtypes.BondedPoolName, "dispute", sdk.NewCoins(sdk.NewCoin("loya", math.NewInt(500000000)))).Return(nil) sk.On("GetRedelegationsFromSrcValidator", ctx, sdk.ValAddress(valAddr1)).Return([]stakingtypes.Redelegation{ {