diff --git a/api/topchain/challenge/challenge.pulsar.go b/api/topchain/challenge/challenge.pulsar.go index 34de8d3..96ff66f 100644 --- a/api/topchain/challenge/challenge.pulsar.go +++ b/api/topchain/challenge/challenge.pulsar.go @@ -17,6 +17,7 @@ var ( fd_Challenge_id protoreflect.FieldDescriptor fd_Challenge_challenger protoreflect.FieldDescriptor fd_Challenge_provider protoreflect.FieldDescriptor + fd_Challenge_deal_id protoreflect.FieldDescriptor fd_Challenge_amount protoreflect.FieldDescriptor fd_Challenge_last_active protoreflect.FieldDescriptor fd_Challenge_challenged_hashes protoreflect.FieldDescriptor @@ -28,6 +29,7 @@ func init() { fd_Challenge_id = md_Challenge.Fields().ByName("id") fd_Challenge_challenger = md_Challenge.Fields().ByName("challenger") fd_Challenge_provider = md_Challenge.Fields().ByName("provider") + fd_Challenge_deal_id = md_Challenge.Fields().ByName("deal_id") fd_Challenge_amount = md_Challenge.Fields().ByName("amount") fd_Challenge_last_active = md_Challenge.Fields().ByName("last_active") fd_Challenge_challenged_hashes = md_Challenge.Fields().ByName("challenged_hashes") @@ -116,6 +118,12 @@ func (x *fastReflection_Challenge) Range(f func(protoreflect.FieldDescriptor, pr return } } + if x.DealId != "" { + value := protoreflect.ValueOfString(x.DealId) + if !f(fd_Challenge_deal_id, value) { + return + } + } if x.Amount != uint64(0) { value := protoreflect.ValueOfUint64(x.Amount) if !f(fd_Challenge_amount, value) { @@ -155,6 +163,8 @@ func (x *fastReflection_Challenge) Has(fd protoreflect.FieldDescriptor) bool { return x.Challenger != "" case "topchain.challenge.Challenge.provider": return x.Provider != "" + case "topchain.challenge.Challenge.deal_id": + return x.DealId != "" case "topchain.challenge.Challenge.amount": return x.Amount != uint64(0) case "topchain.challenge.Challenge.last_active": @@ -183,6 +193,8 @@ func (x *fastReflection_Challenge) Clear(fd protoreflect.FieldDescriptor) { x.Challenger = "" case "topchain.challenge.Challenge.provider": x.Provider = "" + case "topchain.challenge.Challenge.deal_id": + x.DealId = "" case "topchain.challenge.Challenge.amount": x.Amount = uint64(0) case "topchain.challenge.Challenge.last_active": @@ -214,6 +226,9 @@ func (x *fastReflection_Challenge) Get(descriptor protoreflect.FieldDescriptor) case "topchain.challenge.Challenge.provider": value := x.Provider return protoreflect.ValueOfString(value) + case "topchain.challenge.Challenge.deal_id": + value := x.DealId + return protoreflect.ValueOfString(value) case "topchain.challenge.Challenge.amount": value := x.Amount return protoreflect.ValueOfUint64(value) @@ -249,6 +264,8 @@ func (x *fastReflection_Challenge) Set(fd protoreflect.FieldDescriptor, value pr x.Challenger = value.Interface().(string) case "topchain.challenge.Challenge.provider": x.Provider = value.Interface().(string) + case "topchain.challenge.Challenge.deal_id": + x.DealId = value.Interface().(string) case "topchain.challenge.Challenge.amount": x.Amount = value.Uint() case "topchain.challenge.Challenge.last_active": @@ -281,6 +298,8 @@ func (x *fastReflection_Challenge) Mutable(fd protoreflect.FieldDescriptor) prot panic(fmt.Errorf("field challenger of message topchain.challenge.Challenge is not mutable")) case "topchain.challenge.Challenge.provider": panic(fmt.Errorf("field provider of message topchain.challenge.Challenge is not mutable")) + case "topchain.challenge.Challenge.deal_id": + panic(fmt.Errorf("field deal_id of message topchain.challenge.Challenge is not mutable")) case "topchain.challenge.Challenge.amount": panic(fmt.Errorf("field amount of message topchain.challenge.Challenge is not mutable")) case "topchain.challenge.Challenge.last_active": @@ -306,6 +325,8 @@ func (x *fastReflection_Challenge) NewField(fd protoreflect.FieldDescriptor) pro return protoreflect.ValueOfString("") case "topchain.challenge.Challenge.provider": return protoreflect.ValueOfString("") + case "topchain.challenge.Challenge.deal_id": + return protoreflect.ValueOfString("") case "topchain.challenge.Challenge.amount": return protoreflect.ValueOfUint64(uint64(0)) case "topchain.challenge.Challenge.last_active": @@ -393,6 +414,10 @@ func (x *fastReflection_Challenge) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.DealId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.Amount != 0 { n += 1 + runtime.Sov(uint64(x.Amount)) } @@ -437,17 +462,24 @@ func (x *fastReflection_Challenge) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.ChallengedHashes) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChallengedHashes))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a } if x.LastActive != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.LastActive)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x30 } if x.Amount != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Amount)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 + } + if len(x.DealId) > 0 { + i -= len(x.DealId) + copy(dAtA[i:], x.DealId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DealId))) + i-- + dAtA[i] = 0x22 } if len(x.Provider) > 0 { i -= len(x.Provider) @@ -616,6 +648,38 @@ func (x *fastReflection_Challenge) ProtoMethods() *protoiface.Methods { x.Provider = 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 DealId", 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.DealId = 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 Amount", wireType) } @@ -634,7 +698,7 @@ func (x *fastReflection_Challenge) ProtoMethods() *protoiface.Methods { break } } - case 5: + case 6: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastActive", wireType) } @@ -653,7 +717,7 @@ func (x *fastReflection_Challenge) ProtoMethods() *protoiface.Methods { break } } - case 6: + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChallengedHashes", wireType) } @@ -743,9 +807,10 @@ type Challenge struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Challenger string `protobuf:"bytes,2,opt,name=challenger,proto3" json:"challenger,omitempty"` Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` - LastActive uint64 `protobuf:"varint,5,opt,name=last_active,json=lastActive,proto3" json:"last_active,omitempty"` - ChallengedHashes []byte `protobuf:"bytes,6,opt,name=challenged_hashes,json=challengedHashes,proto3" json:"challenged_hashes,omitempty"` + DealId string `protobuf:"bytes,4,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` + Amount uint64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` + LastActive uint64 `protobuf:"varint,6,opt,name=last_active,json=lastActive,proto3" json:"last_active,omitempty"` + ChallengedHashes []byte `protobuf:"bytes,7,opt,name=challenged_hashes,json=challengedHashes,proto3" json:"challenged_hashes,omitempty"` } func (x *Challenge) Reset() { @@ -789,6 +854,13 @@ func (x *Challenge) GetProvider() string { return "" } +func (x *Challenge) GetDealId() string { + if x != nil { + return x.DealId + } + return "" +} + func (x *Challenge) GetAmount() uint64 { if x != nil { return x.Amount @@ -816,31 +888,32 @@ var file_topchain_challenge_challenge_proto_rawDesc = []byte{ 0x0a, 0x22, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, - 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x22, 0xbd, 0x01, 0x0a, 0x09, 0x43, 0x68, 0x61, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x22, 0xd6, 0x01, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, - 0x73, 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x63, - 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x64, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x42, 0xb2, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, - 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, - 0x6e, 0x67, 0x65, 0x42, 0x0e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x68, 0x61, - 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xa2, 0x02, 0x03, 0x54, 0x43, 0x58, 0xaa, 0x02, 0x12, 0x54, - 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0xca, 0x02, 0x12, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x43, 0x68, 0x61, - 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xe2, 0x02, 0x1e, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x5c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x3a, 0x3a, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x10, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x64, 0x48, 0x61, 0x73, 0x68, 0x65, + 0x73, 0x42, 0xb2, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x42, 0x0e, 0x43, 0x68, + 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, + 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x6f, 0x70, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xa2, + 0x02, 0x03, 0x54, 0x43, 0x58, 0xaa, 0x02, 0x12, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xca, 0x02, 0x12, 0x54, 0x6f, 0x70, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xe2, + 0x02, 0x1e, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x43, 0x68, 0x61, 0x6c, 0x6c, + 0x65, 0x6e, 0x67, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x13, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x43, 0x68, 0x61, + 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/topchain/challenge/tx.pulsar.go b/api/topchain/challenge/tx.pulsar.go index dac1fd4..f2ba509 100644 --- a/api/topchain/challenge/tx.pulsar.go +++ b/api/topchain/challenge/tx.pulsar.go @@ -871,49 +871,49 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } -var _ protoreflect.List = (*_MsgChallenge_3_list)(nil) +var _ protoreflect.List = (*_MsgChallenge_4_list)(nil) -type _MsgChallenge_3_list struct { +type _MsgChallenge_4_list struct { list *[]string } -func (x *_MsgChallenge_3_list) Len() int { +func (x *_MsgChallenge_4_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_MsgChallenge_3_list) Get(i int) protoreflect.Value { +func (x *_MsgChallenge_4_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_MsgChallenge_3_list) Set(i int, value protoreflect.Value) { +func (x *_MsgChallenge_4_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_MsgChallenge_3_list) Append(value protoreflect.Value) { +func (x *_MsgChallenge_4_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_MsgChallenge_3_list) AppendMutable() protoreflect.Value { +func (x *_MsgChallenge_4_list) AppendMutable() protoreflect.Value { panic(fmt.Errorf("AppendMutable can not be called on message MsgChallenge at list field VerticesHashes as it is not of Message kind")) } -func (x *_MsgChallenge_3_list) Truncate(n int) { +func (x *_MsgChallenge_4_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_MsgChallenge_3_list) NewElement() protoreflect.Value { +func (x *_MsgChallenge_4_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_MsgChallenge_3_list) IsValid() bool { +func (x *_MsgChallenge_4_list) IsValid() bool { return x.list != nil } @@ -921,6 +921,7 @@ var ( md_MsgChallenge protoreflect.MessageDescriptor fd_MsgChallenge_challenger protoreflect.FieldDescriptor fd_MsgChallenge_provider_id protoreflect.FieldDescriptor + fd_MsgChallenge_deal_id protoreflect.FieldDescriptor fd_MsgChallenge_vertices_hashes protoreflect.FieldDescriptor ) @@ -929,6 +930,7 @@ func init() { md_MsgChallenge = File_topchain_challenge_tx_proto.Messages().ByName("MsgChallenge") fd_MsgChallenge_challenger = md_MsgChallenge.Fields().ByName("challenger") fd_MsgChallenge_provider_id = md_MsgChallenge.Fields().ByName("provider_id") + fd_MsgChallenge_deal_id = md_MsgChallenge.Fields().ByName("deal_id") fd_MsgChallenge_vertices_hashes = md_MsgChallenge.Fields().ByName("vertices_hashes") } @@ -1009,8 +1011,14 @@ func (x *fastReflection_MsgChallenge) Range(f func(protoreflect.FieldDescriptor, return } } + if x.DealId != "" { + value := protoreflect.ValueOfString(x.DealId) + if !f(fd_MsgChallenge_deal_id, value) { + return + } + } if len(x.VerticesHashes) != 0 { - value := protoreflect.ValueOfList(&_MsgChallenge_3_list{list: &x.VerticesHashes}) + value := protoreflect.ValueOfList(&_MsgChallenge_4_list{list: &x.VerticesHashes}) if !f(fd_MsgChallenge_vertices_hashes, value) { return } @@ -1034,6 +1042,8 @@ func (x *fastReflection_MsgChallenge) Has(fd protoreflect.FieldDescriptor) bool return x.Challenger != "" case "topchain.challenge.MsgChallenge.provider_id": return x.ProviderId != "" + case "topchain.challenge.MsgChallenge.deal_id": + return x.DealId != "" case "topchain.challenge.MsgChallenge.vertices_hashes": return len(x.VerticesHashes) != 0 default: @@ -1056,6 +1066,8 @@ func (x *fastReflection_MsgChallenge) Clear(fd protoreflect.FieldDescriptor) { x.Challenger = "" case "topchain.challenge.MsgChallenge.provider_id": x.ProviderId = "" + case "topchain.challenge.MsgChallenge.deal_id": + x.DealId = "" case "topchain.challenge.MsgChallenge.vertices_hashes": x.VerticesHashes = nil default: @@ -1080,11 +1092,14 @@ func (x *fastReflection_MsgChallenge) Get(descriptor protoreflect.FieldDescripto case "topchain.challenge.MsgChallenge.provider_id": value := x.ProviderId return protoreflect.ValueOfString(value) + case "topchain.challenge.MsgChallenge.deal_id": + value := x.DealId + return protoreflect.ValueOfString(value) case "topchain.challenge.MsgChallenge.vertices_hashes": if len(x.VerticesHashes) == 0 { - return protoreflect.ValueOfList(&_MsgChallenge_3_list{}) + return protoreflect.ValueOfList(&_MsgChallenge_4_list{}) } - listValue := &_MsgChallenge_3_list{list: &x.VerticesHashes} + listValue := &_MsgChallenge_4_list{list: &x.VerticesHashes} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -1110,9 +1125,11 @@ func (x *fastReflection_MsgChallenge) Set(fd protoreflect.FieldDescriptor, value x.Challenger = value.Interface().(string) case "topchain.challenge.MsgChallenge.provider_id": x.ProviderId = value.Interface().(string) + case "topchain.challenge.MsgChallenge.deal_id": + x.DealId = value.Interface().(string) case "topchain.challenge.MsgChallenge.vertices_hashes": lv := value.List() - clv := lv.(*_MsgChallenge_3_list) + clv := lv.(*_MsgChallenge_4_list) x.VerticesHashes = *clv.list default: if fd.IsExtension() { @@ -1138,12 +1155,14 @@ func (x *fastReflection_MsgChallenge) Mutable(fd protoreflect.FieldDescriptor) p if x.VerticesHashes == nil { x.VerticesHashes = []string{} } - value := &_MsgChallenge_3_list{list: &x.VerticesHashes} + value := &_MsgChallenge_4_list{list: &x.VerticesHashes} return protoreflect.ValueOfList(value) case "topchain.challenge.MsgChallenge.challenger": panic(fmt.Errorf("field challenger of message topchain.challenge.MsgChallenge is not mutable")) case "topchain.challenge.MsgChallenge.provider_id": panic(fmt.Errorf("field provider_id of message topchain.challenge.MsgChallenge is not mutable")) + case "topchain.challenge.MsgChallenge.deal_id": + panic(fmt.Errorf("field deal_id of message topchain.challenge.MsgChallenge is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.challenge.MsgChallenge")) @@ -1161,9 +1180,11 @@ func (x *fastReflection_MsgChallenge) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "topchain.challenge.MsgChallenge.provider_id": return protoreflect.ValueOfString("") + case "topchain.challenge.MsgChallenge.deal_id": + return protoreflect.ValueOfString("") case "topchain.challenge.MsgChallenge.vertices_hashes": list := []string{} - return protoreflect.ValueOfList(&_MsgChallenge_3_list{list: &list}) + return protoreflect.ValueOfList(&_MsgChallenge_4_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.challenge.MsgChallenge")) @@ -1241,6 +1262,10 @@ func (x *fastReflection_MsgChallenge) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.DealId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if len(x.VerticesHashes) > 0 { for _, s := range x.VerticesHashes { l = len(s) @@ -1282,9 +1307,16 @@ func (x *fastReflection_MsgChallenge) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.VerticesHashes[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VerticesHashes[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } + if len(x.DealId) > 0 { + i -= len(x.DealId) + copy(dAtA[i:], x.DealId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DealId))) + i-- + dAtA[i] = 0x1a + } if len(x.ProviderId) > 0 { i -= len(x.ProviderId) copy(dAtA[i:], x.ProviderId) @@ -1413,6 +1445,38 @@ func (x *fastReflection_MsgChallenge) ProtoMethods() *protoiface.Methods { x.ProviderId = 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 DealId", 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.DealId = 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 VerticesHashes", wireType) } @@ -4777,7 +4841,8 @@ type MsgChallenge struct { Challenger string `protobuf:"bytes,1,opt,name=challenger,proto3" json:"challenger,omitempty"` ProviderId string `protobuf:"bytes,2,opt,name=provider_id,json=providerId,proto3" json:"provider_id,omitempty"` - VerticesHashes []string `protobuf:"bytes,3,rep,name=vertices_hashes,json=verticesHashes,proto3" json:"vertices_hashes,omitempty"` + DealId string `protobuf:"bytes,3,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` + VerticesHashes []string `protobuf:"bytes,4,rep,name=vertices_hashes,json=verticesHashes,proto3" json:"vertices_hashes,omitempty"` } func (x *MsgChallenge) Reset() { @@ -4814,6 +4879,13 @@ func (x *MsgChallenge) GetProviderId() string { return "" } +func (x *MsgChallenge) GetDealId() string { + if x != nil { + return x.DealId + } + return "" +} + func (x *MsgChallenge) GetVerticesHashes() []string { if x != nil { return x.VerticesHashes @@ -5109,94 +5181,96 @@ var file_topchain_challenge_tx_proto_rawDesc = []byte{ 0x65, 0x6e, 0x67, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x89, 0x01, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, + 0xa2, 0x01, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x74, - 0x69, 0x63, 0x65, 0x73, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, - 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x22, 0x39, 0x0a, 0x14, 0x4d, - 0x73, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6c, 0x6c, - 0x65, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x22, 0x96, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x53, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, - 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, - 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x74, - 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x6f, 0x70, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, - 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x52, 0x08, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, - 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, - 0x18, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x16, 0x4d, 0x73, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, + 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x48, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, + 0x6e, 0x67, 0x65, 0x72, 0x22, 0x39, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, + 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, + 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x22, + 0x96, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x21, + 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x49, + 0x64, 0x12, 0x36, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x52, + 0x08, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x53, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x49, 0x64, + 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x74, 0x69, + 0x63, 0x65, 0x73, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, + 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x63, 0x69, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, - 0x6e, 0x67, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6c, - 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x74, 0x69, - 0x63, 0x65, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, - 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, - 0x72, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x65, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, - 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6c, 0x6c, - 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, - 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, - 0x67, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x88, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x23, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, - 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, - 0x20, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, - 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x1a, 0x28, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, - 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, - 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x0b, 0x53, - 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x22, 0x2e, 0x74, 0x6f, 0x70, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, - 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x2a, + 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0x0a, 0x12, + 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, + 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x49, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, + 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0x88, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x74, 0x6f, 0x70, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, - 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x13, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, - 0x73, 0x12, 0x2a, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, - 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x1a, 0x32, 0x2e, + 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x20, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, + 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x1a, 0x28, 0x2e, 0x74, 0x6f, 0x70, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, + 0x4d, 0x73, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x0b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x12, 0x22, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x2a, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x13, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x74, 0x6f, 0x70, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, + 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x1a, 0x32, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x0f, 0x53, 0x65, + 0x74, 0x74, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x26, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, - 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x70, - 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x69, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, - 0x65, 0x6e, 0x67, 0x65, 0x12, 0x26, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, - 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, - 0x74, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x1a, 0x2e, 0x2e, 0x74, - 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, - 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 0x42, 0xab, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x6f, 0x70, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x42, 0x07, - 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x74, 0x6f, 0x70, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x2f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xa2, 0x02, 0x03, 0x54, 0x43, 0x58, - 0xaa, 0x02, 0x12, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6c, - 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xca, 0x02, 0x12, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x5c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xe2, 0x02, 0x1e, 0x54, 0x6f, 0x70, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x54, 0x6f, - 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x6c, + 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x1a, 0x2e, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x2e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, + 0x74, 0x74, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xab, 0x01, 0x0a, + 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x68, + 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x1f, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, + 0x6e, 0x67, 0x65, 0xa2, 0x02, 0x03, 0x54, 0x43, 0x58, 0xaa, 0x02, 0x12, 0x54, 0x6f, 0x70, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0xca, 0x02, + 0x12, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, + 0x6e, 0x67, 0x65, 0xe2, 0x02, 0x1e, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, + 0x3a, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/api/topchain/subscription/deal.pulsar.go b/api/topchain/subscription/deal.pulsar.go index de3e0b5..c150eb0 100644 --- a/api/topchain/subscription/deal.pulsar.go +++ b/api/topchain/subscription/deal.pulsar.go @@ -58,49 +58,49 @@ func (x *_Deal_4_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Deal_10_list)(nil) +var _ protoreflect.List = (*_Deal_12_list)(nil) -type _Deal_10_list struct { +type _Deal_12_list struct { list *[]string } -func (x *_Deal_10_list) Len() int { +func (x *_Deal_12_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Deal_10_list) Get(i int) protoreflect.Value { +func (x *_Deal_12_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Deal_10_list) Set(i int, value protoreflect.Value) { +func (x *_Deal_12_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Deal_10_list) Append(value protoreflect.Value) { +func (x *_Deal_12_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Deal_10_list) AppendMutable() protoreflect.Value { +func (x *_Deal_12_list) AppendMutable() protoreflect.Value { panic(fmt.Errorf("AppendMutable can not be called on message Deal at list field InitialFrontier as it is not of Message kind")) } -func (x *_Deal_10_list) Truncate(n int) { +func (x *_Deal_12_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Deal_10_list) NewElement() protoreflect.Value { +func (x *_Deal_12_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_Deal_10_list) IsValid() bool { +func (x *_Deal_12_list) IsValid() bool { return x.list != nil } @@ -114,7 +114,9 @@ var ( fd_Deal_total_amount protoreflect.FieldDescriptor fd_Deal_available_amount protoreflect.FieldDescriptor fd_Deal_start_block protoreflect.FieldDescriptor - fd_Deal_end_block protoreflect.FieldDescriptor + fd_Deal_epoch_size protoreflect.FieldDescriptor + fd_Deal_num_epochs protoreflect.FieldDescriptor + fd_Deal_reward_per_epoch protoreflect.FieldDescriptor fd_Deal_initial_frontier protoreflect.FieldDescriptor ) @@ -129,7 +131,9 @@ func init() { fd_Deal_total_amount = md_Deal.Fields().ByName("total_amount") fd_Deal_available_amount = md_Deal.Fields().ByName("available_amount") fd_Deal_start_block = md_Deal.Fields().ByName("start_block") - fd_Deal_end_block = md_Deal.Fields().ByName("end_block") + fd_Deal_epoch_size = md_Deal.Fields().ByName("epoch_size") + fd_Deal_num_epochs = md_Deal.Fields().ByName("num_epochs") + fd_Deal_reward_per_epoch = md_Deal.Fields().ByName("reward_per_epoch") fd_Deal_initial_frontier = md_Deal.Fields().ByName("initial_frontier") } @@ -246,14 +250,26 @@ func (x *fastReflection_Deal) Range(f func(protoreflect.FieldDescriptor, protore return } } - if x.EndBlock != uint64(0) { - value := protoreflect.ValueOfUint64(x.EndBlock) - if !f(fd_Deal_end_block, value) { + if x.EpochSize != uint64(0) { + value := protoreflect.ValueOfUint64(x.EpochSize) + if !f(fd_Deal_epoch_size, value) { + return + } + } + if x.NumEpochs != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEpochs) + if !f(fd_Deal_num_epochs, value) { + return + } + } + if x.RewardPerEpoch != uint64(0) { + value := protoreflect.ValueOfUint64(x.RewardPerEpoch) + if !f(fd_Deal_reward_per_epoch, value) { return } } if len(x.InitialFrontier) != 0 { - value := protoreflect.ValueOfList(&_Deal_10_list{list: &x.InitialFrontier}) + value := protoreflect.ValueOfList(&_Deal_12_list{list: &x.InitialFrontier}) if !f(fd_Deal_initial_frontier, value) { return } @@ -289,8 +305,12 @@ func (x *fastReflection_Deal) Has(fd protoreflect.FieldDescriptor) bool { return x.AvailableAmount != uint64(0) case "topchain.subscription.Deal.start_block": return x.StartBlock != uint64(0) - case "topchain.subscription.Deal.end_block": - return x.EndBlock != uint64(0) + case "topchain.subscription.Deal.epoch_size": + return x.EpochSize != uint64(0) + case "topchain.subscription.Deal.num_epochs": + return x.NumEpochs != uint64(0) + case "topchain.subscription.Deal.reward_per_epoch": + return x.RewardPerEpoch != uint64(0) case "topchain.subscription.Deal.initial_frontier": return len(x.InitialFrontier) != 0 default: @@ -325,8 +345,12 @@ func (x *fastReflection_Deal) Clear(fd protoreflect.FieldDescriptor) { x.AvailableAmount = uint64(0) case "topchain.subscription.Deal.start_block": x.StartBlock = uint64(0) - case "topchain.subscription.Deal.end_block": - x.EndBlock = uint64(0) + case "topchain.subscription.Deal.epoch_size": + x.EpochSize = uint64(0) + case "topchain.subscription.Deal.num_epochs": + x.NumEpochs = uint64(0) + case "topchain.subscription.Deal.reward_per_epoch": + x.RewardPerEpoch = uint64(0) case "topchain.subscription.Deal.initial_frontier": x.InitialFrontier = nil default: @@ -372,14 +396,20 @@ func (x *fastReflection_Deal) Get(descriptor protoreflect.FieldDescriptor) proto case "topchain.subscription.Deal.start_block": value := x.StartBlock return protoreflect.ValueOfUint64(value) - case "topchain.subscription.Deal.end_block": - value := x.EndBlock + case "topchain.subscription.Deal.epoch_size": + value := x.EpochSize + return protoreflect.ValueOfUint64(value) + case "topchain.subscription.Deal.num_epochs": + value := x.NumEpochs + return protoreflect.ValueOfUint64(value) + case "topchain.subscription.Deal.reward_per_epoch": + value := x.RewardPerEpoch return protoreflect.ValueOfUint64(value) case "topchain.subscription.Deal.initial_frontier": if len(x.InitialFrontier) == 0 { - return protoreflect.ValueOfList(&_Deal_10_list{}) + return protoreflect.ValueOfList(&_Deal_12_list{}) } - listValue := &_Deal_10_list{list: &x.InitialFrontier} + listValue := &_Deal_12_list{list: &x.InitialFrontier} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -419,11 +449,15 @@ func (x *fastReflection_Deal) Set(fd protoreflect.FieldDescriptor, value protore x.AvailableAmount = value.Uint() case "topchain.subscription.Deal.start_block": x.StartBlock = value.Uint() - case "topchain.subscription.Deal.end_block": - x.EndBlock = value.Uint() + case "topchain.subscription.Deal.epoch_size": + x.EpochSize = value.Uint() + case "topchain.subscription.Deal.num_epochs": + x.NumEpochs = value.Uint() + case "topchain.subscription.Deal.reward_per_epoch": + x.RewardPerEpoch = value.Uint() case "topchain.subscription.Deal.initial_frontier": lv := value.List() - clv := lv.(*_Deal_10_list) + clv := lv.(*_Deal_12_list) x.InitialFrontier = *clv.list default: if fd.IsExtension() { @@ -455,7 +489,7 @@ func (x *fastReflection_Deal) Mutable(fd protoreflect.FieldDescriptor) protorefl if x.InitialFrontier == nil { x.InitialFrontier = []string{} } - value := &_Deal_10_list{list: &x.InitialFrontier} + value := &_Deal_12_list{list: &x.InitialFrontier} return protoreflect.ValueOfList(value) case "topchain.subscription.Deal.id": panic(fmt.Errorf("field id of message topchain.subscription.Deal is not mutable")) @@ -471,8 +505,12 @@ func (x *fastReflection_Deal) Mutable(fd protoreflect.FieldDescriptor) protorefl panic(fmt.Errorf("field available_amount of message topchain.subscription.Deal is not mutable")) case "topchain.subscription.Deal.start_block": panic(fmt.Errorf("field start_block of message topchain.subscription.Deal is not mutable")) - case "topchain.subscription.Deal.end_block": - panic(fmt.Errorf("field end_block of message topchain.subscription.Deal is not mutable")) + case "topchain.subscription.Deal.epoch_size": + panic(fmt.Errorf("field epoch_size of message topchain.subscription.Deal is not mutable")) + case "topchain.subscription.Deal.num_epochs": + panic(fmt.Errorf("field num_epochs of message topchain.subscription.Deal is not mutable")) + case "topchain.subscription.Deal.reward_per_epoch": + panic(fmt.Errorf("field reward_per_epoch of message topchain.subscription.Deal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.Deal")) @@ -503,11 +541,15 @@ func (x *fastReflection_Deal) NewField(fd protoreflect.FieldDescriptor) protoref return protoreflect.ValueOfUint64(uint64(0)) case "topchain.subscription.Deal.start_block": return protoreflect.ValueOfUint64(uint64(0)) - case "topchain.subscription.Deal.end_block": + case "topchain.subscription.Deal.epoch_size": + return protoreflect.ValueOfUint64(uint64(0)) + case "topchain.subscription.Deal.num_epochs": + return protoreflect.ValueOfUint64(uint64(0)) + case "topchain.subscription.Deal.reward_per_epoch": return protoreflect.ValueOfUint64(uint64(0)) case "topchain.subscription.Deal.initial_frontier": list := []string{} - return protoreflect.ValueOfList(&_Deal_10_list{list: &list}) + return protoreflect.ValueOfList(&_Deal_12_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.Deal")) @@ -607,8 +649,14 @@ func (x *fastReflection_Deal) ProtoMethods() *protoiface.Methods { if x.StartBlock != 0 { n += 1 + runtime.Sov(uint64(x.StartBlock)) } - if x.EndBlock != 0 { - n += 1 + runtime.Sov(uint64(x.EndBlock)) + if x.EpochSize != 0 { + n += 1 + runtime.Sov(uint64(x.EpochSize)) + } + if x.NumEpochs != 0 { + n += 1 + runtime.Sov(uint64(x.NumEpochs)) + } + if x.RewardPerEpoch != 0 { + n += 1 + runtime.Sov(uint64(x.RewardPerEpoch)) } if len(x.InitialFrontier) > 0 { for _, s := range x.InitialFrontier { @@ -651,11 +699,21 @@ func (x *fastReflection_Deal) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.InitialFrontier[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InitialFrontier[iNdEx]))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x62 } } - if x.EndBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.EndBlock)) + if x.RewardPerEpoch != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RewardPerEpoch)) + i-- + dAtA[i] = 0x58 + } + if x.NumEpochs != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEpochs)) + i-- + dAtA[i] = 0x50 + } + if x.EpochSize != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochSize)) i-- dAtA[i] = 0x48 } @@ -964,9 +1022,9 @@ func (x *fastReflection_Deal) ProtoMethods() *protoiface.Methods { } case 9: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EpochSize", wireType) } - x.EndBlock = 0 + x.EpochSize = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -976,12 +1034,50 @@ func (x *fastReflection_Deal) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.EndBlock |= uint64(b&0x7F) << shift + x.EpochSize |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) + } + x.NumEpochs = 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.NumEpochs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RewardPerEpoch", wireType) + } + x.RewardPerEpoch = 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.RewardPerEpoch |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitialFrontier", wireType) } @@ -1135,8 +1231,10 @@ type Deal struct { TotalAmount uint64 `protobuf:"varint,6,opt,name=total_amount,json=totalAmount,proto3" json:"total_amount,omitempty"` AvailableAmount uint64 `protobuf:"varint,7,opt,name=available_amount,json=availableAmount,proto3" json:"available_amount,omitempty"` StartBlock uint64 `protobuf:"varint,8,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - EndBlock uint64 `protobuf:"varint,9,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` - InitialFrontier []string `protobuf:"bytes,10,rep,name=initial_frontier,json=initialFrontier,proto3" json:"initial_frontier,omitempty"` + EpochSize uint64 `protobuf:"varint,9,opt,name=epoch_size,json=epochSize,proto3" json:"epoch_size,omitempty"` + NumEpochs uint64 `protobuf:"varint,10,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` + RewardPerEpoch uint64 `protobuf:"varint,11,opt,name=reward_per_epoch,json=rewardPerEpoch,proto3" json:"reward_per_epoch,omitempty"` + InitialFrontier []string `protobuf:"bytes,12,rep,name=initial_frontier,json=initialFrontier,proto3" json:"initial_frontier,omitempty"` } func (x *Deal) Reset() { @@ -1215,9 +1313,23 @@ func (x *Deal) GetStartBlock() uint64 { return 0 } -func (x *Deal) GetEndBlock() uint64 { +func (x *Deal) GetEpochSize() uint64 { + if x != nil { + return x.EpochSize + } + return 0 +} + +func (x *Deal) GetNumEpochs() uint64 { + if x != nil { + return x.NumEpochs + } + return 0 +} + +func (x *Deal) GetRewardPerEpoch() uint64 { if x != nil { - return x.EndBlock + return x.RewardPerEpoch } return 0 } @@ -1235,7 +1347,7 @@ var file_topchain_subscription_deal_proto_rawDesc = []byte{ 0x0a, 0x20, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x65, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd8, 0x03, 0x0a, 0x04, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa3, 0x04, 0x0a, 0x04, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, @@ -1253,31 +1365,36 @@ var file_topchain_subscription_deal_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a, - 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, 0x0a, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x46, 0x72, 0x6f, - 0x6e, 0x74, 0x69, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, - 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0f, 0x0a, - 0x0b, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x49, 0x5a, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, - 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, - 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, - 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x58, 0x50, 0x49, 0x52, - 0x45, 0x44, 0x10, 0x06, 0x42, 0xbf, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x6f, 0x70, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x09, 0x44, 0x65, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x22, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x6f, - 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x54, 0x53, 0x58, 0xaa, 0x02, 0x15, 0x54, 0x6f, 0x70, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0xca, 0x02, 0x15, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x53, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x21, 0x54, 0x6f, 0x70, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, - 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x0a, + 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x65, 0x72, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, + 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, + 0x22, 0x6d, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, + 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x43, 0x48, + 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x49, 0x54, + 0x49, 0x41, 0x4c, 0x49, 0x5a, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, + 0x49, 0x56, 0x45, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, + 0x45, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, + 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x06, 0x42, + 0xbf, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x44, + 0x65, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x74, 0x6f, 0x70, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, + 0x03, 0x54, 0x53, 0x58, 0xaa, 0x02, 0x15, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x15, 0x54, + 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x21, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x54, 0x6f, 0x70, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/topchain/subscription/subscription.pulsar.go b/api/topchain/subscription/subscription.pulsar.go index 6d0d236..a3e16d9 100644 --- a/api/topchain/subscription/subscription.pulsar.go +++ b/api/topchain/subscription/subscription.pulsar.go @@ -17,8 +17,8 @@ var ( fd_Subscription_id protoreflect.FieldDescriptor fd_Subscription_deal_id protoreflect.FieldDescriptor fd_Subscription_provider protoreflect.FieldDescriptor - fd_Subscription_start_block protoreflect.FieldDescriptor - fd_Subscription_end_block protoreflect.FieldDescriptor + fd_Subscription_start_epoch protoreflect.FieldDescriptor + fd_Subscription_end_epoch protoreflect.FieldDescriptor ) func init() { @@ -27,8 +27,8 @@ func init() { fd_Subscription_id = md_Subscription.Fields().ByName("id") fd_Subscription_deal_id = md_Subscription.Fields().ByName("deal_id") fd_Subscription_provider = md_Subscription.Fields().ByName("provider") - fd_Subscription_start_block = md_Subscription.Fields().ByName("start_block") - fd_Subscription_end_block = md_Subscription.Fields().ByName("end_block") + fd_Subscription_start_epoch = md_Subscription.Fields().ByName("start_epoch") + fd_Subscription_end_epoch = md_Subscription.Fields().ByName("end_epoch") } var _ protoreflect.Message = (*fastReflection_Subscription)(nil) @@ -114,15 +114,15 @@ func (x *fastReflection_Subscription) Range(f func(protoreflect.FieldDescriptor, return } } - if x.StartBlock != uint64(0) { - value := protoreflect.ValueOfUint64(x.StartBlock) - if !f(fd_Subscription_start_block, value) { + if x.StartEpoch != uint64(0) { + value := protoreflect.ValueOfUint64(x.StartEpoch) + if !f(fd_Subscription_start_epoch, value) { return } } - if x.EndBlock != uint64(0) { - value := protoreflect.ValueOfUint64(x.EndBlock) - if !f(fd_Subscription_end_block, value) { + if x.EndEpoch != uint64(0) { + value := protoreflect.ValueOfUint64(x.EndEpoch) + if !f(fd_Subscription_end_epoch, value) { return } } @@ -147,10 +147,10 @@ func (x *fastReflection_Subscription) Has(fd protoreflect.FieldDescriptor) bool return x.DealId != "" case "topchain.subscription.Subscription.provider": return x.Provider != "" - case "topchain.subscription.Subscription.start_block": - return x.StartBlock != uint64(0) - case "topchain.subscription.Subscription.end_block": - return x.EndBlock != uint64(0) + case "topchain.subscription.Subscription.start_epoch": + return x.StartEpoch != uint64(0) + case "topchain.subscription.Subscription.end_epoch": + return x.EndEpoch != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.Subscription")) @@ -173,10 +173,10 @@ func (x *fastReflection_Subscription) Clear(fd protoreflect.FieldDescriptor) { x.DealId = "" case "topchain.subscription.Subscription.provider": x.Provider = "" - case "topchain.subscription.Subscription.start_block": - x.StartBlock = uint64(0) - case "topchain.subscription.Subscription.end_block": - x.EndBlock = uint64(0) + case "topchain.subscription.Subscription.start_epoch": + x.StartEpoch = uint64(0) + case "topchain.subscription.Subscription.end_epoch": + x.EndEpoch = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.Subscription")) @@ -202,11 +202,11 @@ func (x *fastReflection_Subscription) Get(descriptor protoreflect.FieldDescripto case "topchain.subscription.Subscription.provider": value := x.Provider return protoreflect.ValueOfString(value) - case "topchain.subscription.Subscription.start_block": - value := x.StartBlock + case "topchain.subscription.Subscription.start_epoch": + value := x.StartEpoch return protoreflect.ValueOfUint64(value) - case "topchain.subscription.Subscription.end_block": - value := x.EndBlock + case "topchain.subscription.Subscription.end_epoch": + value := x.EndEpoch return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { @@ -234,10 +234,10 @@ func (x *fastReflection_Subscription) Set(fd protoreflect.FieldDescriptor, value x.DealId = value.Interface().(string) case "topchain.subscription.Subscription.provider": x.Provider = value.Interface().(string) - case "topchain.subscription.Subscription.start_block": - x.StartBlock = value.Uint() - case "topchain.subscription.Subscription.end_block": - x.EndBlock = value.Uint() + case "topchain.subscription.Subscription.start_epoch": + x.StartEpoch = value.Uint() + case "topchain.subscription.Subscription.end_epoch": + x.EndEpoch = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.Subscription")) @@ -264,10 +264,10 @@ func (x *fastReflection_Subscription) Mutable(fd protoreflect.FieldDescriptor) p panic(fmt.Errorf("field deal_id of message topchain.subscription.Subscription is not mutable")) case "topchain.subscription.Subscription.provider": panic(fmt.Errorf("field provider of message topchain.subscription.Subscription is not mutable")) - case "topchain.subscription.Subscription.start_block": - panic(fmt.Errorf("field start_block of message topchain.subscription.Subscription is not mutable")) - case "topchain.subscription.Subscription.end_block": - panic(fmt.Errorf("field end_block of message topchain.subscription.Subscription is not mutable")) + case "topchain.subscription.Subscription.start_epoch": + panic(fmt.Errorf("field start_epoch of message topchain.subscription.Subscription is not mutable")) + case "topchain.subscription.Subscription.end_epoch": + panic(fmt.Errorf("field end_epoch of message topchain.subscription.Subscription is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.Subscription")) @@ -287,9 +287,9 @@ func (x *fastReflection_Subscription) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "topchain.subscription.Subscription.provider": return protoreflect.ValueOfString("") - case "topchain.subscription.Subscription.start_block": + case "topchain.subscription.Subscription.start_epoch": return protoreflect.ValueOfUint64(uint64(0)) - case "topchain.subscription.Subscription.end_block": + case "topchain.subscription.Subscription.end_epoch": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { @@ -372,11 +372,11 @@ func (x *fastReflection_Subscription) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.StartBlock != 0 { - n += 1 + runtime.Sov(uint64(x.StartBlock)) + if x.StartEpoch != 0 { + n += 1 + runtime.Sov(uint64(x.StartEpoch)) } - if x.EndBlock != 0 { - n += 1 + runtime.Sov(uint64(x.EndBlock)) + if x.EndEpoch != 0 { + n += 1 + runtime.Sov(uint64(x.EndEpoch)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -407,13 +407,13 @@ func (x *fastReflection_Subscription) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.EndBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.EndBlock)) + if x.EndEpoch != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EndEpoch)) i-- dAtA[i] = 0x28 } - if x.StartBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.StartBlock)) + if x.StartEpoch != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.StartEpoch)) i-- dAtA[i] = 0x20 } @@ -585,9 +585,9 @@ func (x *fastReflection_Subscription) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 4: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartBlock", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartEpoch", wireType) } - x.StartBlock = 0 + x.StartEpoch = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -597,16 +597,16 @@ func (x *fastReflection_Subscription) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.StartBlock |= uint64(b&0x7F) << shift + x.StartEpoch |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndEpoch", wireType) } - x.EndBlock = 0 + x.EndEpoch = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -616,7 +616,7 @@ func (x *fastReflection_Subscription) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.EndBlock |= uint64(b&0x7F) << shift + x.EndEpoch |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -677,8 +677,8 @@ type Subscription struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` DealId string `protobuf:"bytes,2,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - StartBlock uint64 `protobuf:"varint,4,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - EndBlock uint64 `protobuf:"varint,5,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` + StartEpoch uint64 `protobuf:"varint,4,opt,name=start_epoch,json=startEpoch,proto3" json:"start_epoch,omitempty"` + EndEpoch uint64 `protobuf:"varint,5,opt,name=end_epoch,json=endEpoch,proto3" json:"end_epoch,omitempty"` } func (x *Subscription) Reset() { @@ -722,16 +722,16 @@ func (x *Subscription) GetProvider() string { return "" } -func (x *Subscription) GetStartBlock() uint64 { +func (x *Subscription) GetStartEpoch() uint64 { if x != nil { - return x.StartBlock + return x.StartEpoch } return 0 } -func (x *Subscription) GetEndBlock() uint64 { +func (x *Subscription) GetEndEpoch() uint64 { if x != nil { - return x.EndBlock + return x.EndEpoch } return 0 } @@ -749,10 +749,10 @@ var file_topchain_subscription_subscription_proto_rawDesc = []byte{ 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x65, 0x6e, 0x64, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0xc7, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x6f, + 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x65, 0x6e, 0x64, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x42, 0xc7, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, diff --git a/api/topchain/subscription/tx.pulsar.go b/api/topchain/subscription/tx.pulsar.go index 10ded0d..3649561 100644 --- a/api/topchain/subscription/tx.pulsar.go +++ b/api/topchain/subscription/tx.pulsar.go @@ -871,49 +871,49 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } -var _ protoreflect.List = (*_MsgCreateDeal_6_list)(nil) +var _ protoreflect.List = (*_MsgCreateDeal_7_list)(nil) -type _MsgCreateDeal_6_list struct { +type _MsgCreateDeal_7_list struct { list *[]string } -func (x *_MsgCreateDeal_6_list) Len() int { +func (x *_MsgCreateDeal_7_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_MsgCreateDeal_6_list) Get(i int) protoreflect.Value { +func (x *_MsgCreateDeal_7_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_MsgCreateDeal_6_list) Set(i int, value protoreflect.Value) { +func (x *_MsgCreateDeal_7_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_MsgCreateDeal_6_list) Append(value protoreflect.Value) { +func (x *_MsgCreateDeal_7_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_MsgCreateDeal_6_list) AppendMutable() protoreflect.Value { +func (x *_MsgCreateDeal_7_list) AppendMutable() protoreflect.Value { panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDeal at list field InitialFrontier as it is not of Message kind")) } -func (x *_MsgCreateDeal_6_list) Truncate(n int) { +func (x *_MsgCreateDeal_7_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_MsgCreateDeal_6_list) NewElement() protoreflect.Value { +func (x *_MsgCreateDeal_7_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_MsgCreateDeal_6_list) IsValid() bool { +func (x *_MsgCreateDeal_7_list) IsValid() bool { return x.list != nil } @@ -923,7 +923,8 @@ var ( fd_MsgCreateDeal_cro_id protoreflect.FieldDescriptor fd_MsgCreateDeal_amount protoreflect.FieldDescriptor fd_MsgCreateDeal_start_block protoreflect.FieldDescriptor - fd_MsgCreateDeal_end_block protoreflect.FieldDescriptor + fd_MsgCreateDeal_epoch_size protoreflect.FieldDescriptor + fd_MsgCreateDeal_num_epochs protoreflect.FieldDescriptor fd_MsgCreateDeal_initial_frontier protoreflect.FieldDescriptor ) @@ -934,7 +935,8 @@ func init() { fd_MsgCreateDeal_cro_id = md_MsgCreateDeal.Fields().ByName("cro_id") fd_MsgCreateDeal_amount = md_MsgCreateDeal.Fields().ByName("amount") fd_MsgCreateDeal_start_block = md_MsgCreateDeal.Fields().ByName("start_block") - fd_MsgCreateDeal_end_block = md_MsgCreateDeal.Fields().ByName("end_block") + fd_MsgCreateDeal_epoch_size = md_MsgCreateDeal.Fields().ByName("epoch_size") + fd_MsgCreateDeal_num_epochs = md_MsgCreateDeal.Fields().ByName("num_epochs") fd_MsgCreateDeal_initial_frontier = md_MsgCreateDeal.Fields().ByName("initial_frontier") } @@ -1027,14 +1029,20 @@ func (x *fastReflection_MsgCreateDeal) Range(f func(protoreflect.FieldDescriptor return } } - if x.EndBlock != uint64(0) { - value := protoreflect.ValueOfUint64(x.EndBlock) - if !f(fd_MsgCreateDeal_end_block, value) { + if x.EpochSize != uint64(0) { + value := protoreflect.ValueOfUint64(x.EpochSize) + if !f(fd_MsgCreateDeal_epoch_size, value) { + return + } + } + if x.NumEpochs != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEpochs) + if !f(fd_MsgCreateDeal_num_epochs, value) { return } } if len(x.InitialFrontier) != 0 { - value := protoreflect.ValueOfList(&_MsgCreateDeal_6_list{list: &x.InitialFrontier}) + value := protoreflect.ValueOfList(&_MsgCreateDeal_7_list{list: &x.InitialFrontier}) if !f(fd_MsgCreateDeal_initial_frontier, value) { return } @@ -1062,8 +1070,10 @@ func (x *fastReflection_MsgCreateDeal) Has(fd protoreflect.FieldDescriptor) bool return x.Amount != uint64(0) case "topchain.subscription.MsgCreateDeal.start_block": return x.StartBlock != uint64(0) - case "topchain.subscription.MsgCreateDeal.end_block": - return x.EndBlock != uint64(0) + case "topchain.subscription.MsgCreateDeal.epoch_size": + return x.EpochSize != uint64(0) + case "topchain.subscription.MsgCreateDeal.num_epochs": + return x.NumEpochs != uint64(0) case "topchain.subscription.MsgCreateDeal.initial_frontier": return len(x.InitialFrontier) != 0 default: @@ -1090,8 +1100,10 @@ func (x *fastReflection_MsgCreateDeal) Clear(fd protoreflect.FieldDescriptor) { x.Amount = uint64(0) case "topchain.subscription.MsgCreateDeal.start_block": x.StartBlock = uint64(0) - case "topchain.subscription.MsgCreateDeal.end_block": - x.EndBlock = uint64(0) + case "topchain.subscription.MsgCreateDeal.epoch_size": + x.EpochSize = uint64(0) + case "topchain.subscription.MsgCreateDeal.num_epochs": + x.NumEpochs = uint64(0) case "topchain.subscription.MsgCreateDeal.initial_frontier": x.InitialFrontier = nil default: @@ -1122,14 +1134,17 @@ func (x *fastReflection_MsgCreateDeal) Get(descriptor protoreflect.FieldDescript case "topchain.subscription.MsgCreateDeal.start_block": value := x.StartBlock return protoreflect.ValueOfUint64(value) - case "topchain.subscription.MsgCreateDeal.end_block": - value := x.EndBlock + case "topchain.subscription.MsgCreateDeal.epoch_size": + value := x.EpochSize + return protoreflect.ValueOfUint64(value) + case "topchain.subscription.MsgCreateDeal.num_epochs": + value := x.NumEpochs return protoreflect.ValueOfUint64(value) case "topchain.subscription.MsgCreateDeal.initial_frontier": if len(x.InitialFrontier) == 0 { - return protoreflect.ValueOfList(&_MsgCreateDeal_6_list{}) + return protoreflect.ValueOfList(&_MsgCreateDeal_7_list{}) } - listValue := &_MsgCreateDeal_6_list{list: &x.InitialFrontier} + listValue := &_MsgCreateDeal_7_list{list: &x.InitialFrontier} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -1159,11 +1174,13 @@ func (x *fastReflection_MsgCreateDeal) Set(fd protoreflect.FieldDescriptor, valu x.Amount = value.Uint() case "topchain.subscription.MsgCreateDeal.start_block": x.StartBlock = value.Uint() - case "topchain.subscription.MsgCreateDeal.end_block": - x.EndBlock = value.Uint() + case "topchain.subscription.MsgCreateDeal.epoch_size": + x.EpochSize = value.Uint() + case "topchain.subscription.MsgCreateDeal.num_epochs": + x.NumEpochs = value.Uint() case "topchain.subscription.MsgCreateDeal.initial_frontier": lv := value.List() - clv := lv.(*_MsgCreateDeal_6_list) + clv := lv.(*_MsgCreateDeal_7_list) x.InitialFrontier = *clv.list default: if fd.IsExtension() { @@ -1189,7 +1206,7 @@ func (x *fastReflection_MsgCreateDeal) Mutable(fd protoreflect.FieldDescriptor) if x.InitialFrontier == nil { x.InitialFrontier = []string{} } - value := &_MsgCreateDeal_6_list{list: &x.InitialFrontier} + value := &_MsgCreateDeal_7_list{list: &x.InitialFrontier} return protoreflect.ValueOfList(value) case "topchain.subscription.MsgCreateDeal.requester": panic(fmt.Errorf("field requester of message topchain.subscription.MsgCreateDeal is not mutable")) @@ -1199,8 +1216,10 @@ func (x *fastReflection_MsgCreateDeal) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field amount of message topchain.subscription.MsgCreateDeal is not mutable")) case "topchain.subscription.MsgCreateDeal.start_block": panic(fmt.Errorf("field start_block of message topchain.subscription.MsgCreateDeal is not mutable")) - case "topchain.subscription.MsgCreateDeal.end_block": - panic(fmt.Errorf("field end_block of message topchain.subscription.MsgCreateDeal is not mutable")) + case "topchain.subscription.MsgCreateDeal.epoch_size": + panic(fmt.Errorf("field epoch_size of message topchain.subscription.MsgCreateDeal is not mutable")) + case "topchain.subscription.MsgCreateDeal.num_epochs": + panic(fmt.Errorf("field num_epochs of message topchain.subscription.MsgCreateDeal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgCreateDeal")) @@ -1222,11 +1241,13 @@ func (x *fastReflection_MsgCreateDeal) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfUint64(uint64(0)) case "topchain.subscription.MsgCreateDeal.start_block": return protoreflect.ValueOfUint64(uint64(0)) - case "topchain.subscription.MsgCreateDeal.end_block": + case "topchain.subscription.MsgCreateDeal.epoch_size": + return protoreflect.ValueOfUint64(uint64(0)) + case "topchain.subscription.MsgCreateDeal.num_epochs": return protoreflect.ValueOfUint64(uint64(0)) case "topchain.subscription.MsgCreateDeal.initial_frontier": list := []string{} - return protoreflect.ValueOfList(&_MsgCreateDeal_6_list{list: &list}) + return protoreflect.ValueOfList(&_MsgCreateDeal_7_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgCreateDeal")) @@ -1310,8 +1331,11 @@ func (x *fastReflection_MsgCreateDeal) ProtoMethods() *protoiface.Methods { if x.StartBlock != 0 { n += 1 + runtime.Sov(uint64(x.StartBlock)) } - if x.EndBlock != 0 { - n += 1 + runtime.Sov(uint64(x.EndBlock)) + if x.EpochSize != 0 { + n += 1 + runtime.Sov(uint64(x.EpochSize)) + } + if x.NumEpochs != 0 { + n += 1 + runtime.Sov(uint64(x.NumEpochs)) } if len(x.InitialFrontier) > 0 { for _, s := range x.InitialFrontier { @@ -1354,11 +1378,16 @@ func (x *fastReflection_MsgCreateDeal) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.InitialFrontier[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InitialFrontier[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a } } - if x.EndBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.EndBlock)) + if x.NumEpochs != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEpochs)) + i-- + dAtA[i] = 0x30 + } + if x.EpochSize != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochSize)) i-- dAtA[i] = 0x28 } @@ -1539,9 +1568,9 @@ func (x *fastReflection_MsgCreateDeal) ProtoMethods() *protoiface.Methods { } case 5: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EpochSize", wireType) } - x.EndBlock = 0 + x.EpochSize = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1551,12 +1580,31 @@ func (x *fastReflection_MsgCreateDeal) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.EndBlock |= uint64(b&0x7F) << shift + x.EpochSize |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) + } + x.NumEpochs = 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.NumEpochs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitialFrontier", wireType) } @@ -2889,7 +2937,8 @@ var ( fd_MsgUpdateDeal_deal_id protoreflect.FieldDescriptor fd_MsgUpdateDeal_amount protoreflect.FieldDescriptor fd_MsgUpdateDeal_start_block protoreflect.FieldDescriptor - fd_MsgUpdateDeal_end_block protoreflect.FieldDescriptor + fd_MsgUpdateDeal_epoch_size protoreflect.FieldDescriptor + fd_MsgUpdateDeal_num_epochs protoreflect.FieldDescriptor ) func init() { @@ -2899,7 +2948,8 @@ func init() { fd_MsgUpdateDeal_deal_id = md_MsgUpdateDeal.Fields().ByName("deal_id") fd_MsgUpdateDeal_amount = md_MsgUpdateDeal.Fields().ByName("amount") fd_MsgUpdateDeal_start_block = md_MsgUpdateDeal.Fields().ByName("start_block") - fd_MsgUpdateDeal_end_block = md_MsgUpdateDeal.Fields().ByName("end_block") + fd_MsgUpdateDeal_epoch_size = md_MsgUpdateDeal.Fields().ByName("epoch_size") + fd_MsgUpdateDeal_num_epochs = md_MsgUpdateDeal.Fields().ByName("num_epochs") } var _ protoreflect.Message = (*fastReflection_MsgUpdateDeal)(nil) @@ -2991,9 +3041,15 @@ func (x *fastReflection_MsgUpdateDeal) Range(f func(protoreflect.FieldDescriptor return } } - if x.EndBlock != uint64(0) { - value := protoreflect.ValueOfUint64(x.EndBlock) - if !f(fd_MsgUpdateDeal_end_block, value) { + if x.EpochSize != uint64(0) { + value := protoreflect.ValueOfUint64(x.EpochSize) + if !f(fd_MsgUpdateDeal_epoch_size, value) { + return + } + } + if x.NumEpochs != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEpochs) + if !f(fd_MsgUpdateDeal_num_epochs, value) { return } } @@ -3020,8 +3076,10 @@ func (x *fastReflection_MsgUpdateDeal) Has(fd protoreflect.FieldDescriptor) bool return x.Amount != uint64(0) case "topchain.subscription.MsgUpdateDeal.start_block": return x.StartBlock != uint64(0) - case "topchain.subscription.MsgUpdateDeal.end_block": - return x.EndBlock != uint64(0) + case "topchain.subscription.MsgUpdateDeal.epoch_size": + return x.EpochSize != uint64(0) + case "topchain.subscription.MsgUpdateDeal.num_epochs": + return x.NumEpochs != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgUpdateDeal")) @@ -3046,8 +3104,10 @@ func (x *fastReflection_MsgUpdateDeal) Clear(fd protoreflect.FieldDescriptor) { x.Amount = uint64(0) case "topchain.subscription.MsgUpdateDeal.start_block": x.StartBlock = uint64(0) - case "topchain.subscription.MsgUpdateDeal.end_block": - x.EndBlock = uint64(0) + case "topchain.subscription.MsgUpdateDeal.epoch_size": + x.EpochSize = uint64(0) + case "topchain.subscription.MsgUpdateDeal.num_epochs": + x.NumEpochs = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgUpdateDeal")) @@ -3076,8 +3136,11 @@ func (x *fastReflection_MsgUpdateDeal) Get(descriptor protoreflect.FieldDescript case "topchain.subscription.MsgUpdateDeal.start_block": value := x.StartBlock return protoreflect.ValueOfUint64(value) - case "topchain.subscription.MsgUpdateDeal.end_block": - value := x.EndBlock + case "topchain.subscription.MsgUpdateDeal.epoch_size": + value := x.EpochSize + return protoreflect.ValueOfUint64(value) + case "topchain.subscription.MsgUpdateDeal.num_epochs": + value := x.NumEpochs return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { @@ -3107,8 +3170,10 @@ func (x *fastReflection_MsgUpdateDeal) Set(fd protoreflect.FieldDescriptor, valu x.Amount = value.Uint() case "topchain.subscription.MsgUpdateDeal.start_block": x.StartBlock = value.Uint() - case "topchain.subscription.MsgUpdateDeal.end_block": - x.EndBlock = value.Uint() + case "topchain.subscription.MsgUpdateDeal.epoch_size": + x.EpochSize = value.Uint() + case "topchain.subscription.MsgUpdateDeal.num_epochs": + x.NumEpochs = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgUpdateDeal")) @@ -3137,8 +3202,10 @@ func (x *fastReflection_MsgUpdateDeal) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field amount of message topchain.subscription.MsgUpdateDeal is not mutable")) case "topchain.subscription.MsgUpdateDeal.start_block": panic(fmt.Errorf("field start_block of message topchain.subscription.MsgUpdateDeal is not mutable")) - case "topchain.subscription.MsgUpdateDeal.end_block": - panic(fmt.Errorf("field end_block of message topchain.subscription.MsgUpdateDeal is not mutable")) + case "topchain.subscription.MsgUpdateDeal.epoch_size": + panic(fmt.Errorf("field epoch_size of message topchain.subscription.MsgUpdateDeal is not mutable")) + case "topchain.subscription.MsgUpdateDeal.num_epochs": + panic(fmt.Errorf("field num_epochs of message topchain.subscription.MsgUpdateDeal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgUpdateDeal")) @@ -3160,7 +3227,9 @@ func (x *fastReflection_MsgUpdateDeal) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfUint64(uint64(0)) case "topchain.subscription.MsgUpdateDeal.start_block": return protoreflect.ValueOfUint64(uint64(0)) - case "topchain.subscription.MsgUpdateDeal.end_block": + case "topchain.subscription.MsgUpdateDeal.epoch_size": + return protoreflect.ValueOfUint64(uint64(0)) + case "topchain.subscription.MsgUpdateDeal.num_epochs": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { @@ -3245,8 +3314,11 @@ func (x *fastReflection_MsgUpdateDeal) ProtoMethods() *protoiface.Methods { if x.StartBlock != 0 { n += 1 + runtime.Sov(uint64(x.StartBlock)) } - if x.EndBlock != 0 { - n += 1 + runtime.Sov(uint64(x.EndBlock)) + if x.EpochSize != 0 { + n += 1 + runtime.Sov(uint64(x.EpochSize)) + } + if x.NumEpochs != 0 { + n += 1 + runtime.Sov(uint64(x.NumEpochs)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -3277,8 +3349,13 @@ func (x *fastReflection_MsgUpdateDeal) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.EndBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.EndBlock)) + if x.NumEpochs != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEpochs)) + i-- + dAtA[i] = 0x30 + } + if x.EpochSize != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochSize)) i-- dAtA[i] = 0x28 } @@ -3459,9 +3536,28 @@ func (x *fastReflection_MsgUpdateDeal) ProtoMethods() *protoiface.Methods { } case 5: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EpochSize", wireType) + } + x.EpochSize = 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.EpochSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) } - x.EndBlock = 0 + x.NumEpochs = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3471,7 +3567,7 @@ func (x *fastReflection_MsgUpdateDeal) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.EndBlock |= uint64(b&0x7F) << shift + x.NumEpochs |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7527,170 +7623,1858 @@ func (x *fastReflection_MsgSubmitProgressResponse) ProtoMethods() *protoiface.Me } } -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: topchain/subscription/tx.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +var ( + md_MsgClaimRewards protoreflect.MessageDescriptor + fd_MsgClaimRewards_provider protoreflect.FieldDescriptor + fd_MsgClaimRewards_subscription_id protoreflect.FieldDescriptor ) -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // NOTE: All parameters must be supplied. - Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *MsgUpdateParams) Reset() { - *x = MsgUpdateParams{} - if protoimpl.UnsafeEnabled { - mi := &file_topchain_subscription_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func init() { + file_topchain_subscription_tx_proto_init() + md_MsgClaimRewards = File_topchain_subscription_tx_proto.Messages().ByName("MsgClaimRewards") + fd_MsgClaimRewards_provider = md_MsgClaimRewards.Fields().ByName("provider") + fd_MsgClaimRewards_subscription_id = md_MsgClaimRewards.Fields().ByName("subscription_id") } -func (x *MsgUpdateParams) String() string { - return protoimpl.X.MessageStringOf(x) -} +var _ protoreflect.Message = (*fastReflection_MsgClaimRewards)(nil) -func (*MsgUpdateParams) ProtoMessage() {} +type fastReflection_MsgClaimRewards MsgClaimRewards -// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{0} +func (x *MsgClaimRewards) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimRewards)(x) } -func (x *MsgUpdateParams) GetAuthority() string { - if x != nil { - return x.Authority +func (x *MsgClaimRewards) slowProtoReflect() protoreflect.Message { + mi := &file_topchain_subscription_tx_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (x *MsgUpdateParams) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} +var _fastReflection_MsgClaimRewards_messageType fastReflection_MsgClaimRewards_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimRewards_messageType{} -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} +type fastReflection_MsgClaimRewards_messageType struct{} -func (x *MsgUpdateParamsResponse) Reset() { - *x = MsgUpdateParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_topchain_subscription_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (x fastReflection_MsgClaimRewards_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimRewards)(nil) } - -func (x *MsgUpdateParamsResponse) String() string { - return protoimpl.X.MessageStringOf(x) +func (x fastReflection_MsgClaimRewards_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimRewards) } - -func (*MsgUpdateParamsResponse) ProtoMessage() {} - -// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{1} +func (x fastReflection_MsgClaimRewards_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimRewards } -type MsgCreateDeal struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Requester string `protobuf:"bytes,1,opt,name=requester,proto3" json:"requester,omitempty"` - CroId string `protobuf:"bytes,2,opt,name=cro_id,json=croId,proto3" json:"cro_id,omitempty"` - Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` - StartBlock uint64 `protobuf:"varint,4,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - EndBlock uint64 `protobuf:"varint,5,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` - InitialFrontier []string `protobuf:"bytes,6,rep,name=initial_frontier,json=initialFrontier,proto3" json:"initial_frontier,omitempty"` +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimRewards) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimRewards } -func (x *MsgCreateDeal) Reset() { - *x = MsgCreateDeal{} - if protoimpl.UnsafeEnabled { - mi := &file_topchain_subscription_tx_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +// 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_MsgClaimRewards) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimRewards_messageType } -func (x *MsgCreateDeal) String() string { - return protoimpl.X.MessageStringOf(x) +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimRewards) New() protoreflect.Message { + return new(fastReflection_MsgClaimRewards) } -func (*MsgCreateDeal) ProtoMessage() {} - -// Deprecated: Use MsgCreateDeal.ProtoReflect.Descriptor instead. -func (*MsgCreateDeal) Descriptor() ([]byte, []int) { - return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{2} +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimRewards) Interface() protoreflect.ProtoMessage { + return (*MsgClaimRewards)(x) } -func (x *MsgCreateDeal) GetRequester() string { - if x != nil { - return x.Requester +// 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_MsgClaimRewards) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Provider != "" { + value := protoreflect.ValueOfString(x.Provider) + if !f(fd_MsgClaimRewards_provider, value) { + return + } } - return "" -} - -func (x *MsgCreateDeal) GetCroId() string { - if x != nil { - return x.CroId + if x.SubscriptionId != "" { + value := protoreflect.ValueOfString(x.SubscriptionId) + if !f(fd_MsgClaimRewards_subscription_id, value) { + return + } } - return "" } -func (x *MsgCreateDeal) GetAmount() uint64 { - if x != nil { - return x.Amount +// 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_MsgClaimRewards) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "topchain.subscription.MsgClaimRewards.provider": + return x.Provider != "" + case "topchain.subscription.MsgClaimRewards.subscription_id": + return x.SubscriptionId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewards")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewards does not contain field %s", fd.FullName())) } - return 0 } -func (x *MsgCreateDeal) GetStartBlock() uint64 { - if x != nil { - return x.StartBlock +// 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_MsgClaimRewards) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "topchain.subscription.MsgClaimRewards.provider": + x.Provider = "" + case "topchain.subscription.MsgClaimRewards.subscription_id": + x.SubscriptionId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewards")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewards does not contain field %s", fd.FullName())) } - return 0 } -func (x *MsgCreateDeal) GetEndBlock() uint64 { - if x != nil { - return x.EndBlock +// 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_MsgClaimRewards) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "topchain.subscription.MsgClaimRewards.provider": + value := x.Provider + return protoreflect.ValueOfString(value) + case "topchain.subscription.MsgClaimRewards.subscription_id": + value := x.SubscriptionId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewards")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewards does not contain field %s", descriptor.FullName())) } - return 0 } -func (x *MsgCreateDeal) GetInitialFrontier() []string { - if x != nil { - return x.InitialFrontier +// 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_MsgClaimRewards) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "topchain.subscription.MsgClaimRewards.provider": + x.Provider = value.Interface().(string) + case "topchain.subscription.MsgClaimRewards.subscription_id": + x.SubscriptionId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewards")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewards does not contain field %s", fd.FullName())) } - return nil } -type MsgCreateDealResponse struct { - state protoimpl.MessageState +// 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_MsgClaimRewards) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "topchain.subscription.MsgClaimRewards.provider": + panic(fmt.Errorf("field provider of message topchain.subscription.MsgClaimRewards is not mutable")) + case "topchain.subscription.MsgClaimRewards.subscription_id": + panic(fmt.Errorf("field subscription_id of message topchain.subscription.MsgClaimRewards is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewards")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewards 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_MsgClaimRewards) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "topchain.subscription.MsgClaimRewards.provider": + return protoreflect.ValueOfString("") + case "topchain.subscription.MsgClaimRewards.subscription_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewards")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewards 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_MsgClaimRewards) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in topchain.subscription.MsgClaimRewards", 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_MsgClaimRewards) 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_MsgClaimRewards) 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_MsgClaimRewards) 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_MsgClaimRewards) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimRewards) + 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.Provider) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SubscriptionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(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().(*MsgClaimRewards) + 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 len(x.SubscriptionId) > 0 { + i -= len(x.SubscriptionId) + copy(dAtA[i:], x.SubscriptionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SubscriptionId))) + i-- + dAtA[i] = 0x12 + } + if len(x.Provider) > 0 { + i -= len(x.Provider) + copy(dAtA[i:], x.Provider) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Provider))) + 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().(*MsgClaimRewards) + 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: MsgClaimRewards: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimRewards: 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 Provider", 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.Provider = 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 SubscriptionId", 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.SubscriptionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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_MsgClaimRewardsResponse protoreflect.MessageDescriptor +) + +func init() { + file_topchain_subscription_tx_proto_init() + md_MsgClaimRewardsResponse = File_topchain_subscription_tx_proto.Messages().ByName("MsgClaimRewardsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaimRewardsResponse)(nil) + +type fastReflection_MsgClaimRewardsResponse MsgClaimRewardsResponse + +func (x *MsgClaimRewardsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimRewardsResponse)(x) +} + +func (x *MsgClaimRewardsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_topchain_subscription_tx_proto_msgTypes[17] + 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_MsgClaimRewardsResponse_messageType fastReflection_MsgClaimRewardsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimRewardsResponse_messageType{} + +type fastReflection_MsgClaimRewardsResponse_messageType struct{} + +func (x fastReflection_MsgClaimRewardsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimRewardsResponse)(nil) +} +func (x fastReflection_MsgClaimRewardsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimRewardsResponse) +} +func (x fastReflection_MsgClaimRewardsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimRewardsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimRewardsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimRewardsResponse +} + +// 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_MsgClaimRewardsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimRewardsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimRewardsResponse) New() protoreflect.Message { + return new(fastReflection_MsgClaimRewardsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimRewardsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClaimRewardsResponse)(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_MsgClaimRewardsResponse) 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_MsgClaimRewardsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewardsResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewardsResponse 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_MsgClaimRewardsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewardsResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewardsResponse 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_MsgClaimRewardsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewardsResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewardsResponse 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_MsgClaimRewardsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewardsResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewardsResponse 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_MsgClaimRewardsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewardsResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewardsResponse 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_MsgClaimRewardsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgClaimRewardsResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgClaimRewardsResponse 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_MsgClaimRewardsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in topchain.subscription.MsgClaimRewardsResponse", 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_MsgClaimRewardsResponse) 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_MsgClaimRewardsResponse) 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_MsgClaimRewardsResponse) 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_MsgClaimRewardsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimRewardsResponse) + 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().(*MsgClaimRewardsResponse) + 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().(*MsgClaimRewardsResponse) + 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: MsgClaimRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimRewardsResponse: 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_MsgWithdrawResidue protoreflect.MessageDescriptor + fd_MsgWithdrawResidue_requester protoreflect.FieldDescriptor + fd_MsgWithdrawResidue_deal_id protoreflect.FieldDescriptor +) + +func init() { + file_topchain_subscription_tx_proto_init() + md_MsgWithdrawResidue = File_topchain_subscription_tx_proto.Messages().ByName("MsgWithdrawResidue") + fd_MsgWithdrawResidue_requester = md_MsgWithdrawResidue.Fields().ByName("requester") + fd_MsgWithdrawResidue_deal_id = md_MsgWithdrawResidue.Fields().ByName("deal_id") +} + +var _ protoreflect.Message = (*fastReflection_MsgWithdrawResidue)(nil) + +type fastReflection_MsgWithdrawResidue MsgWithdrawResidue + +func (x *MsgWithdrawResidue) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgWithdrawResidue)(x) +} + +func (x *MsgWithdrawResidue) slowProtoReflect() protoreflect.Message { + mi := &file_topchain_subscription_tx_proto_msgTypes[18] + 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_MsgWithdrawResidue_messageType fastReflection_MsgWithdrawResidue_messageType +var _ protoreflect.MessageType = fastReflection_MsgWithdrawResidue_messageType{} + +type fastReflection_MsgWithdrawResidue_messageType struct{} + +func (x fastReflection_MsgWithdrawResidue_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgWithdrawResidue)(nil) +} +func (x fastReflection_MsgWithdrawResidue_messageType) New() protoreflect.Message { + return new(fastReflection_MsgWithdrawResidue) +} +func (x fastReflection_MsgWithdrawResidue_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgWithdrawResidue +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgWithdrawResidue) Descriptor() protoreflect.MessageDescriptor { + return md_MsgWithdrawResidue +} + +// 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_MsgWithdrawResidue) Type() protoreflect.MessageType { + return _fastReflection_MsgWithdrawResidue_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgWithdrawResidue) New() protoreflect.Message { + return new(fastReflection_MsgWithdrawResidue) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgWithdrawResidue) Interface() protoreflect.ProtoMessage { + return (*MsgWithdrawResidue)(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_MsgWithdrawResidue) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Requester != "" { + value := protoreflect.ValueOfString(x.Requester) + if !f(fd_MsgWithdrawResidue_requester, value) { + return + } + } + if x.DealId != "" { + value := protoreflect.ValueOfString(x.DealId) + if !f(fd_MsgWithdrawResidue_deal_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_MsgWithdrawResidue) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "topchain.subscription.MsgWithdrawResidue.requester": + return x.Requester != "" + case "topchain.subscription.MsgWithdrawResidue.deal_id": + return x.DealId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidue")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidue 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_MsgWithdrawResidue) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "topchain.subscription.MsgWithdrawResidue.requester": + x.Requester = "" + case "topchain.subscription.MsgWithdrawResidue.deal_id": + x.DealId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidue")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidue 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_MsgWithdrawResidue) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "topchain.subscription.MsgWithdrawResidue.requester": + value := x.Requester + return protoreflect.ValueOfString(value) + case "topchain.subscription.MsgWithdrawResidue.deal_id": + value := x.DealId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidue")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidue 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_MsgWithdrawResidue) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "topchain.subscription.MsgWithdrawResidue.requester": + x.Requester = value.Interface().(string) + case "topchain.subscription.MsgWithdrawResidue.deal_id": + x.DealId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidue")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidue 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_MsgWithdrawResidue) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "topchain.subscription.MsgWithdrawResidue.requester": + panic(fmt.Errorf("field requester of message topchain.subscription.MsgWithdrawResidue is not mutable")) + case "topchain.subscription.MsgWithdrawResidue.deal_id": + panic(fmt.Errorf("field deal_id of message topchain.subscription.MsgWithdrawResidue is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidue")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidue 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_MsgWithdrawResidue) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "topchain.subscription.MsgWithdrawResidue.requester": + return protoreflect.ValueOfString("") + case "topchain.subscription.MsgWithdrawResidue.deal_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidue")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidue 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_MsgWithdrawResidue) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in topchain.subscription.MsgWithdrawResidue", 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_MsgWithdrawResidue) 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_MsgWithdrawResidue) 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_MsgWithdrawResidue) 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_MsgWithdrawResidue) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgWithdrawResidue) + 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.Requester) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DealId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(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().(*MsgWithdrawResidue) + 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 len(x.DealId) > 0 { + i -= len(x.DealId) + copy(dAtA[i:], x.DealId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DealId))) + i-- + dAtA[i] = 0x12 + } + if len(x.Requester) > 0 { + i -= len(x.Requester) + copy(dAtA[i:], x.Requester) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Requester))) + 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().(*MsgWithdrawResidue) + 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: MsgWithdrawResidue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgWithdrawResidue: 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 Requester", 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.Requester = 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 DealId", 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.DealId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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_MsgWithdrawResidueResponse protoreflect.MessageDescriptor +) + +func init() { + file_topchain_subscription_tx_proto_init() + md_MsgWithdrawResidueResponse = File_topchain_subscription_tx_proto.Messages().ByName("MsgWithdrawResidueResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgWithdrawResidueResponse)(nil) + +type fastReflection_MsgWithdrawResidueResponse MsgWithdrawResidueResponse + +func (x *MsgWithdrawResidueResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgWithdrawResidueResponse)(x) +} + +func (x *MsgWithdrawResidueResponse) slowProtoReflect() protoreflect.Message { + mi := &file_topchain_subscription_tx_proto_msgTypes[19] + 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_MsgWithdrawResidueResponse_messageType fastReflection_MsgWithdrawResidueResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgWithdrawResidueResponse_messageType{} + +type fastReflection_MsgWithdrawResidueResponse_messageType struct{} + +func (x fastReflection_MsgWithdrawResidueResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgWithdrawResidueResponse)(nil) +} +func (x fastReflection_MsgWithdrawResidueResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgWithdrawResidueResponse) +} +func (x fastReflection_MsgWithdrawResidueResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgWithdrawResidueResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgWithdrawResidueResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgWithdrawResidueResponse +} + +// 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_MsgWithdrawResidueResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgWithdrawResidueResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgWithdrawResidueResponse) New() protoreflect.Message { + return new(fastReflection_MsgWithdrawResidueResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgWithdrawResidueResponse) Interface() protoreflect.ProtoMessage { + return (*MsgWithdrawResidueResponse)(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_MsgWithdrawResidueResponse) 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_MsgWithdrawResidueResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidueResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidueResponse 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_MsgWithdrawResidueResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidueResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidueResponse 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_MsgWithdrawResidueResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidueResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidueResponse 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_MsgWithdrawResidueResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidueResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidueResponse 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_MsgWithdrawResidueResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidueResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidueResponse 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_MsgWithdrawResidueResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: topchain.subscription.MsgWithdrawResidueResponse")) + } + panic(fmt.Errorf("message topchain.subscription.MsgWithdrawResidueResponse 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_MsgWithdrawResidueResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in topchain.subscription.MsgWithdrawResidueResponse", 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_MsgWithdrawResidueResponse) 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_MsgWithdrawResidueResponse) 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_MsgWithdrawResidueResponse) 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_MsgWithdrawResidueResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgWithdrawResidueResponse) + 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().(*MsgWithdrawResidueResponse) + 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().(*MsgWithdrawResidueResponse) + 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: MsgWithdrawResidueResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgWithdrawResidueResponse: 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: topchain/subscription/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_topchain_subscription_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_topchain_subscription_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{1} +} + +type MsgCreateDeal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requester string `protobuf:"bytes,1,opt,name=requester,proto3" json:"requester,omitempty"` + CroId string `protobuf:"bytes,2,opt,name=cro_id,json=croId,proto3" json:"cro_id,omitempty"` + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` + StartBlock uint64 `protobuf:"varint,4,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` + EpochSize uint64 `protobuf:"varint,5,opt,name=epoch_size,json=epochSize,proto3" json:"epoch_size,omitempty"` + NumEpochs uint64 `protobuf:"varint,6,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` + InitialFrontier []string `protobuf:"bytes,7,rep,name=initial_frontier,json=initialFrontier,proto3" json:"initial_frontier,omitempty"` +} + +func (x *MsgCreateDeal) Reset() { + *x = MsgCreateDeal{} + if protoimpl.UnsafeEnabled { + mi := &file_topchain_subscription_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateDeal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateDeal) ProtoMessage() {} + +// Deprecated: Use MsgCreateDeal.ProtoReflect.Descriptor instead. +func (*MsgCreateDeal) Descriptor() ([]byte, []int) { + return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgCreateDeal) GetRequester() string { + if x != nil { + return x.Requester + } + return "" +} + +func (x *MsgCreateDeal) GetCroId() string { + if x != nil { + return x.CroId + } + return "" +} + +func (x *MsgCreateDeal) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *MsgCreateDeal) GetStartBlock() uint64 { + if x != nil { + return x.StartBlock + } + return 0 +} + +func (x *MsgCreateDeal) GetEpochSize() uint64 { + if x != nil { + return x.EpochSize + } + return 0 +} + +func (x *MsgCreateDeal) GetNumEpochs() uint64 { + if x != nil { + return x.NumEpochs + } + return 0 +} + +func (x *MsgCreateDeal) GetInitialFrontier() []string { + if x != nil { + return x.InitialFrontier + } + return nil +} + +type MsgCreateDealResponse struct { + state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -7803,7 +9587,8 @@ type MsgUpdateDeal struct { // these fields should be optional, errors with pulsar Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` StartBlock uint64 `protobuf:"varint,4,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - EndBlock uint64 `protobuf:"varint,5,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` + EpochSize uint64 `protobuf:"varint,5,opt,name=epoch_size,json=epochSize,proto3" json:"epoch_size,omitempty"` + NumEpochs uint64 `protobuf:"varint,6,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` } func (x *MsgUpdateDeal) Reset() { @@ -7854,9 +9639,16 @@ func (x *MsgUpdateDeal) GetStartBlock() uint64 { return 0 } -func (x *MsgUpdateDeal) GetEndBlock() uint64 { +func (x *MsgUpdateDeal) GetEpochSize() uint64 { + if x != nil { + return x.EpochSize + } + return 0 +} + +func (x *MsgUpdateDeal) GetNumEpochs() uint64 { if x != nil { - return x.EndBlock + return x.NumEpochs } return 0 } @@ -8196,6 +9988,144 @@ func (*MsgSubmitProgressResponse) Descriptor() ([]byte, []int) { return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{15} } +type MsgClaimRewards struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + SubscriptionId string `protobuf:"bytes,2,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` +} + +func (x *MsgClaimRewards) Reset() { + *x = MsgClaimRewards{} + if protoimpl.UnsafeEnabled { + mi := &file_topchain_subscription_tx_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimRewards) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimRewards) ProtoMessage() {} + +// Deprecated: Use MsgClaimRewards.ProtoReflect.Descriptor instead. +func (*MsgClaimRewards) Descriptor() ([]byte, []int) { + return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{16} +} + +func (x *MsgClaimRewards) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *MsgClaimRewards) GetSubscriptionId() string { + if x != nil { + return x.SubscriptionId + } + return "" +} + +type MsgClaimRewardsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgClaimRewardsResponse) Reset() { + *x = MsgClaimRewardsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_topchain_subscription_tx_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimRewardsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimRewardsResponse) ProtoMessage() {} + +// Deprecated: Use MsgClaimRewardsResponse.ProtoReflect.Descriptor instead. +func (*MsgClaimRewardsResponse) Descriptor() ([]byte, []int) { + return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{17} +} + +type MsgWithdrawResidue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requester string `protobuf:"bytes,1,opt,name=requester,proto3" json:"requester,omitempty"` + DealId string `protobuf:"bytes,2,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` +} + +func (x *MsgWithdrawResidue) Reset() { + *x = MsgWithdrawResidue{} + if protoimpl.UnsafeEnabled { + mi := &file_topchain_subscription_tx_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgWithdrawResidue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgWithdrawResidue) ProtoMessage() {} + +// Deprecated: Use MsgWithdrawResidue.ProtoReflect.Descriptor instead. +func (*MsgWithdrawResidue) Descriptor() ([]byte, []int) { + return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{18} +} + +func (x *MsgWithdrawResidue) GetRequester() string { + if x != nil { + return x.Requester + } + return "" +} + +func (x *MsgWithdrawResidue) GetDealId() string { + if x != nil { + return x.DealId + } + return "" +} + +type MsgWithdrawResidueResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgWithdrawResidueResponse) Reset() { + *x = MsgWithdrawResidueResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_topchain_subscription_tx_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgWithdrawResidueResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgWithdrawResidueResponse) ProtoMessage() {} + +// Deprecated: Use MsgWithdrawResidueResponse.ProtoReflect.Descriptor instead. +func (*MsgWithdrawResidueResponse) Descriptor() ([]byte, []int) { + return file_topchain_subscription_tx_proto_rawDescGZIP(), []int{19} +} + var File_topchain_subscription_tx_proto protoreflect.FileDescriptor var file_topchain_subscription_tx_proto_rawDesc = []byte{ @@ -8224,7 +10154,7 @@ var file_topchain_subscription_tx_proto_rawDesc = []byte{ 0x61, 0x69, 0x6e, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd5, 0x01, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x0a, @@ -8232,141 +10162,175 @@ var file_topchain_subscription_tx_proto_rawDesc = []byte{ 0x72, 0x6f, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a, - 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x46, 0x72, 0x6f, - 0x6e, 0x74, 0x69, 0x65, 0x72, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, - 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x56, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, 0x3a, - 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, - 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x61, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x0d, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, - 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x65, - 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x77, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x44, 0x65, 0x61, 0x6c, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, - 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x6c, 0x41, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x0b, 0x4d, - 0x73, 0x67, 0x4a, 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, 0x3a, - 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x3e, - 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x4a, 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x52, - 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1a, - 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, + 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x0a, + 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x46, 0x72, + 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x56, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, + 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xcd, 0x01, 0x0a, 0x0d, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, + 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x75, + 0x6d, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x6e, 0x75, 0x6d, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x77, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x44, 0x65, 0x61, 0x6c, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, - 0x6c, 0x49, 0x64, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x22, 0x16, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x44, 0x65, - 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x11, 0x4d, - 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x20, 0x0a, 0x1e, 0x4d, + 0x73, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x6c, 0x41, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, + 0x0b, 0x4d, 0x73, 0x67, 0x4a, 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x61, 0x6c, 0x49, + 0x64, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x22, 0x3e, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x4a, 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x61, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x22, 0x52, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x5f, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, - 0x38, 0x0a, 0x18, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x65, - 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x16, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, 0x65, 0x72, - 0x74, 0x69, 0x63, 0x65, 0x73, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, - 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xc0, 0x06, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x66, 0x0a, - 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x2e, - 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2e, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x61, 0x6c, 0x12, 0x24, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2c, 0x2e, 0x74, 0x6f, 0x70, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x24, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2c, 0x2e, 0x74, 0x6f, - 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x61, - 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0a, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x24, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2c, 0x2e, - 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x13, 0x49, - 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x6c, 0x41, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x2d, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6e, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, + 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, + 0x65, 0x61, 0x6c, 0x49, 0x64, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x22, 0x16, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x4c, 0x65, 0x61, 0x76, 0x65, + 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdb, 0x01, 0x0a, + 0x11, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x27, + 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x48, 0x61, 0x73, 0x68, 0x65, + 0x73, 0x12, 0x38, 0x0a, 0x18, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x16, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, + 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, + 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, + 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x3a, + 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x19, + 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, 0x0a, 0x12, 0x4d, 0x73, 0x67, + 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x69, 0x64, 0x75, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, + 0x07, 0x64, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x64, 0x65, 0x61, 0x6c, 0x49, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x69, 0x64, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x99, 0x08, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x66, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x2e, 0x74, + 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2e, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, + 0x61, 0x6c, 0x12, 0x24, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2c, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x44, 0x65, 0x61, 0x6c, 0x12, 0x24, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2c, 0x2e, 0x74, 0x6f, 0x70, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x12, 0x24, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2c, 0x2e, 0x74, + 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, + 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x13, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x6c, 0x41, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x1a, 0x35, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, + 0x74, 0x12, 0x2d, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x6c, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x08, 0x4a, 0x6f, 0x69, 0x6e, - 0x44, 0x65, 0x61, 0x6c, 0x12, 0x22, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, + 0x1a, 0x35, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x63, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x6c, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x08, 0x4a, 0x6f, 0x69, 0x6e, 0x44, + 0x65, 0x61, 0x6c, 0x12, 0x22, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x4a, + 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2a, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x4d, 0x73, 0x67, 0x4a, 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x44, 0x65, 0x61, 0x6c, + 0x12, 0x23, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x65, 0x61, 0x76, + 0x65, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2b, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, + 0x67, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x28, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, - 0x4a, 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2a, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x30, + 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x66, 0x0a, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x12, 0x26, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x2e, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x4d, 0x73, 0x67, 0x4a, 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x44, 0x65, 0x61, - 0x6c, 0x12, 0x23, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x65, 0x61, - 0x76, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x1a, 0x2b, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x0f, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x69, 0x64, 0x75, 0x65, 0x12, 0x29, 0x2e, 0x74, 0x6f, + 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, + 0x65, 0x73, 0x69, 0x64, 0x75, 0x65, 0x1a, 0x31, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, - 0x73, 0x67, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x44, 0x65, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x28, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x1a, - 0x30, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xbd, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, - 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x22, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x54, 0x53, 0x58, 0xaa, 0x02, 0x15, 0x54, 0x6f, - 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x15, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x21, 0x54, 0x6f, + 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x69, 0x64, 0x75, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, + 0x42, 0xbd, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, + 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x74, 0x6f, 0x70, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, + 0x54, 0x53, 0x58, 0xaa, 0x02, 0x15, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x15, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x16, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x21, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x54, 0x6f, 0x70, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8381,7 +10345,7 @@ func file_topchain_subscription_tx_proto_rawDescGZIP() []byte { return file_topchain_subscription_tx_proto_rawDescData } -var file_topchain_subscription_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_topchain_subscription_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_topchain_subscription_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: topchain.subscription.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: topchain.subscription.MsgUpdateParamsResponse @@ -8399,10 +10363,14 @@ var file_topchain_subscription_tx_proto_goTypes = []interface{}{ (*MsgLeaveDealResponse)(nil), // 13: topchain.subscription.MsgLeaveDealResponse (*MsgSubmitProgress)(nil), // 14: topchain.subscription.MsgSubmitProgress (*MsgSubmitProgressResponse)(nil), // 15: topchain.subscription.MsgSubmitProgressResponse - (*Params)(nil), // 16: topchain.subscription.Params + (*MsgClaimRewards)(nil), // 16: topchain.subscription.MsgClaimRewards + (*MsgClaimRewardsResponse)(nil), // 17: topchain.subscription.MsgClaimRewardsResponse + (*MsgWithdrawResidue)(nil), // 18: topchain.subscription.MsgWithdrawResidue + (*MsgWithdrawResidueResponse)(nil), // 19: topchain.subscription.MsgWithdrawResidueResponse + (*Params)(nil), // 20: topchain.subscription.Params } var file_topchain_subscription_tx_proto_depIdxs = []int32{ - 16, // 0: topchain.subscription.MsgUpdateParams.params:type_name -> topchain.subscription.Params + 20, // 0: topchain.subscription.MsgUpdateParams.params:type_name -> topchain.subscription.Params 0, // 1: topchain.subscription.Msg.UpdateParams:input_type -> topchain.subscription.MsgUpdateParams 2, // 2: topchain.subscription.Msg.CreateDeal:input_type -> topchain.subscription.MsgCreateDeal 4, // 3: topchain.subscription.Msg.CancelDeal:input_type -> topchain.subscription.MsgCancelDeal @@ -8411,16 +10379,20 @@ var file_topchain_subscription_tx_proto_depIdxs = []int32{ 10, // 6: topchain.subscription.Msg.JoinDeal:input_type -> topchain.subscription.MsgJoinDeal 12, // 7: topchain.subscription.Msg.LeaveDeal:input_type -> topchain.subscription.MsgLeaveDeal 14, // 8: topchain.subscription.Msg.SubmitProgress:input_type -> topchain.subscription.MsgSubmitProgress - 1, // 9: topchain.subscription.Msg.UpdateParams:output_type -> topchain.subscription.MsgUpdateParamsResponse - 3, // 10: topchain.subscription.Msg.CreateDeal:output_type -> topchain.subscription.MsgCreateDealResponse - 5, // 11: topchain.subscription.Msg.CancelDeal:output_type -> topchain.subscription.MsgCancelDealResponse - 7, // 12: topchain.subscription.Msg.UpdateDeal:output_type -> topchain.subscription.MsgUpdateDealResponse - 9, // 13: topchain.subscription.Msg.IncrementDealAmount:output_type -> topchain.subscription.MsgIncrementDealAmountResponse - 11, // 14: topchain.subscription.Msg.JoinDeal:output_type -> topchain.subscription.MsgJoinDealResponse - 13, // 15: topchain.subscription.Msg.LeaveDeal:output_type -> topchain.subscription.MsgLeaveDealResponse - 15, // 16: topchain.subscription.Msg.SubmitProgress:output_type -> topchain.subscription.MsgSubmitProgressResponse - 9, // [9:17] is the sub-list for method output_type - 1, // [1:9] is the sub-list for method input_type + 16, // 9: topchain.subscription.Msg.claimRewards:input_type -> topchain.subscription.MsgClaimRewards + 18, // 10: topchain.subscription.Msg.withdrawResidue:input_type -> topchain.subscription.MsgWithdrawResidue + 1, // 11: topchain.subscription.Msg.UpdateParams:output_type -> topchain.subscription.MsgUpdateParamsResponse + 3, // 12: topchain.subscription.Msg.CreateDeal:output_type -> topchain.subscription.MsgCreateDealResponse + 5, // 13: topchain.subscription.Msg.CancelDeal:output_type -> topchain.subscription.MsgCancelDealResponse + 7, // 14: topchain.subscription.Msg.UpdateDeal:output_type -> topchain.subscription.MsgUpdateDealResponse + 9, // 15: topchain.subscription.Msg.IncrementDealAmount:output_type -> topchain.subscription.MsgIncrementDealAmountResponse + 11, // 16: topchain.subscription.Msg.JoinDeal:output_type -> topchain.subscription.MsgJoinDealResponse + 13, // 17: topchain.subscription.Msg.LeaveDeal:output_type -> topchain.subscription.MsgLeaveDealResponse + 15, // 18: topchain.subscription.Msg.SubmitProgress:output_type -> topchain.subscription.MsgSubmitProgressResponse + 17, // 19: topchain.subscription.Msg.claimRewards:output_type -> topchain.subscription.MsgClaimRewardsResponse + 19, // 20: topchain.subscription.Msg.withdrawResidue:output_type -> topchain.subscription.MsgWithdrawResidueResponse + 11, // [11:21] is the sub-list for method output_type + 1, // [1:11] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name @@ -8625,6 +10597,54 @@ func file_topchain_subscription_tx_proto_init() { return nil } } + file_topchain_subscription_tx_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimRewards); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_topchain_subscription_tx_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimRewardsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_topchain_subscription_tx_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgWithdrawResidue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_topchain_subscription_tx_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgWithdrawResidueResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -8632,7 +10652,7 @@ func file_topchain_subscription_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_topchain_subscription_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 16, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/api/topchain/subscription/tx_grpc.pb.go b/api/topchain/subscription/tx_grpc.pb.go index 77aa645..86b100e 100644 --- a/api/topchain/subscription/tx_grpc.pb.go +++ b/api/topchain/subscription/tx_grpc.pb.go @@ -27,6 +27,8 @@ const ( Msg_JoinDeal_FullMethodName = "/topchain.subscription.Msg/JoinDeal" Msg_LeaveDeal_FullMethodName = "/topchain.subscription.Msg/LeaveDeal" Msg_SubmitProgress_FullMethodName = "/topchain.subscription.Msg/SubmitProgress" + Msg_ClaimRewards_FullMethodName = "/topchain.subscription.Msg/claimRewards" + Msg_WithdrawResidue_FullMethodName = "/topchain.subscription.Msg/withdrawResidue" ) // MsgClient is the client API for Msg service. @@ -43,6 +45,8 @@ type MsgClient interface { JoinDeal(ctx context.Context, in *MsgJoinDeal, opts ...grpc.CallOption) (*MsgJoinDealResponse, error) LeaveDeal(ctx context.Context, in *MsgLeaveDeal, opts ...grpc.CallOption) (*MsgLeaveDealResponse, error) SubmitProgress(ctx context.Context, in *MsgSubmitProgress, opts ...grpc.CallOption) (*MsgSubmitProgressResponse, error) + ClaimRewards(ctx context.Context, in *MsgClaimRewards, opts ...grpc.CallOption) (*MsgClaimRewardsResponse, error) + WithdrawResidue(ctx context.Context, in *MsgWithdrawResidue, opts ...grpc.CallOption) (*MsgWithdrawResidueResponse, error) } type msgClient struct { @@ -125,6 +129,24 @@ func (c *msgClient) SubmitProgress(ctx context.Context, in *MsgSubmitProgress, o return out, nil } +func (c *msgClient) ClaimRewards(ctx context.Context, in *MsgClaimRewards, opts ...grpc.CallOption) (*MsgClaimRewardsResponse, error) { + out := new(MsgClaimRewardsResponse) + err := c.cc.Invoke(ctx, Msg_ClaimRewards_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawResidue(ctx context.Context, in *MsgWithdrawResidue, opts ...grpc.CallOption) (*MsgWithdrawResidueResponse, error) { + out := new(MsgWithdrawResidueResponse) + err := c.cc.Invoke(ctx, Msg_WithdrawResidue_FullMethodName, 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 @@ -139,6 +161,8 @@ type MsgServer interface { JoinDeal(context.Context, *MsgJoinDeal) (*MsgJoinDealResponse, error) LeaveDeal(context.Context, *MsgLeaveDeal) (*MsgLeaveDealResponse, error) SubmitProgress(context.Context, *MsgSubmitProgress) (*MsgSubmitProgressResponse, error) + ClaimRewards(context.Context, *MsgClaimRewards) (*MsgClaimRewardsResponse, error) + WithdrawResidue(context.Context, *MsgWithdrawResidue) (*MsgWithdrawResidueResponse, error) mustEmbedUnimplementedMsgServer() } @@ -170,6 +194,12 @@ func (UnimplementedMsgServer) LeaveDeal(context.Context, *MsgLeaveDeal) (*MsgLea func (UnimplementedMsgServer) SubmitProgress(context.Context, *MsgSubmitProgress) (*MsgSubmitProgressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitProgress not implemented") } +func (UnimplementedMsgServer) ClaimRewards(context.Context, *MsgClaimRewards) (*MsgClaimRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimRewards not implemented") +} +func (UnimplementedMsgServer) WithdrawResidue(context.Context, *MsgWithdrawResidue) (*MsgWithdrawResidueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawResidue not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -327,6 +357,42 @@ func _Msg_SubmitProgress_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Msg_ClaimRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimRewards) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ClaimRewards_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimRewards(ctx, req.(*MsgClaimRewards)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawResidue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawResidue) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawResidue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_WithdrawResidue_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawResidue(ctx, req.(*MsgWithdrawResidue)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -366,6 +432,14 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "SubmitProgress", Handler: _Msg_SubmitProgress_Handler, }, + { + MethodName: "claimRewards", + Handler: _Msg_ClaimRewards_Handler, + }, + { + MethodName: "withdrawResidue", + Handler: _Msg_WithdrawResidue_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "topchain/subscription/tx.proto", diff --git a/config.yml b/config.yml index c3bc9fb..7f0b812 100644 --- a/config.yml +++ b/config.yml @@ -3,22 +3,36 @@ validation: sovereign accounts: - name: alice coins: - - 20000token + - 2000000token - 200000000stake - 100000000top - name: bob coins: - - 10000token + - 1000000token - 100000000stake - 100000000top + - name: charlie + coins: + - 1000000token + - 100000000stake + - 100000000top + - name: faucet + coins: + - 100000000000000000000token + - 100000000000000000000stake + - 100000000000000000000top client: openapi: path: docs/static/openapi.yml faucet: - name: bob + name: faucetAccount coins: - 5token - 100000stake validators: - name: alice bonded: 100000000stake + - name: bob + bonded: 100000000stake + - name: charlie + bonded: 100000000stake \ No newline at end of file diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index eae1304..05fe956 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -1 +1 @@ -{"id":"topchain","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain topchain REST API","title":"HTTP API Console","contact":{"name":"topchain"},"version":"version not set"},"paths":{"/topchain.challenge.Msg/Challenge":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_Challenge","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgChallenge"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgChallengeResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.challenge.Msg/RequestDependencies":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_RequestDependencies","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgRequestDependencies"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgRequestDependenciesResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.challenge.Msg/SettleChallenge":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_SettleChallenge","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgSettleChallenge"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgSettleChallengeResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.challenge.Msg/SubmitProof":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_SubmitProof","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgSubmitProof"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgSubmitProofResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.challenge.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"TopchainMsg_UpdateParams","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/CancelDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_CancelDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgCancelDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgCancelDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/CreateDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_CreateDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgCreateDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgCreateDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/IncrementDealAmount":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_IncrementDealAmount","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgIncrementDealAmount"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgIncrementDealAmountResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/JoinDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_JoinDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgJoinDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgJoinDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/LeaveDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_LeaveDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgLeaveDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgLeaveDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/SubmitProgress":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_SubmitProgress","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgSubmitProgress"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgSubmitProgressResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/UpdateDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_UpdateDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgUpdateDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgUpdateDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"TopchainMsg_UpdateParamsMixin11","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/challenge/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"TopchainQuery_Params","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/challenge/proof/{challenge_id}/{hash}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Proof","parameters":[{"type":"string","name":"challenge_id","in":"path","required":true},{"type":"string","name":"hash","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.QueryProofResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/challenge/proofs/{challenge_id}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Proofs","parameters":[{"type":"string","name":"challenge_id","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.QueryProofsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/deal/{id}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Deal","parameters":[{"type":"string","name":"id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QueryDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/deal_status/{id}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_DealStatus","parameters":[{"type":"string","name":"id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QueryDealStatusResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/deals/{requester}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Deals","parameters":[{"type":"string","name":"requester","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QueryDealsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"TopchainQuery_ParamsMixin9","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/subscription/{id}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Subscription","parameters":[{"type":"string","name":"id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QuerySubscriptionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/subscriptions/{provider}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Subscriptions","parameters":[{"type":"string","name":"provider","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QuerySubscriptionsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topology.node.TopologyRpc/getCroHashGraph":{"post":{"tags":["TopologyRpc"],"operationId":"TopchainTopologyRpc_getCroHashGraph","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topology.node.GetCroHashGraphRequest"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topology.node.GetCroHashGraphResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topology.node.TopologyRpc/subscribeCro":{"post":{"tags":["TopologyRpc"],"operationId":"TopchainTopologyRpc_subscribeCro","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topology.node.SubscribeCroRequest"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topology.node.SubscribeCroResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topology.node.TopologyRpc/unsubscribeCro":{"post":{"tags":["TopologyRpc"],"operationId":"TopchainTopologyRpc_unsubscribeCro","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topology.node.UnsubscribeCroRequest"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topology.node.UnsubscribeCroResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}}},"definitions":{"cosmos.base.query.v1beta1.PageRequest":{"description":"message SomeRequest {\n Foo some_parameter = 1;\n PageRequest pagination = 2;\n }","type":"object","title":"PageRequest is to be embedded in gRPC request messages for efficient\npagination. Ex:","properties":{"count_total":{"description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","type":"boolean"},"key":{"description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","type":"string","format":"byte"},"limit":{"description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","type":"string","format":"uint64"},"offset":{"description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","type":"string","format":"uint64"},"reverse":{"description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","type":"boolean"}}},"cosmos.base.query.v1beta1.PageResponse":{"description":"PageResponse is to be embedded in gRPC response messages where the\ncorresponding request message has used PageRequest.\n\n message SomeResponse {\n repeated Bar results = 1;\n PageResponse page = 2;\n }","type":"object","properties":{"next_key":{"description":"next_key is the key to be passed to PageRequest.key to\nquery the next page most efficiently. It will be empty if\nthere are no more results.","type":"string","format":"byte"},"total":{"type":"string","format":"uint64","title":"total is total number of results available if PageRequest.count_total\nwas set, its value is undefined otherwise"}}},"google.protobuf.Any":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"google.protobuf.NullValue":{"description":"`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\nThe JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value.","type":"string","default":"NULL_VALUE","enum":["NULL_VALUE"]},"google.rpc.Status":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"message":{"type":"string"}}},"topchain.challenge.MsgChallenge":{"type":"object","properties":{"challenger":{"type":"string"},"provider_id":{"type":"string"},"vertices_hashes":{"type":"array","items":{"type":"string"}}}},"topchain.challenge.MsgChallengeResponse":{"type":"object","properties":{"challenge_id":{"type":"string"}}},"topchain.challenge.MsgRequestDependencies":{"type":"object","properties":{"challenge_id":{"type":"string"},"challenger":{"type":"string"},"vertices_hashes":{"type":"array","items":{"type":"string"}}}},"topchain.challenge.MsgRequestDependenciesResponse":{"type":"object"},"topchain.challenge.MsgSettleChallenge":{"type":"object","properties":{"challenge_id":{"type":"string"},"requester":{"type":"string"}}},"topchain.challenge.MsgSettleChallengeResponse":{"type":"object"},"topchain.challenge.MsgSubmitProof":{"type":"object","properties":{"challenge_id":{"type":"string"},"provider":{"type":"string"},"vertices":{"type":"array","items":{"type":"object","$ref":"#/definitions/topchain.challenge.Vertex"}}}},"topchain.challenge.MsgSubmitProofResponse":{"type":"object"},"topchain.challenge.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"params defines the module parameters to update.\n\nNOTE: All parameters must be supplied.","$ref":"#/definitions/topchain.challenge.Params"}}},"topchain.challenge.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"topchain.challenge.Params":{"description":"Params defines the parameters for the module.","type":"object"},"topchain.challenge.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/topchain.challenge.Params"}}},"topchain.challenge.QueryProofResponse":{"type":"object","properties":{"vertex":{"$ref":"#/definitions/topchain.challenge.Vertex"}}},"topchain.challenge.QueryProofsResponse":{"type":"object","properties":{"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"vertices":{"type":"array","items":{"type":"object","$ref":"#/definitions/topchain.challenge.Vertex"}}}},"topchain.challenge.Vertex":{"type":"object","properties":{"dependencies":{"type":"array","items":{"type":"string"}},"hash":{"type":"string"},"node_id":{"type":"string"},"operation":{"$ref":"#/definitions/topchain.challenge.Vertex.Operation"}}},"topchain.challenge.Vertex.Operation":{"type":"object","properties":{"type":{"type":"string"},"value":{}}},"topchain.subscription.Deal":{"type":"object","properties":{"available_amount":{"type":"string","format":"uint64"},"cro_id":{"type":"string"},"end_block":{"type":"string","format":"uint64"},"id":{"type":"string"},"initial_frontier":{"type":"array","items":{"type":"string"}},"requester":{"type":"string"},"start_block":{"type":"string","format":"uint64"},"status":{"$ref":"#/definitions/topchain.subscription.Deal.Status"},"subscription_ids":{"type":"array","items":{"type":"string"}},"total_amount":{"type":"string","format":"uint64"}}},"topchain.subscription.Deal.Status":{"type":"string","default":"UNDEFINED","enum":["UNDEFINED","SCHEDULED","INITIALIZED","ACTIVE","INACTIVE","CANCELLED","EXPIRED"]},"topchain.subscription.MsgCancelDeal":{"type":"object","properties":{"deal_id":{"type":"string"},"requester":{"type":"string"}}},"topchain.subscription.MsgCancelDealResponse":{"type":"object"},"topchain.subscription.MsgCreateDeal":{"type":"object","properties":{"amount":{"type":"string","format":"uint64"},"cro_id":{"type":"string"},"end_block":{"type":"string","format":"uint64"},"initial_frontier":{"type":"array","items":{"type":"string"}},"requester":{"type":"string"},"start_block":{"type":"string","format":"uint64"}}},"topchain.subscription.MsgCreateDealResponse":{"type":"object","properties":{"deal_id":{"type":"string"}}},"topchain.subscription.MsgIncrementDealAmount":{"type":"object","properties":{"amount":{"type":"string","format":"uint64"},"deal_id":{"type":"string"},"requester":{"type":"string"}}},"topchain.subscription.MsgIncrementDealAmountResponse":{"type":"object"},"topchain.subscription.MsgJoinDeal":{"type":"object","properties":{"deal_id":{"type":"string"},"provider":{"type":"string"}}},"topchain.subscription.MsgJoinDealResponse":{"type":"object","properties":{"subscription_id":{"type":"string"}}},"topchain.subscription.MsgLeaveDeal":{"type":"object","properties":{"deal_id":{"type":"string"},"provider":{"type":"string"}}},"topchain.subscription.MsgLeaveDealResponse":{"type":"object"},"topchain.subscription.MsgSubmitProgress":{"type":"object","properties":{"obfuscated_vertices_hash":{"type":"string"},"previous_vertices_hashes":{"type":"array","items":{"type":"string"}},"provider":{"type":"string"},"subscription_id":{"type":"string"}}},"topchain.subscription.MsgSubmitProgressResponse":{"type":"object"},"topchain.subscription.MsgUpdateDeal":{"type":"object","properties":{"amount":{"type":"string","format":"uint64","title":"these fields should be optional, errors with pulsar"},"deal_id":{"type":"string"},"end_block":{"type":"string","format":"uint64"},"requester":{"type":"string"},"start_block":{"type":"string","format":"uint64"}}},"topchain.subscription.MsgUpdateDealResponse":{"type":"object"},"topchain.subscription.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"NOTE: All parameters must be supplied.","$ref":"#/definitions/topchain.subscription.Params"}}},"topchain.subscription.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"topchain.subscription.Params":{"description":"Params defines the parameters for the module.","type":"object"},"topchain.subscription.QueryDealResponse":{"type":"object","properties":{"deal":{"$ref":"#/definitions/topchain.subscription.Deal"}}},"topchain.subscription.QueryDealStatusResponse":{"type":"object","properties":{"status":{"$ref":"#/definitions/topchain.subscription.Deal.Status"}}},"topchain.subscription.QueryDealsResponse":{"type":"object","properties":{"deals":{"type":"array","items":{"type":"object","$ref":"#/definitions/topchain.subscription.Deal"}},"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"topchain.subscription.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/topchain.subscription.Params"}}},"topchain.subscription.QuerySubscriptionResponse":{"type":"object","properties":{"subscription":{"$ref":"#/definitions/topchain.subscription.Subscription"}}},"topchain.subscription.QuerySubscriptionsResponse":{"type":"object","properties":{"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"subscriptions":{"type":"array","items":{"type":"object","$ref":"#/definitions/topchain.subscription.Subscription"}}}},"topchain.subscription.Subscription":{"type":"object","properties":{"deal_id":{"type":"string"},"end_block":{"type":"string","format":"uint64"},"id":{"type":"string"},"provider":{"type":"string"},"start_block":{"type":"string","format":"uint64"}}},"topology.node.GetCroHashGraphRequest":{"type":"object","properties":{"cro_id":{"type":"string"}}},"topology.node.GetCroHashGraphResponse":{"type":"object","properties":{"vertices_hashes":{"type":"array","title":"linearized vertices hashes","items":{"type":"string"}}}},"topology.node.SubscribeCroRequest":{"type":"object","properties":{"cro_id":{"type":"string"}}},"topology.node.SubscribeCroResponse":{"type":"object","properties":{"return_code":{"type":"integer","format":"int32","title":"can return error codes if different than 0"}}},"topology.node.UnsubscribeCroRequest":{"type":"object","properties":{"cro_id":{"type":"string"}}},"topology.node.UnsubscribeCroResponse":{"type":"object","properties":{"return_code":{"type":"integer","format":"int32","title":"can return error codes if different than 0"}}}},"tags":[{"name":"Query"},{"name":"Msg"},{"name":"TopologyRpc"}]} \ No newline at end of file +{"id":"topchain","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain topchain REST API","title":"HTTP API Console","contact":{"name":"topchain"},"version":"version not set"},"paths":{"/topchain.challenge.Msg/Challenge":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_Challenge","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgChallenge"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgChallengeResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.challenge.Msg/RequestDependencies":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_RequestDependencies","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgRequestDependencies"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgRequestDependenciesResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.challenge.Msg/SettleChallenge":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_SettleChallenge","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgSettleChallenge"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgSettleChallengeResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.challenge.Msg/SubmitProof":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_SubmitProof","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgSubmitProof"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgSubmitProofResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.challenge.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"TopchainMsg_UpdateParams","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.challenge.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/CancelDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_CancelDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgCancelDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgCancelDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/CreateDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_CreateDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgCreateDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgCreateDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/IncrementDealAmount":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_IncrementDealAmount","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgIncrementDealAmount"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgIncrementDealAmountResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/JoinDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_JoinDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgJoinDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgJoinDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/LeaveDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_LeaveDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgLeaveDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgLeaveDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/SubmitProgress":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_SubmitProgress","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgSubmitProgress"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgSubmitProgressResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/UpdateDeal":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_UpdateDeal","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgUpdateDeal"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgUpdateDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"TopchainMsg_UpdateParamsMixin11","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/claimRewards":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_claimRewards","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgClaimRewards"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgClaimRewardsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain.subscription.Msg/withdrawResidue":{"post":{"tags":["Msg"],"operationId":"TopchainMsg_withdrawResidue","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topchain.subscription.MsgWithdrawResidue"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.MsgWithdrawResidueResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/challenge/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"TopchainQuery_Params","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/challenge/proof/{challenge_id}/{hash}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Proof","parameters":[{"type":"string","name":"challenge_id","in":"path","required":true},{"type":"string","name":"hash","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.QueryProofResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/challenge/proofs/{challenge_id}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Proofs","parameters":[{"type":"string","name":"challenge_id","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.challenge.QueryProofsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/deal/{id}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Deal","parameters":[{"type":"string","name":"id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QueryDealResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/deal_status/{id}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_DealStatus","parameters":[{"type":"string","name":"id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QueryDealStatusResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/deals/{requester}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Deals","parameters":[{"type":"string","name":"requester","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QueryDealsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"TopchainQuery_ParamsMixin9","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/subscription/{id}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Subscription","parameters":[{"type":"string","name":"id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QuerySubscriptionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topchain/subscription/subscriptions/{provider}":{"get":{"tags":["Query"],"operationId":"TopchainQuery_Subscriptions","parameters":[{"type":"string","name":"provider","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topchain.subscription.QuerySubscriptionsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topology.node.TopologyRpc/getCroHashGraph":{"post":{"tags":["TopologyRpc"],"operationId":"TopchainTopologyRpc_getCroHashGraph","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topology.node.GetCroHashGraphRequest"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topology.node.GetCroHashGraphResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topology.node.TopologyRpc/subscribeCro":{"post":{"tags":["TopologyRpc"],"operationId":"TopchainTopologyRpc_subscribeCro","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topology.node.SubscribeCroRequest"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topology.node.SubscribeCroResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/topology.node.TopologyRpc/unsubscribeCro":{"post":{"tags":["TopologyRpc"],"operationId":"TopchainTopologyRpc_unsubscribeCro","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/topology.node.UnsubscribeCroRequest"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/topology.node.UnsubscribeCroResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}}},"definitions":{"cosmos.base.query.v1beta1.PageRequest":{"description":"message SomeRequest {\n Foo some_parameter = 1;\n PageRequest pagination = 2;\n }","type":"object","title":"PageRequest is to be embedded in gRPC request messages for efficient\npagination. Ex:","properties":{"count_total":{"description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","type":"boolean"},"key":{"description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","type":"string","format":"byte"},"limit":{"description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","type":"string","format":"uint64"},"offset":{"description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","type":"string","format":"uint64"},"reverse":{"description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","type":"boolean"}}},"cosmos.base.query.v1beta1.PageResponse":{"description":"PageResponse is to be embedded in gRPC response messages where the\ncorresponding request message has used PageRequest.\n\n message SomeResponse {\n repeated Bar results = 1;\n PageResponse page = 2;\n }","type":"object","properties":{"next_key":{"description":"next_key is the key to be passed to PageRequest.key to\nquery the next page most efficiently. It will be empty if\nthere are no more results.","type":"string","format":"byte"},"total":{"type":"string","format":"uint64","title":"total is total number of results available if PageRequest.count_total\nwas set, its value is undefined otherwise"}}},"google.protobuf.Any":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"google.protobuf.NullValue":{"description":"`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\nThe JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value.","type":"string","default":"NULL_VALUE","enum":["NULL_VALUE"]},"google.rpc.Status":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"message":{"type":"string"}}},"topchain.challenge.MsgChallenge":{"type":"object","properties":{"challenger":{"type":"string"},"deal_id":{"type":"string"},"provider_id":{"type":"string"},"vertices_hashes":{"type":"array","items":{"type":"string"}}}},"topchain.challenge.MsgChallengeResponse":{"type":"object","properties":{"challenge_id":{"type":"string"}}},"topchain.challenge.MsgRequestDependencies":{"type":"object","properties":{"challenge_id":{"type":"string"},"challenger":{"type":"string"},"vertices_hashes":{"type":"array","items":{"type":"string"}}}},"topchain.challenge.MsgRequestDependenciesResponse":{"type":"object"},"topchain.challenge.MsgSettleChallenge":{"type":"object","properties":{"challenge_id":{"type":"string"},"requester":{"type":"string"}}},"topchain.challenge.MsgSettleChallengeResponse":{"type":"object"},"topchain.challenge.MsgSubmitProof":{"type":"object","properties":{"challenge_id":{"type":"string"},"provider":{"type":"string"},"vertices":{"type":"array","items":{"type":"object","$ref":"#/definitions/topchain.challenge.Vertex"}}}},"topchain.challenge.MsgSubmitProofResponse":{"type":"object"},"topchain.challenge.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"params defines the module parameters to update.\n\nNOTE: All parameters must be supplied.","$ref":"#/definitions/topchain.challenge.Params"}}},"topchain.challenge.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"topchain.challenge.Params":{"description":"Params defines the parameters for the module.","type":"object"},"topchain.challenge.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/topchain.challenge.Params"}}},"topchain.challenge.QueryProofResponse":{"type":"object","properties":{"vertex":{"$ref":"#/definitions/topchain.challenge.Vertex"}}},"topchain.challenge.QueryProofsResponse":{"type":"object","properties":{"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"vertices":{"type":"array","items":{"type":"object","$ref":"#/definitions/topchain.challenge.Vertex"}}}},"topchain.challenge.Vertex":{"type":"object","properties":{"dependencies":{"type":"array","items":{"type":"string"}},"hash":{"type":"string"},"node_id":{"type":"string"},"operation":{"$ref":"#/definitions/topchain.challenge.Vertex.Operation"}}},"topchain.challenge.Vertex.Operation":{"type":"object","properties":{"type":{"type":"string"},"value":{}}},"topchain.subscription.Deal":{"type":"object","properties":{"available_amount":{"type":"string","format":"uint64"},"cro_id":{"type":"string"},"epoch_size":{"type":"string","format":"uint64"},"id":{"type":"string"},"initial_frontier":{"type":"array","items":{"type":"string"}},"num_epochs":{"type":"string","format":"uint64"},"requester":{"type":"string"},"reward_per_epoch":{"type":"string","format":"uint64"},"start_block":{"type":"string","format":"uint64"},"status":{"$ref":"#/definitions/topchain.subscription.Deal.Status"},"subscription_ids":{"type":"array","items":{"type":"string"}},"total_amount":{"type":"string","format":"uint64"}}},"topchain.subscription.Deal.Status":{"type":"string","default":"UNDEFINED","enum":["UNDEFINED","SCHEDULED","INITIALIZED","ACTIVE","INACTIVE","CANCELLED","EXPIRED"]},"topchain.subscription.MsgCancelDeal":{"type":"object","properties":{"deal_id":{"type":"string"},"requester":{"type":"string"}}},"topchain.subscription.MsgCancelDealResponse":{"type":"object"},"topchain.subscription.MsgClaimRewards":{"type":"object","properties":{"provider":{"type":"string"},"subscription_id":{"type":"string"}}},"topchain.subscription.MsgClaimRewardsResponse":{"type":"object"},"topchain.subscription.MsgCreateDeal":{"type":"object","properties":{"amount":{"type":"string","format":"uint64"},"cro_id":{"type":"string"},"epoch_size":{"type":"string","format":"uint64"},"initial_frontier":{"type":"array","items":{"type":"string"}},"num_epochs":{"type":"string","format":"uint64"},"requester":{"type":"string"},"start_block":{"type":"string","format":"uint64"}}},"topchain.subscription.MsgCreateDealResponse":{"type":"object","properties":{"deal_id":{"type":"string"}}},"topchain.subscription.MsgIncrementDealAmount":{"type":"object","properties":{"amount":{"type":"string","format":"uint64"},"deal_id":{"type":"string"},"requester":{"type":"string"}}},"topchain.subscription.MsgIncrementDealAmountResponse":{"type":"object"},"topchain.subscription.MsgJoinDeal":{"type":"object","properties":{"deal_id":{"type":"string"},"provider":{"type":"string"}}},"topchain.subscription.MsgJoinDealResponse":{"type":"object","properties":{"subscription_id":{"type":"string"}}},"topchain.subscription.MsgLeaveDeal":{"type":"object","properties":{"deal_id":{"type":"string"},"provider":{"type":"string"}}},"topchain.subscription.MsgLeaveDealResponse":{"type":"object"},"topchain.subscription.MsgSubmitProgress":{"type":"object","properties":{"obfuscated_vertices_hash":{"type":"string"},"previous_vertices_hashes":{"type":"array","items":{"type":"string"}},"provider":{"type":"string"},"subscription_id":{"type":"string"}}},"topchain.subscription.MsgSubmitProgressResponse":{"type":"object"},"topchain.subscription.MsgUpdateDeal":{"type":"object","properties":{"amount":{"type":"string","format":"uint64","title":"these fields should be optional, errors with pulsar"},"deal_id":{"type":"string"},"epoch_size":{"type":"string","format":"uint64"},"num_epochs":{"type":"string","format":"uint64"},"requester":{"type":"string"},"start_block":{"type":"string","format":"uint64"}}},"topchain.subscription.MsgUpdateDealResponse":{"type":"object"},"topchain.subscription.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"NOTE: All parameters must be supplied.","$ref":"#/definitions/topchain.subscription.Params"}}},"topchain.subscription.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"topchain.subscription.MsgWithdrawResidue":{"type":"object","properties":{"deal_id":{"type":"string"},"requester":{"type":"string"}}},"topchain.subscription.MsgWithdrawResidueResponse":{"type":"object"},"topchain.subscription.Params":{"description":"Params defines the parameters for the module.","type":"object"},"topchain.subscription.QueryDealResponse":{"type":"object","properties":{"deal":{"$ref":"#/definitions/topchain.subscription.Deal"}}},"topchain.subscription.QueryDealStatusResponse":{"type":"object","properties":{"status":{"$ref":"#/definitions/topchain.subscription.Deal.Status"}}},"topchain.subscription.QueryDealsResponse":{"type":"object","properties":{"deals":{"type":"array","items":{"type":"object","$ref":"#/definitions/topchain.subscription.Deal"}},"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"topchain.subscription.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/topchain.subscription.Params"}}},"topchain.subscription.QuerySubscriptionResponse":{"type":"object","properties":{"subscription":{"$ref":"#/definitions/topchain.subscription.Subscription"}}},"topchain.subscription.QuerySubscriptionsResponse":{"type":"object","properties":{"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"subscriptions":{"type":"array","items":{"type":"object","$ref":"#/definitions/topchain.subscription.Subscription"}}}},"topchain.subscription.Subscription":{"type":"object","properties":{"deal_id":{"type":"string"},"end_epoch":{"type":"string","format":"uint64"},"id":{"type":"string"},"provider":{"type":"string"},"start_epoch":{"type":"string","format":"uint64"}}},"topology.node.GetCroHashGraphRequest":{"type":"object","properties":{"cro_id":{"type":"string"}}},"topology.node.GetCroHashGraphResponse":{"type":"object","properties":{"vertices_hashes":{"type":"array","title":"linearized vertices hashes","items":{"type":"string"}}}},"topology.node.SubscribeCroRequest":{"type":"object","properties":{"cro_id":{"type":"string"}}},"topology.node.SubscribeCroResponse":{"type":"object","properties":{"return_code":{"type":"integer","format":"int32","title":"can return error codes if different than 0"}}},"topology.node.UnsubscribeCroRequest":{"type":"object","properties":{"cro_id":{"type":"string"}}},"topology.node.UnsubscribeCroResponse":{"type":"object","properties":{"return_code":{"type":"integer","format":"int32","title":"can return error codes if different than 0"}}}},"tags":[{"name":"Query"},{"name":"Msg"},{"name":"TopologyRpc"}]} \ No newline at end of file diff --git a/proto/topchain/challenge/challenge.proto b/proto/topchain/challenge/challenge.proto index 2755f2f..c914bfe 100644 --- a/proto/topchain/challenge/challenge.proto +++ b/proto/topchain/challenge/challenge.proto @@ -7,7 +7,8 @@ message Challenge { string id = 1; string challenger = 2; string provider = 3; - uint64 amount = 4; - uint64 last_active = 5; - bytes challenged_hashes = 6; + string deal_id = 4; + uint64 amount = 5; + uint64 last_active = 6; + bytes challenged_hashes = 7; } \ No newline at end of file diff --git a/proto/topchain/challenge/tx.proto b/proto/topchain/challenge/tx.proto index 03a390d..2699d01 100644 --- a/proto/topchain/challenge/tx.proto +++ b/proto/topchain/challenge/tx.proto @@ -49,7 +49,8 @@ message MsgChallenge { option (cosmos.msg.v1.signer) = "challenger"; string challenger = 1; string provider_id = 2; - repeated string vertices_hashes = 3; + string deal_id = 3; + repeated string vertices_hashes = 4; } message MsgChallengeResponse { diff --git a/proto/topchain/subscription/deal.proto b/proto/topchain/subscription/deal.proto index 9461287..ff39aa0 100644 --- a/proto/topchain/subscription/deal.proto +++ b/proto/topchain/subscription/deal.proto @@ -22,6 +22,8 @@ message Deal { uint64 total_amount = 6; uint64 available_amount = 7; uint64 start_block = 8; - uint64 end_block = 9; - repeated string initial_frontier = 10; + uint64 epoch_size = 9; + uint64 num_epochs = 10; + uint64 reward_per_epoch = 11; + repeated string initial_frontier = 12; } diff --git a/proto/topchain/subscription/subscription.proto b/proto/topchain/subscription/subscription.proto index d682e5a..0a49284 100644 --- a/proto/topchain/subscription/subscription.proto +++ b/proto/topchain/subscription/subscription.proto @@ -7,6 +7,6 @@ message Subscription { string id = 1; string deal_id = 2; string provider = 3; - uint64 start_block = 4; - uint64 end_block = 5; + uint64 start_epoch = 4; + uint64 end_epoch = 5; } diff --git a/proto/topchain/subscription/tx.proto b/proto/topchain/subscription/tx.proto index a54193a..f442d5f 100644 --- a/proto/topchain/subscription/tx.proto +++ b/proto/topchain/subscription/tx.proto @@ -25,6 +25,8 @@ service Msg { rpc JoinDeal (MsgJoinDeal ) returns (MsgJoinDealResponse ); rpc LeaveDeal (MsgLeaveDeal ) returns (MsgLeaveDealResponse ); rpc SubmitProgress (MsgSubmitProgress ) returns (MsgSubmitProgressResponse ); + rpc claimRewards (MsgClaimRewards ) returns (MsgClaimRewardsResponse ); + rpc withdrawResidue (MsgWithdrawResidue ) returns (MsgWithdrawResidueResponse ); } // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { @@ -50,8 +52,9 @@ message MsgCreateDeal { string cro_id = 2; uint64 amount = 3; uint64 start_block = 4; - uint64 end_block = 5; - repeated string initial_frontier = 6; + uint64 epoch_size = 5; + uint64 num_epochs = 6; + repeated string initial_frontier = 7; } message MsgCreateDealResponse { @@ -73,7 +76,8 @@ message MsgUpdateDeal { // these fields should be optional, errors with pulsar uint64 amount = 3; uint64 start_block = 4; - uint64 end_block = 5; + uint64 epoch_size = 5; + uint64 num_epochs = 6; } message MsgUpdateDealResponse {} @@ -114,3 +118,19 @@ message MsgSubmitProgress { } message MsgSubmitProgressResponse {} + +message MsgClaimRewards { + option (cosmos.msg.v1.signer) = "provider"; + string provider = 1; + string subscription_id = 2; +} + +message MsgClaimRewardsResponse {} + +message MsgWithdrawResidue { + option (cosmos.msg.v1.signer) = "requester"; + string requester = 1; + string deal_id = 2; +} + +message MsgWithdrawResidueResponse {} \ No newline at end of file diff --git a/types/constants.go b/types/constants.go new file mode 100644 index 0000000..dd0aa0a --- /dev/null +++ b/types/constants.go @@ -0,0 +1,6 @@ +package types + +const ( + ChallengePeriod = 100 + InactivityPeriod = 100 +) diff --git a/utils/utils.go b/utils/utils.go new file mode 100644 index 0000000..5cc91fc --- /dev/null +++ b/utils/utils.go @@ -0,0 +1,13 @@ +package utils + +import "math" + +const EPOCH_SIZE = 10 + +// 7 days equivalent epochs +const DEAL_EXPIRY_CLAIM_WINDOW = 144 + +func ConvertBlockToEpoch(blockOffset, epochSize uint64) uint64 { + epoch := math.Ceil(float64(blockOffset) / float64(epochSize)) + return uint64(epoch) +} diff --git a/utils/validation/validition.go b/utils/validation/validition.go index b7e6a56..9ed059b 100644 --- a/utils/validation/validition.go +++ b/utils/validation/validition.go @@ -32,9 +32,16 @@ func ValidateAddress(address string) error { return nil } -func ValidateBlockRange(startBlock, endBlock uint64) error { - if startBlock >= endBlock { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "start block must be less than end block") +func ValidateEpochSize(epochSize uint64) error { + if epochSize == 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "epoch size must be greater than 0") + } + return nil +} + +func ValidateNumEpochs(numEpochs uint64) error { + if numEpochs == 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "num epochs must be greater than 0") } return nil } diff --git a/utils/validation/validition_test.go b/utils/validation/validition_test.go index f0eebfe..184e2f3 100644 --- a/utils/validation/validition_test.go +++ b/utils/validation/validition_test.go @@ -62,25 +62,3 @@ func TestValidateAddress(t *testing.T) { }) } } - -func TestValidateBlockRange(t *testing.T) { - tests := []struct { - name string - startBlock uint64 - endBlock uint64 - wantErr bool - }{ - {"Valid block range", 100, 200, false}, - {"Start block equals end block", 100, 100, true}, - {"Start block greater than end block", 200, 100, true}, - {"Zero start block", 0, 100, false}, - {"Large block numbers", 18446744073709551614, 18446744073709551615, false}, // Max uint64 value - 1 and Max uint64 value - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if err := ValidateBlockRange(tt.startBlock, tt.endBlock); (err != nil) != tt.wantErr { - t.Errorf("ValidateBlockRange() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} diff --git a/x/challenge/keeper/challenge.go b/x/challenge/keeper/challenge.go index 4138bde..3c522a5 100644 --- a/x/challenge/keeper/challenge.go +++ b/x/challenge/keeper/challenge.go @@ -1,7 +1,10 @@ package keeper import ( + "bytes" + "encoding/gob" "topchain/x/challenge/types" + sKeeper "topchain/x/subscription/keeper" sTypes "topchain/x/subscription/types" "cosmossdk.io/store/prefix" @@ -14,6 +17,11 @@ const ( InactivityPeriod = 100 ) +type ChallengeHash struct { + Hash string + Epoch uint64 +} + func (k Keeper) SetChallenge(ctx sdk.Context, challenge types.Challenge) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ChallengeKeyPrefix)) @@ -42,16 +50,60 @@ func (k Keeper) RemoveChallenge(ctx sdk.Context, challengeId string) { store.Delete([]byte(challengeId)) } -func (k Keeper) GetHashSubmissionBlock(ctx sdk.Context, provider string, hash string) (block int64, found bool) { +func (k Keeper) GetHashSubmissionEpoch(ctx sdk.Context, provider string, hash string) (block uint64, found bool) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, sTypes.GetHashSubmissionBlockStoreKey(provider)) - blockBytes := store.Get([]byte(hash)) - if blockBytes == nil { + epochBytes := store.Get([]byte(hash)) + if epochBytes == nil { return block, false } + return sdk.BigEndianToUint64(epochBytes), true +} +func (k Keeper) SetDeal(ctx sdk.Context, deal sTypes.Deal) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(sTypes.DealKeyPrefix)) + + appendedValue := k.cdc.MustMarshal(&deal) + store.Set([]byte(deal.Id), appendedValue) + + providerStore := prefix.NewStore(storeAdapter, sTypes.GetRequesterStoreKey(deal.Requester)) + providerStore.Set([]byte(deal.Id), []byte{}) +} + +func (k Keeper) GetDeal(ctx sdk.Context, dealId string) (deal sTypes.Deal, found bool) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(sTypes.DealKeyPrefix)) + dealBytes := store.Get([]byte(dealId)) + if dealBytes == nil { + return deal, false + } + k.cdc.MustUnmarshal(dealBytes, &deal) + return deal, true +} + +func (k Keeper) GetProgressDealAtEpoch(ctx sdk.Context, deal string, epoch uint64) (sKeeper.ProgressDeal, bool) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, sTypes.GetProgressDealStoreKey(deal)) + // Retrieve the progress deal data for the specified block + progressBytes := store.Get(sdk.Uint64ToBigEndian(epoch)) + if progressBytes == nil { + return sKeeper.ProgressDeal{}, false + } + // Decode the retrieved bytes into a ProgressDeal struct + var progressDeal sKeeper.ProgressDeal + buf := bytes.NewBuffer(progressBytes) + gob.NewDecoder(buf).Decode(&progressDeal) + return progressDeal, true +} + +func (k Keeper) SetProgressDealAtEpoch(ctx sdk.Context, deal string, epoch uint64, progressDeal sKeeper.ProgressDeal) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, sTypes.GetProgressDealStoreKey(deal)) - return int64(sdk.BigEndianToUint64(blockBytes)), true + buf := &bytes.Buffer{} + gob.NewEncoder(buf).Encode(progressDeal) + store.Set(sdk.Uint64ToBigEndian(epoch), buf.Bytes()) } // Iterate over all challenges and apply the given callback function diff --git a/x/challenge/keeper/msg_challenge.go b/x/challenge/keeper/msg_challenge.go index b77e532..a232b3c 100644 --- a/x/challenge/keeper/msg_challenge.go +++ b/x/challenge/keeper/msg_challenge.go @@ -8,7 +8,9 @@ import ( "fmt" topTypes "topchain/types" + utils "topchain/utils" "topchain/x/challenge/types" + sKeeper "topchain/x/subscription/keeper" sTypes "topchain/x/subscription/types" errorsmod "cosmossdk.io/errors" @@ -27,17 +29,22 @@ func (k msgServer) Challenge(goCtx context.Context, msg *types.MsgChallenge) (*t return nil, errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "invalid challenger address") } - currentBlock := ctx.BlockHeight() - var hashes sTypes.Set[string] + currentBlock := uint64(ctx.BlockHeight()) + var hashes sTypes.Set[ChallengeHash] + deal, found := k.GetDeal(ctx, msg.DealId) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, fmt.Sprintf("Deal %s not found", msg.DealId)) + } for _, hash := range msg.VerticesHashes { - block, found := k.GetHashSubmissionBlock(ctx, msg.ProviderId, hash) + epoch, found := k.GetHashSubmissionEpoch(ctx, msg.ProviderId, hash) + block := deal.StartBlock + deal.EpochSize*epoch if !found { return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, fmt.Sprintf("hash %s not found", hash)) } else if currentBlock-block > ChallengePeriod { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("hash %s was submitted more than %d blocks ago", hash, ChallengePeriod)) } else { - hashes.Add(hash) + hashes.Add(ChallengeHash{Hash: hash, Epoch: epoch}) } } @@ -136,13 +143,19 @@ func (k msgServer) RequestDependencies(goCtx context.Context, msg *types.MsgRequ return nil, errorsmod.Wrap(err, "failed to send coins to module account") } + deal, found := k.GetDeal(ctx, challenge.DealId) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, fmt.Sprintf("Deal %s not found", challenge.DealId)) + } + buf := bytes.NewBuffer(challenge.ChallengedHashes) var challengedHashes sTypes.Set[string] gob.NewDecoder(buf).Decode(&challengedHashes) - currentBlock := ctx.BlockHeight() + currentBlock := uint64(ctx.BlockHeight()) for _, hash := range msg.VerticesHashes { - block, found := k.GetHashSubmissionBlock(ctx, challenge.Provider, hash) + epoch, found := k.GetHashSubmissionEpoch(ctx, challenge.Provider, hash) + block := deal.StartBlock + deal.EpochSize*epoch if !found { return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, fmt.Sprintf("hash %s not found", hash)) } @@ -179,18 +192,60 @@ func (k msgServer) SettleChallenge(goCtx context.Context, msg *types.MsgSettleCh } buf := bytes.NewBuffer(challenge.ChallengedHashes) - var challengedHashes sTypes.Set[string] + var challengedHashes sTypes.Set[ChallengeHash] gob.NewDecoder(buf).Decode(&challengedHashes) + deal, _ := k.GetDeal(ctx, challenge.DealId) + coins := sdk.NewCoins(sdk.NewInt64Coin("top", int64(challenge.Amount))) if len(challengedHashes) == 0 { // all hashes were verified - send coins to provider, remove challenge k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.AccAddress(challenge.Provider), coins) } else { - // some hashes were not verified - send coins to challenger - k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.AccAddress(challenge.Challenger), coins) + // remove the provider's progress for each of the epochs where challenge failed + rewardConfiscated := uint64(0) + var failedEpochs sTypes.Set[uint64] + for challengedHash := range challengedHashes { + + if failedEpochs.Has(challengedHash.Epoch) { + // this epoch was already processed + continue + } + progressDeal, found := k.GetProgressDealAtEpoch(ctx, challenge.DealId, challengedHash.Epoch) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrNotFound, "this should not happen") + } + isEpochRugged := updateProgressDeal(&progressDeal, challenge.Provider) + if isEpochRugged { + rewardConfiscated += deal.RewardPerEpoch + } + failedEpochs.Add(challengedHash.Epoch) + // update the progressDeal + k.SetProgressDealAtEpoch(ctx, challenge.DealId, challengedHash.Epoch, progressDeal) + } + // the confiscated reward goes back to the available reward pool + deal.AvailableAmount += rewardConfiscated + // reward per epoch is incremented for all the remaining epochs + currentEpoch := utils.ConvertBlockToEpoch(uint64(ctx.BlockHeight())-deal.StartBlock, deal.EpochSize) + deal.RewardPerEpoch += rewardConfiscated / (deal.NumEpochs - currentEpoch + 1) + k.SetDeal(ctx, deal) } k.RemoveChallenge(ctx, challenge.Id) return &types.MsgSettleChallengeResponse{}, nil } + +func updateProgressDeal(progressDeal *sKeeper.ProgressDeal, provider string) bool { + amount := uint64(0) + + for _, progress := range progressDeal.Progress { + if progress.Provider == provider { + amount = progress.Size + progress.Size = 0 + break + } + } + progressDeal.Total -= amount + + return progressDeal.Total == 0 +} diff --git a/x/challenge/types/challenge.pb.go b/x/challenge/types/challenge.pb.go index 1bcad2e..c732f8c 100644 --- a/x/challenge/types/challenge.pb.go +++ b/x/challenge/types/challenge.pb.go @@ -26,9 +26,10 @@ type Challenge struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Challenger string `protobuf:"bytes,2,opt,name=challenger,proto3" json:"challenger,omitempty"` Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` - LastActive uint64 `protobuf:"varint,5,opt,name=last_active,json=lastActive,proto3" json:"last_active,omitempty"` - ChallengedHashes []byte `protobuf:"bytes,6,opt,name=challenged_hashes,json=challengedHashes,proto3" json:"challenged_hashes,omitempty"` + DealId string `protobuf:"bytes,4,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` + Amount uint64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` + LastActive uint64 `protobuf:"varint,6,opt,name=last_active,json=lastActive,proto3" json:"last_active,omitempty"` + ChallengedHashes []byte `protobuf:"bytes,7,opt,name=challenged_hashes,json=challengedHashes,proto3" json:"challenged_hashes,omitempty"` } func (m *Challenge) Reset() { *m = Challenge{} } @@ -85,6 +86,13 @@ func (m *Challenge) GetProvider() string { return "" } +func (m *Challenge) GetDealId() string { + if m != nil { + return m.DealId + } + return "" +} + func (m *Challenge) GetAmount() uint64 { if m != nil { return m.Amount @@ -115,22 +123,23 @@ func init() { } var fileDescriptor_54bf9c459e09fb71 = []byte{ - // 229 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0xc9, 0x2f, 0x48, - 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x4f, 0xce, 0x48, 0xcc, 0xc9, 0x49, 0xcd, 0x4b, 0x4f, 0x45, 0xb0, - 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x84, 0x60, 0x6a, 0xf4, 0xe0, 0x32, 0x4a, 0x7b, 0x19, - 0xb9, 0x38, 0x9d, 0x61, 0x3c, 0x21, 0x3e, 0x2e, 0xa6, 0xcc, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, - 0xce, 0x20, 0xa6, 0xcc, 0x14, 0x21, 0x39, 0x2e, 0x2e, 0xb8, 0xd2, 0x22, 0x09, 0x26, 0xb0, 0x38, - 0x92, 0x88, 0x90, 0x14, 0x17, 0x47, 0x41, 0x51, 0x7e, 0x59, 0x66, 0x4a, 0x6a, 0x91, 0x04, 0x33, - 0x58, 0x16, 0xce, 0x17, 0x12, 0xe3, 0x62, 0x4b, 0xcc, 0xcd, 0x2f, 0xcd, 0x2b, 0x91, 0x60, 0x51, - 0x60, 0xd4, 0x60, 0x09, 0x82, 0xf2, 0x84, 0xe4, 0xb9, 0xb8, 0x73, 0x12, 0x8b, 0x4b, 0xe2, 0x13, - 0x93, 0x4b, 0x32, 0xcb, 0x52, 0x25, 0x58, 0xc1, 0x92, 0x5c, 0x20, 0x21, 0x47, 0xb0, 0x88, 0x90, - 0x36, 0x97, 0x20, 0xdc, 0x8a, 0x94, 0xf8, 0x8c, 0xc4, 0xe2, 0x8c, 0xd4, 0x62, 0x09, 0x36, 0x05, - 0x46, 0x0d, 0x9e, 0x20, 0x01, 0x84, 0x84, 0x07, 0x58, 0xdc, 0xc9, 0xe4, 0xc4, 0x23, 0x39, 0xc6, - 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, - 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xa4, 0xe0, 0x21, 0x52, 0x81, 0x14, 0x26, 0x25, 0x95, 0x05, - 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x00, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xad, 0x1f, 0xe2, - 0xbf, 0x36, 0x01, 0x00, 0x00, + // 248 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0x31, 0x4e, 0xc3, 0x30, + 0x14, 0x86, 0xf3, 0x42, 0x49, 0xe9, 0x03, 0x21, 0x78, 0x03, 0x58, 0x1d, 0x4c, 0xd4, 0x29, 0x12, + 0x52, 0x19, 0xe0, 0x02, 0xc0, 0x02, 0x6b, 0x46, 0x96, 0xc8, 0xc4, 0x16, 0xb1, 0x14, 0xe2, 0x28, + 0x36, 0x15, 0xdc, 0x82, 0x63, 0x31, 0x76, 0x42, 0x8c, 0x28, 0xb9, 0x08, 0xaa, 0x45, 0xdd, 0x6c, + 0xfe, 0xbe, 0xef, 0x49, 0x96, 0x7e, 0x5c, 0x38, 0xd3, 0x96, 0x95, 0xd0, 0xcd, 0x55, 0x59, 0x89, + 0xba, 0x56, 0xcd, 0x8b, 0xda, 0xbd, 0x96, 0x6d, 0x67, 0x9c, 0x21, 0xda, 0xde, 0x2c, 0x43, 0x59, + 0x7c, 0x03, 0xce, 0xee, 0xb7, 0x44, 0xc7, 0x18, 0x6b, 0xc9, 0x20, 0x85, 0x6c, 0x96, 0xc7, 0x5a, + 0x12, 0x47, 0x0c, 0xa7, 0x1d, 0x8b, 0xbd, 0x1f, 0x19, 0x9a, 0xe3, 0x41, 0xdb, 0x99, 0x95, 0x96, + 0xaa, 0x63, 0x7b, 0xbe, 0x06, 0xa6, 0x73, 0x9c, 0x4a, 0x25, 0xea, 0x42, 0x4b, 0x36, 0xf1, 0x29, + 0xd9, 0xe0, 0xa3, 0xa4, 0x33, 0x4c, 0xc4, 0xab, 0x79, 0x6b, 0x1c, 0xdb, 0x4f, 0x21, 0x9b, 0xe4, + 0xff, 0x44, 0x17, 0x78, 0x58, 0x0b, 0xeb, 0x0a, 0x51, 0x3a, 0xbd, 0x52, 0x2c, 0xf1, 0x11, 0x37, + 0xea, 0xd6, 0x1b, 0xba, 0xc4, 0xd3, 0xf0, 0xb7, 0x2c, 0x2a, 0x61, 0x2b, 0x65, 0xd9, 0x34, 0x85, + 0xec, 0x28, 0x3f, 0xd9, 0x85, 0x07, 0xef, 0xef, 0x6e, 0xbe, 0x7a, 0x0e, 0xeb, 0x9e, 0xc3, 0x6f, + 0xcf, 0xe1, 0x73, 0xe0, 0xd1, 0x7a, 0xe0, 0xd1, 0xcf, 0xc0, 0xa3, 0xa7, 0x79, 0x98, 0xea, 0x7d, + 0x34, 0x96, 0xfb, 0x68, 0x95, 0x7d, 0x4e, 0xfc, 0x52, 0xd7, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x41, 0x5b, 0x78, 0x51, 0x4f, 0x01, 0x00, 0x00, } func (m *Challenge) Marshal() (dAtA []byte, err error) { @@ -158,17 +167,24 @@ func (m *Challenge) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.ChallengedHashes) i = encodeVarintChallenge(dAtA, i, uint64(len(m.ChallengedHashes))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a } if m.LastActive != 0 { i = encodeVarintChallenge(dAtA, i, uint64(m.LastActive)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x30 } if m.Amount != 0 { i = encodeVarintChallenge(dAtA, i, uint64(m.Amount)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 + } + if len(m.DealId) > 0 { + i -= len(m.DealId) + copy(dAtA[i:], m.DealId) + i = encodeVarintChallenge(dAtA, i, uint64(len(m.DealId))) + i-- + dAtA[i] = 0x22 } if len(m.Provider) > 0 { i -= len(m.Provider) @@ -223,6 +239,10 @@ func (m *Challenge) Size() (n int) { if l > 0 { n += 1 + l + sovChallenge(uint64(l)) } + l = len(m.DealId) + if l > 0 { + n += 1 + l + sovChallenge(uint64(l)) + } if m.Amount != 0 { n += 1 + sovChallenge(uint64(m.Amount)) } @@ -368,6 +388,38 @@ func (m *Challenge) Unmarshal(dAtA []byte) error { m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChallenge + } + 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 ErrInvalidLengthChallenge + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChallenge + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DealId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -386,7 +438,7 @@ func (m *Challenge) Unmarshal(dAtA []byte) error { break } } - case 5: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field LastActive", wireType) } @@ -405,7 +457,7 @@ func (m *Challenge) Unmarshal(dAtA []byte) error { break } } - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ChallengedHashes", wireType) } diff --git a/x/challenge/types/tx.pb.go b/x/challenge/types/tx.pb.go index 0e62874..1bce5fb 100644 --- a/x/challenge/types/tx.pb.go +++ b/x/challenge/types/tx.pb.go @@ -129,7 +129,8 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo type MsgChallenge struct { Challenger string `protobuf:"bytes,1,opt,name=challenger,proto3" json:"challenger,omitempty"` ProviderId string `protobuf:"bytes,2,opt,name=provider_id,json=providerId,proto3" json:"provider_id,omitempty"` - VerticesHashes []string `protobuf:"bytes,3,rep,name=vertices_hashes,json=verticesHashes,proto3" json:"vertices_hashes,omitempty"` + DealId string `protobuf:"bytes,3,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` + VerticesHashes []string `protobuf:"bytes,4,rep,name=vertices_hashes,json=verticesHashes,proto3" json:"vertices_hashes,omitempty"` } func (m *MsgChallenge) Reset() { *m = MsgChallenge{} } @@ -179,6 +180,13 @@ func (m *MsgChallenge) GetProviderId() string { return "" } +func (m *MsgChallenge) GetDealId() string { + if m != nil { + return m.DealId + } + return "" +} + func (m *MsgChallenge) GetVerticesHashes() []string { if m != nil { return m.VerticesHashes @@ -526,47 +534,49 @@ func init() { func init() { proto.RegisterFile("topchain/challenge/tx.proto", fileDescriptor_db2576f3a8524022) } var fileDescriptor_db2576f3a8524022 = []byte{ - // 639 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcf, 0x6f, 0x12, 0x41, - 0x14, 0xc7, 0xd9, 0x56, 0x9b, 0xee, 0xa3, 0x96, 0x38, 0x36, 0x96, 0x8e, 0xcd, 0x16, 0x57, 0xa3, - 0x04, 0x23, 0x1b, 0xab, 0xa9, 0x91, 0xc4, 0x83, 0xe8, 0xc1, 0x1e, 0x48, 0x9a, 0x6d, 0xd4, 0xc4, - 0xc4, 0xe0, 0x96, 0x1d, 0x97, 0x4d, 0x60, 0x67, 0xdd, 0x19, 0x48, 0x7b, 0x33, 0x9e, 0xd4, 0x93, - 0x17, 0xfd, 0x1b, 0x3c, 0x72, 0xf0, 0x1f, 0xf0, 0xd6, 0x63, 0xe3, 0xc9, 0x93, 0x31, 0x70, 0xe0, - 0xdf, 0x30, 0xfb, 0x6b, 0x58, 0x60, 0x11, 0xe2, 0x05, 0x98, 0xf7, 0xbe, 0xef, 0xbd, 0xcf, 0x9b, - 0xf7, 0x18, 0xb8, 0xc2, 0xa9, 0xdb, 0x68, 0x1a, 0xb6, 0xa3, 0x35, 0x9a, 0x46, 0xab, 0x45, 0x1c, - 0x8b, 0x68, 0xfc, 0xb8, 0xec, 0x7a, 0x94, 0x53, 0x84, 0x62, 0x67, 0x59, 0x38, 0xf1, 0x45, 0xa3, - 0x6d, 0x3b, 0x54, 0x0b, 0x3e, 0x43, 0x19, 0xde, 0x6c, 0x50, 0xd6, 0xa6, 0x4c, 0x6b, 0x33, 0x4b, - 0xeb, 0xde, 0xf1, 0xbf, 0x22, 0xc7, 0x56, 0xe8, 0xa8, 0x07, 0x27, 0x2d, 0x3c, 0x44, 0xae, 0x0d, - 0x8b, 0x5a, 0x34, 0xb4, 0xfb, 0xbf, 0x22, 0xeb, 0x4e, 0x0a, 0x8d, 0x6b, 0x78, 0x46, 0x9b, 0xfd, - 0x43, 0xd0, 0x25, 0x1e, 0x27, 0x11, 0xb2, 0xfa, 0x43, 0x82, 0x5c, 0x8d, 0x59, 0xcf, 0x5c, 0xd3, - 0xe0, 0xe4, 0x20, 0x08, 0x45, 0x7b, 0x20, 0x1b, 0x1d, 0xde, 0xa4, 0x9e, 0xcd, 0x4f, 0xf2, 0x52, - 0x41, 0x2a, 0xca, 0xd5, 0xfc, 0xcf, 0xef, 0xb7, 0x37, 0x22, 0xa0, 0x47, 0xa6, 0xe9, 0x11, 0xc6, - 0x0e, 0xb9, 0x67, 0x3b, 0x96, 0x3e, 0x92, 0xa2, 0x87, 0xb0, 0x12, 0x16, 0xcf, 0x2f, 0x15, 0xa4, - 0x62, 0x76, 0x17, 0x97, 0xa7, 0xef, 0xa3, 0x1c, 0xd6, 0xa8, 0xca, 0xa7, 0xbf, 0x77, 0x32, 0xdf, - 0x86, 0xbd, 0x92, 0xa4, 0x47, 0x41, 0x95, 0xfb, 0xef, 0x87, 0xbd, 0xd2, 0x28, 0xdd, 0xa7, 0x61, - 0xaf, 0x74, 0x5d, 0xe0, 0x1f, 0x27, 0x1a, 0x98, 0xe0, 0x55, 0xb7, 0x60, 0x73, 0xc2, 0xa4, 0x13, - 0xe6, 0x52, 0x87, 0x11, 0xf5, 0xa3, 0x04, 0x6b, 0x35, 0x66, 0x3d, 0x8e, 0x63, 0x91, 0x02, 0x20, - 0x12, 0x79, 0x61, 0x73, 0x7a, 0xc2, 0x82, 0x76, 0x20, 0xeb, 0x7a, 0xb4, 0x6b, 0x9b, 0xc4, 0xab, - 0xdb, 0x66, 0xd0, 0x88, 0xac, 0x43, 0x6c, 0xda, 0x37, 0xd1, 0x4d, 0xc8, 0xf9, 0x17, 0x68, 0x37, - 0x08, 0xab, 0x37, 0x0d, 0xd6, 0x24, 0x2c, 0xbf, 0x5c, 0x58, 0x2e, 0xca, 0xfa, 0x7a, 0x6c, 0x7e, - 0x1a, 0x58, 0x2b, 0x39, 0xbf, 0x9d, 0x44, 0x6a, 0xf5, 0x01, 0x6c, 0x24, 0x51, 0x62, 0x46, 0x74, - 0x15, 0xd6, 0x84, 0xca, 0xaf, 0x19, 0x42, 0x65, 0x85, 0x6d, 0xdf, 0x54, 0xbf, 0x4a, 0xb0, 0x5e, - 0x63, 0xd6, 0x61, 0xe7, 0xa8, 0x6d, 0xf3, 0x03, 0x8f, 0xd2, 0x37, 0x08, 0xc3, 0x6a, 0x4c, 0x15, - 0x45, 0x88, 0xf3, 0x54, 0xc6, 0xa5, 0xa9, 0x8c, 0x68, 0x0f, 0x56, 0x63, 0xde, 0x80, 0x7f, 0xc6, - 0xb4, 0x9e, 0x07, 0xbb, 0xa2, 0x0b, 0x6d, 0xe5, 0x82, 0xdf, 0x95, 0xa8, 0xa4, 0xe6, 0xe1, 0xf2, - 0x38, 0x97, 0xb8, 0xf9, 0x2f, 0x52, 0xe0, 0xd2, 0xc9, 0xdb, 0x0e, 0x61, 0xfc, 0x09, 0x71, 0x89, - 0x63, 0x12, 0xa7, 0x61, 0x13, 0x36, 0x77, 0x06, 0x0b, 0xe0, 0xff, 0xff, 0x14, 0x0a, 0xa0, 0xa4, - 0x63, 0x09, 0x72, 0x02, 0xc8, 0xef, 0x89, 0x70, 0xde, 0x22, 0xa3, 0xc5, 0xd9, 0x06, 0xd9, 0x0b, - 0x83, 0x04, 0xf3, 0xc8, 0xb0, 0x00, 0x72, 0x65, 0x3d, 0x58, 0x6f, 0x11, 0xa2, 0x6e, 0x03, 0x9e, - 0x2e, 0x13, 0x43, 0xec, 0x7e, 0x38, 0x07, 0xcb, 0x35, 0x66, 0xa1, 0xd7, 0xb0, 0x36, 0xf6, 0xdf, - 0xbc, 0x96, 0x36, 0xa5, 0x89, 0xed, 0xc7, 0xb7, 0x16, 0x10, 0x89, 0xf5, 0x7b, 0x01, 0xf2, 0xa8, - 0xcb, 0xc2, 0x8c, 0x48, 0xa1, 0xc0, 0xc5, 0x79, 0x0a, 0x91, 0xf8, 0x15, 0x64, 0x93, 0x0b, 0xab, - 0xce, 0x08, 0x4c, 0x68, 0x70, 0x69, 0xbe, 0x46, 0xa4, 0xef, 0xc0, 0xa5, 0xb4, 0xe5, 0x9a, 0x95, - 0x22, 0x45, 0x8b, 0x77, 0x17, 0xd7, 0x8a, 0xb2, 0x36, 0xe4, 0x26, 0x57, 0xe3, 0xc6, 0x2c, 0xea, - 0x71, 0x1d, 0x2e, 0x2f, 0xa6, 0x8b, 0x4b, 0xe1, 0xf3, 0xef, 0xfc, 0xf7, 0xb1, 0x7a, 0xef, 0xb4, - 0xaf, 0x48, 0x67, 0x7d, 0x45, 0xfa, 0xd3, 0x57, 0xa4, 0xcf, 0x03, 0x25, 0x73, 0x36, 0x50, 0x32, - 0xbf, 0x06, 0x4a, 0xe6, 0x25, 0x4e, 0x7d, 0x1e, 0xf9, 0x89, 0x4b, 0xd8, 0xd1, 0x4a, 0xf0, 0xbe, - 0xdf, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xe1, 0xa7, 0x41, 0x6b, 0xb1, 0x06, 0x00, 0x00, + // 661 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xc7, 0xe3, 0xba, 0xbf, 0xfe, 0xea, 0x49, 0x69, 0xc4, 0x52, 0x51, 0x77, 0xa9, 0x5c, 0x63, + 0x10, 0x44, 0x41, 0xc4, 0xa2, 0xa0, 0x22, 0x22, 0x71, 0xa0, 0x70, 0xa0, 0x87, 0x48, 0x95, 0x2b, + 0x40, 0x42, 0x42, 0xc5, 0x8d, 0x17, 0xc7, 0x52, 0xe2, 0x35, 0xde, 0x4d, 0xd5, 0xde, 0x10, 0x27, + 0xc4, 0x89, 0x0b, 0x3c, 0x00, 0x27, 0x8e, 0x3d, 0xf0, 0x02, 0xdc, 0x7a, 0xac, 0x38, 0x71, 0x42, + 0xa8, 0x3d, 0xf4, 0x35, 0x90, 0xff, 0x6d, 0xdc, 0xc4, 0xa1, 0xbe, 0x24, 0xde, 0x99, 0xef, 0xcc, + 0x7c, 0xc6, 0x33, 0x5e, 0xb8, 0xc2, 0x69, 0xd0, 0xe9, 0xda, 0x9e, 0x6f, 0x76, 0xba, 0x76, 0xaf, + 0x47, 0x7c, 0x97, 0x98, 0x7c, 0xaf, 0x19, 0x84, 0x94, 0x53, 0x84, 0x32, 0x67, 0x53, 0x38, 0xf1, + 0x45, 0xbb, 0xef, 0xf9, 0xd4, 0x8c, 0x7f, 0x13, 0x19, 0x5e, 0xec, 0x50, 0xd6, 0xa7, 0xcc, 0xec, + 0x33, 0xd7, 0xdc, 0xbd, 0x13, 0xfd, 0xa5, 0x8e, 0xa5, 0xc4, 0xb1, 0x1d, 0x9f, 0xcc, 0xe4, 0x90, + 0xba, 0x16, 0x5c, 0xea, 0xd2, 0xc4, 0x1e, 0x3d, 0xa5, 0xd6, 0x95, 0x02, 0x9a, 0xc0, 0x0e, 0xed, + 0x3e, 0xfb, 0x87, 0x60, 0x97, 0x84, 0x9c, 0xa4, 0xc8, 0xc6, 0x0f, 0x09, 0x6a, 0x6d, 0xe6, 0x3e, + 0x0b, 0x1c, 0x9b, 0x93, 0xcd, 0x38, 0x14, 0xad, 0x81, 0x62, 0x0f, 0x78, 0x97, 0x86, 0x1e, 0xdf, + 0x57, 0x25, 0x5d, 0xaa, 0x2b, 0xeb, 0xea, 0xcf, 0xef, 0xb7, 0x17, 0x52, 0xa0, 0x47, 0x8e, 0x13, + 0x12, 0xc6, 0xb6, 0x78, 0xe8, 0xf9, 0xae, 0x35, 0x94, 0xa2, 0x87, 0x30, 0x93, 0x14, 0x57, 0xa7, + 0x74, 0xa9, 0x5e, 0x5d, 0xc5, 0xcd, 0xf1, 0xf7, 0xd1, 0x4c, 0x6a, 0xac, 0x2b, 0x87, 0xbf, 0x57, + 0x2a, 0xdf, 0x4e, 0x0f, 0x1a, 0x92, 0x95, 0x06, 0xb5, 0xee, 0xbf, 0x3f, 0x3d, 0x68, 0x0c, 0xd3, + 0x7d, 0x3c, 0x3d, 0x68, 0x5c, 0x17, 0xf8, 0x7b, 0xb9, 0x06, 0x46, 0x78, 0x8d, 0x25, 0x58, 0x1c, + 0x31, 0x59, 0x84, 0x05, 0xd4, 0x67, 0xc4, 0xf8, 0x2a, 0xc1, 0x5c, 0x9b, 0xb9, 0x8f, 0xb3, 0x58, + 0xa4, 0x01, 0x88, 0x44, 0x61, 0xd2, 0x9c, 0x95, 0xb3, 0xa0, 0x15, 0xa8, 0x06, 0x21, 0xdd, 0xf5, + 0x1c, 0x12, 0x6e, 0x7b, 0x4e, 0xdc, 0x88, 0x62, 0x41, 0x66, 0xda, 0x70, 0xd0, 0x22, 0xfc, 0xef, + 0x10, 0xbb, 0x17, 0x39, 0xe5, 0xd8, 0x39, 0x13, 0x1d, 0x37, 0x1c, 0x74, 0x13, 0x6a, 0xd1, 0x9b, + 0xf5, 0x3a, 0x84, 0x6d, 0x77, 0x6d, 0xd6, 0x25, 0x4c, 0x9d, 0xd6, 0xe5, 0xba, 0x62, 0xcd, 0x67, + 0xe6, 0xa7, 0xb1, 0xb5, 0x55, 0x8b, 0xfa, 0xcc, 0xd5, 0x34, 0x1e, 0xc0, 0x42, 0x9e, 0x31, 0x83, + 0x47, 0x57, 0x61, 0x4e, 0xa8, 0xa2, 0x7a, 0x09, 0x6d, 0x55, 0xd8, 0x36, 0x1c, 0xe3, 0x8b, 0x04, + 0xf3, 0x6d, 0xe6, 0x6e, 0x0d, 0x76, 0xfa, 0x1e, 0xdf, 0x0c, 0x29, 0x7d, 0x83, 0x30, 0xcc, 0x66, + 0xb8, 0x69, 0x84, 0x38, 0x8f, 0x65, 0x9c, 0x1a, 0xcb, 0x88, 0xd6, 0x60, 0x36, 0xe3, 0x55, 0x65, + 0x5d, 0x9e, 0x34, 0xc6, 0xe7, 0xf1, 0x12, 0x59, 0x42, 0xdb, 0xba, 0x10, 0x75, 0x25, 0x2a, 0x19, + 0x2a, 0x5c, 0x3e, 0xcb, 0x25, 0x46, 0xf2, 0x59, 0x8a, 0x5d, 0x16, 0x79, 0x3b, 0x20, 0x8c, 0x3f, + 0x21, 0x01, 0xf1, 0x1d, 0xe2, 0x77, 0x3c, 0xc2, 0xce, 0x1d, 0x4e, 0x09, 0xfc, 0x82, 0x29, 0xc8, + 0xe5, 0xa6, 0xa0, 0x83, 0x56, 0x8c, 0x25, 0xc8, 0x09, 0xa0, 0xa8, 0x27, 0xc2, 0x79, 0x8f, 0x0c, + 0x37, 0x6a, 0x19, 0x94, 0x30, 0x09, 0x12, 0xcc, 0x43, 0x43, 0x09, 0xe4, 0xd6, 0x7c, 0xbc, 0xf7, + 0x22, 0xc4, 0x58, 0x06, 0x3c, 0x5e, 0x26, 0x83, 0x58, 0xfd, 0x30, 0x0d, 0x72, 0x9b, 0xb9, 0xe8, + 0x35, 0xcc, 0x9d, 0xf9, 0x68, 0xaf, 0x15, 0x4d, 0x69, 0xe4, 0xb3, 0xc0, 0xb7, 0x4a, 0x88, 0xc4, + 0xfa, 0xbd, 0x00, 0x65, 0xd8, 0xa5, 0x3e, 0x21, 0x52, 0x28, 0x70, 0xfd, 0x3c, 0x85, 0x48, 0xfc, + 0x0a, 0xaa, 0xf9, 0x85, 0x35, 0x26, 0x04, 0xe6, 0x34, 0xb8, 0x71, 0xbe, 0x46, 0xa4, 0x1f, 0xc0, + 0xa5, 0xa2, 0xe5, 0x9a, 0x94, 0xa2, 0x40, 0x8b, 0x57, 0xcb, 0x6b, 0x45, 0x59, 0x0f, 0x6a, 0xa3, + 0xab, 0x71, 0x63, 0x12, 0xf5, 0x59, 0x1d, 0x6e, 0x96, 0xd3, 0x65, 0xa5, 0xf0, 0x7f, 0xef, 0xa2, + 0x8b, 0x73, 0xfd, 0xde, 0xe1, 0xb1, 0x26, 0x1d, 0x1d, 0x6b, 0xd2, 0x9f, 0x63, 0x4d, 0xfa, 0x74, + 0xa2, 0x55, 0x8e, 0x4e, 0xb4, 0xca, 0xaf, 0x13, 0xad, 0xf2, 0x12, 0x17, 0xde, 0x9b, 0x7c, 0x3f, + 0x20, 0x6c, 0x67, 0x26, 0xbe, 0xf8, 0xef, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x96, 0x98, 0x38, + 0x2d, 0xca, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -887,9 +897,16 @@ func (m *MsgChallenge) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.VerticesHashes[iNdEx]) i = encodeVarintTx(dAtA, i, uint64(len(m.VerticesHashes[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } + if len(m.DealId) > 0 { + i -= len(m.DealId) + copy(dAtA[i:], m.DealId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DealId))) + i-- + dAtA[i] = 0x1a + } if len(m.ProviderId) > 0 { i -= len(m.ProviderId) copy(dAtA[i:], m.ProviderId) @@ -1189,6 +1206,10 @@ func (m *MsgChallenge) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.DealId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } if len(m.VerticesHashes) > 0 { for _, s := range m.VerticesHashes { l = len(s) @@ -1566,6 +1587,38 @@ func (m *MsgChallenge) Unmarshal(dAtA []byte) error { m.ProviderId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", 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.DealId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VerticesHashes", wireType) } diff --git a/x/subscription/keeper/deal.go b/x/subscription/keeper/deal.go index b6e669d..a856731 100644 --- a/x/subscription/keeper/deal.go +++ b/x/subscription/keeper/deal.go @@ -1,6 +1,7 @@ package keeper import ( + "topchain/utils" "topchain/x/subscription/types" "cosmossdk.io/store/prefix" @@ -39,7 +40,8 @@ func (k Keeper) IsDealActive(ctx sdk.Context, deal types.Deal) bool { if !found { continue } - if subscription.StartBlock <= uint64(ctx.BlockHeight()) && subscription.EndBlock >= uint64(ctx.BlockHeight()) { + currentEpoch := utils.ConvertBlockToEpoch(uint64(ctx.BlockHeight())-deal.StartBlock, deal.EpochSize) + if subscription.StartEpoch <= currentEpoch && subscription.EndEpoch >= currentEpoch { return true } } @@ -54,7 +56,8 @@ func (k Keeper) GetAllActiveSubscriptions(ctx sdk.Context, deal types.Deal) map[ if !found { continue } - if subscription.StartBlock <= uint64(ctx.BlockHeight()) && subscription.EndBlock >= uint64(ctx.BlockHeight()) { + currentEpoch := utils.ConvertBlockToEpoch(uint64(ctx.BlockHeight())-deal.StartBlock, deal.EpochSize) + if subscription.StartEpoch <= currentEpoch && subscription.EndEpoch >= currentEpoch { subscriptions[subscriptionId] = subscription.Provider } } @@ -77,16 +80,17 @@ func (k Keeper) IsDealUnavailable(status types.Deal_Status) bool { func (k Keeper) DealHasProvider(ctx sdk.Context, deal types.Deal, provider string) bool { for _, subscriptionId := range deal.SubscriptionIds { sub, _ := k.GetSubscription(ctx, subscriptionId) - if sub.Provider == provider && uint64(ctx.BlockHeight()) <= sub.EndBlock { + currentEpoch := utils.ConvertBlockToEpoch(uint64(ctx.BlockHeight())-deal.StartBlock, deal.EpochSize) + if sub.Provider == provider && currentEpoch <= sub.EndEpoch { return true } } return false } -func (k Keeper) CalculateBlockReward(ctx sdk.Context, deal types.Deal) int64 { - remainingBlocks := deal.EndBlock - uint64(ctx.BlockHeight()) - return int64(deal.AvailableAmount) / int64(remainingBlocks) +func (k Keeper) CalculateEpochReward(deal types.Deal) uint64 { + // divide the reward equally between the epochs + return deal.TotalAmount / deal.NumEpochs } // Iterate over all deals and apply the given callback function diff --git a/x/subscription/keeper/deal_test.go b/x/subscription/keeper/deal_test.go index 5b8d90b..7292451 100644 --- a/x/subscription/keeper/deal_test.go +++ b/x/subscription/keeper/deal_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "topchain/utils" "topchain/x/subscription/types" "github.com/stretchr/testify/require" @@ -15,7 +16,7 @@ func TestGetSetDeal(t *testing.T) { require.NotEmpty(t, k) // Create a deal - deal := types.Deal{Id: "12345", CroId: "alicecro", Requester: Alice, Status: types.Deal_SCHEDULED, AvailableAmount: 1000, TotalAmount: 100, StartBlock: 10, EndBlock: 20} + deal := types.Deal{Id: "12345", CroId: "alicecro", Requester: Alice, Status: types.Deal_SCHEDULED, AvailableAmount: 1000, TotalAmount: 100, NumEpochs: 10, EpochSize: 20} k.SetDeal(ctx, deal) dealResponse, found := k.GetDeal(ctx, deal.Id) @@ -30,26 +31,26 @@ func TestDealActive(t *testing.T) { require.NotEmpty(t, k) // create a subscription - sub := types.Subscription{Id: "123", DealId: "12345", Provider: "provider1", StartBlock: 10, EndBlock: 15} + sub := types.Subscription{Id: "123", DealId: "12345", Provider: "provider1", StartEpoch: 10, EndEpoch: 15} k.SetSubscription(ctx, sub) // Create a deal - deal := types.Deal{Id: "12345", CroId: "alicecro", Requester: Alice, Status: types.Deal_UNDEFINED, AvailableAmount: 1000, TotalAmount: 100, StartBlock: 10, EndBlock: 20, SubscriptionIds: []string{"123"}} + deal := types.Deal{Id: "12345", CroId: "alicecro", Requester: Alice, Status: types.Deal_UNDEFINED, AvailableAmount: 1000, TotalAmount: 100, NumEpochs: 10, EpochSize: 20, SubscriptionIds: []string{"123"}} k.SetDeal(ctx, deal) - // The deal must be inactive at block number 0 + // The deal must be inactive at epoch number 0 isActive := k.IsDealActive(ctx, deal) require.False(t, isActive) - // Jump to block 12 - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) - // The deal must be active at block number 12 + // The deal must be active at epoch number 12 isActive = k.IsDealActive(ctx, deal) require.True(t, isActive) - // Jump to block 18 - ctx = MockBlockHeight(ctx, am, 18) - // The deal must be inactive at block number 18 + // Jump to epoch 18 + ctx = MockBlockHeight(ctx, am, 18*utils.EPOCH_SIZE) + // The deal must be inactive at epoch number 18 isActive = k.IsDealActive(ctx, deal) require.False(t, isActive) @@ -62,28 +63,28 @@ func TestGetAllActiveProviders(t *testing.T) { require.NotEmpty(t, k) // create a subscription - sub := types.Subscription{Id: "123", DealId: "12345", Provider: "provider1", StartBlock: 10, EndBlock: 15} + sub := types.Subscription{Id: "123", DealId: "12345", Provider: "provider1", StartEpoch: 10, EndEpoch: 15} k.SetSubscription(ctx, sub) // Create a deal - deal := types.Deal{Id: "12345", CroId: "alicecro", Requester: Alice, Status: types.Deal_UNDEFINED, AvailableAmount: 1000, TotalAmount: 100, StartBlock: 10, EndBlock: 20, SubscriptionIds: []string{"123"}} + deal := types.Deal{Id: "12345", CroId: "alicecro", Requester: Alice, Status: types.Deal_UNDEFINED, AvailableAmount: 1000, TotalAmount: 100, NumEpochs: 10, EpochSize: 20, SubscriptionIds: []string{"123"}} k.SetDeal(ctx, deal) activeSubs := k.GetAllActiveSubscriptions(ctx, deal) - // there shouldn't be any active subs at block 0 + // there shouldn't be any active subs at epoch 0 require.True(t, len(activeSubs) == 0) - // Jump to block 12 - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) activeSubs = k.GetAllActiveSubscriptions(ctx, deal) - // there should be an active subs at block 12 + // there should be an active subs at epoch 12 require.True(t, len(activeSubs) == 1) _, ok := activeSubs[sub.Id] require.True(t, ok) - // Jump to block 18 - ctx = MockBlockHeight(ctx, am, 18) + // Jump to epoch 18 + ctx = MockBlockHeight(ctx, am, 18*utils.EPOCH_SIZE) activeSubs = k.GetAllActiveSubscriptions(ctx, deal) - // there shouldn't be an active subs at block 18 + // there shouldn't be an active subs at epoch 18 require.True(t, len(activeSubs) == 0) } @@ -109,10 +110,10 @@ func TestDealHasProvider(t *testing.T) { require.NotEmpty(t, k) // create a subscription - sub := types.Subscription{Id: "123", DealId: "12345", Provider: "provider1", StartBlock: 10, EndBlock: 15} + sub := types.Subscription{Id: "123", DealId: "12345", Provider: "provider1", StartEpoch: 10, EndEpoch: 15} k.SetSubscription(ctx, sub) // Create a deal - deal := types.Deal{Id: "12345", CroId: "alicecro", Requester: Alice, Status: types.Deal_UNDEFINED, AvailableAmount: 1000, TotalAmount: 100, StartBlock: 10, EndBlock: 20, SubscriptionIds: []string{"123"}} + deal := types.Deal{Id: "12345", CroId: "alicecro", Requester: Alice, Status: types.Deal_UNDEFINED, AvailableAmount: 1000, TotalAmount: 100, NumEpochs: 10, EpochSize: 20, SubscriptionIds: []string{"123"}} k.SetDeal(ctx, deal) hasProvider := k.DealHasProvider(ctx, deal, "provider1") @@ -121,8 +122,8 @@ func TestDealHasProvider(t *testing.T) { hasProvider = k.DealHasProvider(ctx, deal, "provider2") require.False(t, hasProvider) - // Jump to block 18 - ctx = MockBlockHeight(ctx, am, 18) + // Jump to epoch 18 + ctx = MockBlockHeight(ctx, am, 18*utils.EPOCH_SIZE) hasProvider = k.DealHasProvider(ctx, deal, "provider1") require.False(t, hasProvider) } diff --git a/x/subscription/keeper/msg_deal.go b/x/subscription/keeper/msg_deal.go index 468854b..67ee8dc 100644 --- a/x/subscription/keeper/msg_deal.go +++ b/x/subscription/keeper/msg_deal.go @@ -6,6 +6,7 @@ import ( "math" topTypes "topchain/types" + "topchain/utils" "topchain/utils/validation" "topchain/x/subscription/types" @@ -17,7 +18,10 @@ import ( ) func validateMsgCreateDeal(msg *types.MsgCreateDeal) error { - if err := validation.ValidateBlockRange(msg.StartBlock, msg.EndBlock); err != nil { + if err := validation.ValidateEpochSize(msg.EpochSize); err != nil { + return err + } + if err := validation.ValidateNumEpochs(msg.NumEpochs); err != nil { return err } if err := validation.ValidatePositiveAmount(msg.Amount); err != nil { @@ -39,6 +43,8 @@ func (k msgServer) CreateDeal(goCtx context.Context, msg *types.MsgCreateDeal) ( return nil, err } + rewardPerEpoch := msg.Amount / msg.NumEpochs + ctx := sdk.UnwrapSDKContext(goCtx) id := uuid.NewString() deal := types.Deal{ @@ -50,7 +56,9 @@ func (k msgServer) CreateDeal(goCtx context.Context, msg *types.MsgCreateDeal) ( TotalAmount: msg.Amount, AvailableAmount: msg.Amount, StartBlock: msg.StartBlock, - EndBlock: msg.EndBlock, + EpochSize: msg.EpochSize, + NumEpochs: msg.NumEpochs, + RewardPerEpoch: rewardPerEpoch, InitialFrontier: msg.InitialFrontier, } @@ -108,7 +116,7 @@ func (k msgServer) CancelDeal(goCtx context.Context, msg *types.MsgCancelDeal) ( if !found { return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, "SHOULD NOT HAPPEN: subscription with id "+subscriptionId+" not found") } - subscription.EndBlock = uint64(ctx.BlockHeight()) + subscription.EndEpoch = utils.ConvertBlockToEpoch(uint64(ctx.BlockHeight())-deal.StartBlock, deal.EpochSize) k.SetSubscription(ctx, subscription) } // return the remaining amount to the requester @@ -118,41 +126,24 @@ func (k msgServer) CancelDeal(goCtx context.Context, msg *types.MsgCancelDeal) ( return &types.MsgCancelDealResponse{}, nil } -func validateMsgUpdateDeal(msg *types.MsgUpdateDeal) error { - if err := validation.ValidateNonEmptyString(msg.DealId); err != nil { - return err - } - if err := validation.ValidateAddress(msg.Requester); err != nil { - return err - } - if err := validation.ValidateBlockRange(msg.StartBlock, msg.EndBlock); err != nil { - return err - } - if err := validation.ValidatePositiveAmount(msg.Amount); err != nil { - return err - } - return nil -} - func (k msgServer) UpdateDeal(goCtx context.Context, msg *types.MsgUpdateDeal) (*types.MsgUpdateDealResponse, error) { - err := validateMsgUpdateDeal(msg) - if err != nil { - return nil, err - } - requester, err := sdk.AccAddressFromBech32(msg.Requester) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "invalid requester address") - } ctx := sdk.UnwrapSDKContext(goCtx) + deal, found := k.GetDeal(ctx, msg.DealId) if !found { return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, "deal with id "+msg.DealId+" not found") } + requester, err := sdk.AccAddressFromBech32(msg.Requester) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "invalid requester address") + } if msg.Requester != deal.Requester { return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "only the requester can update the deal") } - // Amount, StartBlock, and EndBlock are optional arguments an default to 0 if not provided - if ctx.BlockHeight() < int64(deal.StartBlock) { + // Amount, StartBlock, and NumEpochs are optional arguments an default to 0 if not provided + currentBlock := uint64(ctx.BlockHeight()) + currentEpoch := utils.ConvertBlockToEpoch(currentBlock-deal.StartBlock, deal.EpochSize) + if currentBlock < deal.StartBlock { if msg.Amount != 0 { if msg.Amount < deal.TotalAmount { amountToReturn := deal.TotalAmount - msg.Amount @@ -168,23 +159,22 @@ func (k msgServer) UpdateDeal(goCtx context.Context, msg *types.MsgUpdateDeal) ( deal.AvailableAmount = msg.Amount } if msg.StartBlock != 0 { - if int64(msg.StartBlock) < ctx.BlockHeight() { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "start block must be greater than current block height") + if msg.StartBlock < currentBlock { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "start block must be greater than current block") } deal.StartBlock = msg.StartBlock } - if msg.EndBlock != 0 { - if int64(msg.EndBlock) < ctx.BlockHeight() { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "end block must be greater than current block height") - } - deal.EndBlock = msg.EndBlock + if msg.NumEpochs != 0 { + deal.NumEpochs = msg.NumEpochs } + deal.RewardPerEpoch = deal.TotalAmount / deal.NumEpochs } else { + amountToDeposit := uint64(0) if msg.Amount != 0 { if msg.Amount < deal.TotalAmount { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "amount must be greater than initial amount") } - amountToDeposit := msg.Amount - deal.TotalAmount + amountToDeposit = msg.Amount - deal.TotalAmount requester, err := sdk.AccAddressFromBech32(msg.Requester) if err != nil { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "invalid requester address") @@ -199,12 +189,14 @@ func (k msgServer) UpdateDeal(goCtx context.Context, msg *types.MsgUpdateDeal) ( if msg.StartBlock != 0 { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cannot update start block after deal has started") } - if msg.EndBlock != 0 { - if int64(msg.EndBlock) < ctx.BlockHeight() { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "end block must be greater than current block height") + if msg.NumEpochs != 0 { + if msg.NumEpochs <= currentEpoch { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cannot update num epochs to a value less than or equal to the current epoch") } - deal.EndBlock = msg.EndBlock + deal.NumEpochs = msg.NumEpochs } + // the reward amount topup only applies to epochs >= currentEpoch + deal.RewardPerEpoch = deal.RewardPerEpoch + amountToDeposit/(deal.NumEpochs-currentEpoch+1) } k.SetDeal(ctx, deal) @@ -239,6 +231,7 @@ func (k msgServer) IncrementDealAmount(goCtx context.Context, msg *types.MsgIncr if !found { return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, "deal with id "+msg.DealId+" not found") } + currentEpoch := utils.ConvertBlockToEpoch(uint64(ctx.BlockHeight())-deal.StartBlock, deal.EpochSize) if msg.Requester != deal.Requester { return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "only the requester can increment the deal amount") } @@ -254,6 +247,9 @@ func (k msgServer) IncrementDealAmount(goCtx context.Context, msg *types.MsgIncr deal.TotalAmount += msg.Amount deal.AvailableAmount += msg.Amount + // the reward amount topup only applies to epochs >= currentEpoch + deal.RewardPerEpoch = deal.RewardPerEpoch + msg.Amount/(deal.NumEpochs-currentEpoch+1) + k.SetDeal(ctx, deal) return &types.MsgIncrementDealAmountResponse{}, nil } @@ -303,20 +299,25 @@ func (k msgServer) JoinDeal(goCtx context.Context, msg *types.MsgJoinDeal) (*typ } id := uuid.NewString() - var subscriptionStartBlock uint64 - if deal.StartBlock < uint64(ctx.BlockHeight()) { - subscriptionStartBlock = uint64(ctx.BlockHeight()) + var subscriptionStartEpoch uint64 + currentBlock := uint64(ctx.BlockHeight()) + + currentEpoch := (currentBlock - deal.StartBlock + 1) / deal.EpochSize + + if deal.StartBlock < currentBlock { + subscriptionStartEpoch = currentEpoch deal.Status = types.Deal_ACTIVE } else { - subscriptionStartBlock = deal.StartBlock + // start from the first epoch + subscriptionStartEpoch = 0 } subscription := types.Subscription{ Id: id, DealId: msg.DealId, Provider: msg.Provider, - StartBlock: subscriptionStartBlock, - EndBlock: deal.EndBlock, + StartEpoch: subscriptionStartEpoch, + EndEpoch: (deal.EpochSize*deal.NumEpochs + 1) / deal.EpochSize, } k.SetSubscription(ctx, subscription) deal.SubscriptionIds = append(deal.SubscriptionIds, subscription.Id) @@ -355,7 +356,7 @@ func (k msgServer) LeaveDeal(goCtx context.Context, msg *types.MsgLeaveDeal) (*t } if subscription.Provider == msg.Provider { isSubscribed = true - subscription.EndBlock = uint64(ctx.BlockHeight()) + subscription.EndEpoch = utils.ConvertBlockToEpoch(uint64(ctx.BlockHeight())-deal.StartBlock, deal.EpochSize) k.SetSubscription(ctx, subscription) } } diff --git a/x/subscription/keeper/msg_deal_test.go b/x/subscription/keeper/msg_deal_test.go index 53f3965..bded312 100644 --- a/x/subscription/keeper/msg_deal_test.go +++ b/x/subscription/keeper/msg_deal_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + utils "topchain/utils" "topchain/x/subscription/types" "github.com/stretchr/testify/require" @@ -15,7 +16,7 @@ func TestMsgServerCreateDealMsg(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) require.NotEmpty(t, response) @@ -30,7 +31,7 @@ func TestMsgServerCreateDealScheduled(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20} response, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -40,7 +41,7 @@ func TestMsgServerCreateDealScheduled(t *testing.T) { require.EqualValues(t, response.DealId, deal.Id) - require.EqualValues(t, createDeal, types.MsgCreateDeal{Requester: deal.Requester, CroId: deal.CroId, Amount: deal.TotalAmount, StartBlock: deal.StartBlock, EndBlock: deal.EndBlock}) + require.EqualValues(t, createDeal, types.MsgCreateDeal{Requester: deal.Requester, CroId: deal.CroId, Amount: deal.TotalAmount, NumEpochs: deal.NumEpochs, EpochSize: deal.EpochSize}) require.Equal(t, deal.Status, types.Deal_SCHEDULED) @@ -53,7 +54,7 @@ func TestMsgServerCreateDealInitializedStatus(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20} response, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -62,7 +63,7 @@ func TestMsgServerCreateDealInitializedStatus(t *testing.T) { require.True(t, found) // Jump to block number 11 - ctx = MockBlockHeight(ctx, am, 10) + ctx = MockBlockHeight(ctx, am, 10*utils.EPOCH_SIZE) // The deal must be initialized after entering block 10 deal, _ = k.GetDeal(ctx, response.DealId) @@ -78,7 +79,7 @@ func TestMsgServerCancelDealCorrectRequester(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -107,7 +108,7 @@ func TestMsgServerCancelDealIncorrectRequester(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -124,59 +125,59 @@ func TestMsgServerCancelDealIncorrectRequester(t *testing.T) { } func TestMsgServerUpdateDealIncorrectRequesterMsg(t *testing.T) {} -func TestMsgServerUpdateScheduledDealCorrectStartBlockMsg(t *testing.T) { +func TestMsgServerUpdateScheduledDealCorrectStartEpochMsg(t *testing.T) { k, ms, ctx, _ := setupMsgServer(t) require.NotNil(t, ms) require.NotNil(t, ctx) require.NotEmpty(t, k) - createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) - updateDeal := types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, StartBlock: 11} + updateDeal := types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, NumEpochs: 11} _, err = ms.UpdateDeal(ctx, &updateDeal) require.NoError(t, err) deal, found := k.GetDeal(ctx, createResponse.DealId) require.True(t, found) - require.EqualValues(t, deal.StartBlock, 11) + require.EqualValues(t, deal.NumEpochs, 11) } -func TestMsgServerUpdateScheduledDealIncorrectStartBlockMsg(t *testing.T) { +func TestMsgServerUpdateScheduledDealIncorrectStartEpochMsg(t *testing.T) { k, ms, ctx, am := setupMsgServer(t) require.NotNil(t, ms) require.NotNil(t, ctx) require.NotEmpty(t, k) - createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) - // Jump to block 9 - ctx = MockBlockHeight(ctx, am, 9) + // Jump to epoch 9 + ctx = MockBlockHeight(ctx, am, 9*utils.EPOCH_SIZE) - updateDeal := types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, StartBlock: 7} + updateDeal := types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, NumEpochs: 7} _, err = ms.UpdateDeal(ctx, &updateDeal) require.NotNil(t, err) } -func TestMsgServerUpdateInitiatedDealIncorrectStartBlockMsg(t *testing.T) { +func TestMsgServerUpdateInitiatedDealIncorrectStartEpochMsg(t *testing.T) { k, ms, ctx, am := setupMsgServer(t) require.NotNil(t, ms) require.NotNil(t, ctx) require.NotEmpty(t, k) - createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) - // Jump to block 12 - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) - updateDeal := types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, StartBlock: 7} + updateDeal := types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, NumEpochs: 7} _, err = ms.UpdateDeal(ctx, &updateDeal) - // It should return an error because the StartBlock can't be updated once the deal is initiated. + // It should return an error because the StartEpoch can't be updated once the deal is initiated. require.NotNil(t, err) } @@ -186,7 +187,7 @@ func TestMsgServerUpdateScheduledDealIncrementAmountMsg(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) updateDeal := types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, Amount: 12000} @@ -204,7 +205,7 @@ func TestMsgServerUpdateScheduledDealDecrementAmountMsg(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) _, err = ms.UpdateDeal(ctx, &types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, Amount: 5000}) @@ -220,7 +221,7 @@ func TestMsgServerUpdateScheduledDealDecrementTotalAmountMsg(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) _, err = ms.UpdateDeal(ctx, &types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, Amount: 0}) @@ -238,11 +239,11 @@ func TestMsgServerUpdateInitiatedDealIncrementAmountMsg(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) - // Jump to block 12 to initiate the deal - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 to initiate the deal + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) _, err = ms.UpdateDeal(ctx, &types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, Amount: 15000}) require.NoError(t, err) @@ -258,11 +259,11 @@ func TestMsgServerUpdateInitiatedDealDecrementAmountMsg(t *testing.T) { require.NotNil(t, ctx) require.NotEmpty(t, k) - createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + createResponse, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) - // Jump to block 12 to initiate the deal - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 to initiate the deal + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) _, err = ms.UpdateDeal(ctx, &types.MsgUpdateDeal{Requester: Alice, DealId: createResponse.DealId, Amount: 9000}) // It should return an error because you're not allowed to decrease the amount after deal initiation @@ -277,7 +278,7 @@ func TestMsgServerJoinDealBeforeInitiationMsg(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -318,7 +319,7 @@ func TestMsgServerJoinInitiatedDealMsg(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -331,8 +332,8 @@ func TestMsgServerJoinInitiatedDealMsg(t *testing.T) { // Assert the status of the deal to be "SCHEDULED" require.EqualValues(t, deal.Status, types.Deal_SCHEDULED) - // Jump to block 12 - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) // Provider joins the deal after it is initiated joinDeal := types.MsgJoinDeal{Provider: Bob, DealId: dealId} joinResponse, err := ms.JoinDeal(ctx, &joinDeal) @@ -363,7 +364,7 @@ func TestMsgServerJoinCancelledDealMsg(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -397,7 +398,7 @@ func TestMsgServerJoinSameDealMoreThanOnceMsg(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -424,7 +425,7 @@ func TestMsgServerIncrementDealAmount(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -445,7 +446,7 @@ func TestMsgServerIncrementDealAmountIncorrectRequester(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -466,7 +467,7 @@ func TestMsgServerIncrementCancelledDealAmount(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -492,16 +493,16 @@ func TestMsgServerIncrementExpiredDealAmount(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) dealId := createResponse.DealId - // Jump to block 12 to initialize the deal - ctx = MockBlockHeight(ctx, am, 12) - // Jump to block 25 to expire the deal - ctx = MockBlockHeight(ctx, am, 25) + // Jump to epoch 12 to initialize the deal + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) + // Jump to epoch 25 to expire the deal + ctx = MockBlockHeight(ctx, am, 25*utils.EPOCH_SIZE) // topop the deal amount incrementDeal := types.MsgIncrementDealAmount{Requester: Alice, DealId: dealId, Amount: 1000} @@ -518,7 +519,7 @@ func TestMsgServerLeaveJoinedDealMsg(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -546,7 +547,7 @@ func TestMsgServerLeaveNotJoinedDealMsg(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -568,7 +569,7 @@ func TestMsgServerJoinLeaveJoinDeallMsg(t *testing.T) { require.NotEmpty(t, k) // Create a new deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.NoError(t, err) @@ -584,8 +585,8 @@ func TestMsgServerJoinLeaveJoinDeallMsg(t *testing.T) { _, err = ms.LeaveDeal(ctx, &leaveDeal) require.NoError(t, err) - // Jump one block forward - ctx = MockBlockHeight(ctx, am, 1) + // Jump one epoch forward + ctx = MockBlockHeight(ctx, am, 1*utils.EPOCH_SIZE) // Provider joins the deal again _, err = ms.JoinDeal(ctx, &joinDeal) diff --git a/x/subscription/keeper/msg_progress.go b/x/subscription/keeper/msg_progress.go index 99e82c8..736177a 100644 --- a/x/subscription/keeper/msg_progress.go +++ b/x/subscription/keeper/msg_progress.go @@ -3,6 +3,9 @@ package keeper import ( "context" + topTypes "topchain/types" + "topchain/utils" + "topchain/x/subscription/types" errorsmod "cosmossdk.io/errors" @@ -17,8 +20,7 @@ func (k msgServer) SubmitProgress(goCtx context.Context, msg *types.MsgSubmitPro provider := msg.Provider subscriptionId := msg.SubscriptionId obfuscatedVerticesHash := msg.ObfuscatedVerticesHash - blockHeight := ctx.BlockHeight() - epochNumber := blockHeight / EPOCH_SIZE + currentBlock := uint64(ctx.BlockHeight()) submittedHashes := msg.PreviousVerticesHashes subscription, found := k.GetSubscription(ctx, subscriptionId) @@ -29,27 +31,49 @@ func (k msgServer) SubmitProgress(goCtx context.Context, msg *types.MsgSubmitPro return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "only the provider can submit progress") } + deal, _ := k.GetDeal(ctx, subscription.DealId) + currentEpoch := (currentBlock - deal.StartBlock + 1) / deal.EpochSize + + if subscription.EndEpoch <= currentEpoch { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cannot submit progress to an expired subscription") + } + // this is the first obfuscated progress batch submission if len(submittedHashes) == 0 { - k.SetObfuscatedProgress(ctx, subscriptionId, epochNumber, obfuscatedVerticesHash) + k.SetObfuscatedProgress(ctx, subscriptionId, currentEpoch, obfuscatedVerticesHash) return &types.MsgSubmitProgressResponse{}, nil } // Validate that the obfuscated vertex hashes submitted in the previous epoch match the current vertex hashes obfuscatedProgressData, _ := k.GetObfuscatedProgress(ctx, subscriptionId) - err := validateObfuscatedProgress(obfuscatedProgressData, submittedHashes, provider, epochNumber) + err := validateObfuscatedProgress(obfuscatedProgressData, submittedHashes, provider, currentEpoch) if err != nil { return nil, errorsmod.Wrap(err, "vertices hashes / obfuscated data validation failed") } + progressDeal, found := k.GetProgressDealAtEpoch(ctx, subscription.DealId, currentEpoch) + if !found { + progressDeal = ProgressDeal{} + } + + // the reward allocated for the previous epoch must be deducted from the deal.AvailableAmount + if progressDeal.Reward.Epoch < currentEpoch { + deal.AvailableAmount -= progressDeal.Reward.Reward + } + k.SetDeal(ctx, deal) + progress, found := k.GetProgress(ctx, subscriptionId) if !found { hashesSet := types.SetFrom(submittedHashes...) for hash := range hashesSet { - k.SetHashSubmissionBlock(ctx, provider, hash, blockHeight) + k.SetHashSubmissionEpoch(ctx, provider, hash, currentEpoch) } k.SetProgress(ctx, subscriptionId, hashesSet) - k.SetProgressSize(ctx, subscriptionId, blockHeight, len(hashesSet)) + + progressSize := uint64(len(hashesSet)) + progressDeal = getUpdatedProgressDeal(progressDeal, provider, progressSize, deal.RewardPerEpoch, currentEpoch) + k.SetProgressDealAtEpoch(ctx, subscription.DealId, currentEpoch, progressDeal) + k.AddProgressEpochsProvider(ctx, provider, subscriptionId, currentEpoch) return &types.MsgSubmitProgressResponse{}, nil } @@ -57,23 +81,38 @@ func (k msgServer) SubmitProgress(goCtx context.Context, msg *types.MsgSubmitPro for _, hash := range submittedHashes { if !progress.Has(hash) { progress = progress.Add(hash) - k.SetHashSubmissionBlock(ctx, provider, hash, blockHeight) + k.SetHashSubmissionEpoch(ctx, provider, hash, currentEpoch) } } // Add the new obfuscated progress hash to the obfuscated progress hash set - k.SetObfuscatedProgress(ctx, subscriptionId, epochNumber, obfuscatedVerticesHash) + k.SetObfuscatedProgress(ctx, subscriptionId, currentEpoch, obfuscatedVerticesHash) - progressSize := len(progress) - initialProgressSize + progressSize := uint64(len(progress) - initialProgressSize) k.SetProgress(ctx, subscriptionId, progress) - k.SetProgressSize(ctx, subscriptionId, blockHeight, progressSize) + + progressDeal = getUpdatedProgressDeal(progressDeal, provider, progressSize, deal.RewardPerEpoch, currentEpoch) + k.SetProgressDealAtEpoch(ctx, subscription.DealId, currentEpoch, progressDeal) + k.AddProgressEpochsProvider(ctx, provider, subscriptionId, currentEpoch) return &types.MsgSubmitProgressResponse{}, nil } -func validateObfuscatedProgress(obfuscatedProgressData ObfuscatedProgressData, submittedHashes []string, provider string, epochNumber int64) error { - if epochNumber != obfuscatedProgressData.EpochNumber { +func getUpdatedProgressDeal(progressDeal ProgressDeal, provider string, size, reward, epoch uint64) ProgressDeal { + newProgress := ProgressTuple{ + Provider: provider, + Size: size, + } + progressDeal.Progress = append(progressDeal.Progress, newProgress) + progressDeal.Total += size + progressDeal.Reward = ProgressRewardCache{Reward: reward, Epoch: epoch} + + return progressDeal +} + +func validateObfuscatedProgress(obfuscatedProgressData ObfuscatedProgressData, submittedHashes []string, provider string, epochNumber uint64) error { + if epochNumber != obfuscatedProgressData.EpochNumber+1 { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Revealing vertices hashes exceeded epoch duration") } hasher := sha3.New256() @@ -88,3 +127,95 @@ func validateObfuscatedProgress(obfuscatedProgressData ObfuscatedProgressData, s } return nil } + +func (k msgServer) ClaimRewards(goCtx context.Context, msg *types.MsgClaimRewards) (*types.MsgClaimRewardsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + provider := msg.Provider + subscriptionId := msg.SubscriptionId + currentBlock := uint64(ctx.BlockHeight()) + challengeWindow := uint64(topTypes.ChallengePeriod) + reward := int64(0) + + subscription, found := k.GetSubscription(ctx, subscriptionId) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, "subscription with id "+subscriptionId+" not found") + } + + deal, found := k.GetDeal(ctx, subscription.DealId) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, "this should never happen") + } + + if subscription.Provider != provider { + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "only the provider can claim reward") + } + + lastClaimedEpoch, found := k.GetProviderLastRewardClaimedEpoch(ctx, provider, subscriptionId) + // if the provider is claiming for the first time, `found` is false. In this case, start checking for + // rewards from the subscription startEpoch. + if !found { + lastClaimedEpoch = subscription.StartEpoch + } + // since challegeWindow is a global variable in terms of blocks, convert everything to blocks. + if currentBlock < (deal.StartBlock+lastClaimedEpoch*deal.EpochSize)+challengeWindow { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "wait until challenge period elapses before claiming") + } + providerProgressEpochs, found := k.GetProgressEpochsProvider(ctx, provider, subscriptionId) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cannot claim reward without submitting progress") + } + // loop until the most recent block that has elapsed the challenge window. + lastEligibleEpoch := min(utils.ConvertBlockToEpoch(currentBlock-challengeWindow-deal.StartBlock, deal.EpochSize), subscription.EndEpoch) + for epoch := lastClaimedEpoch + 1; epoch <= lastEligibleEpoch; epoch++ { + // only compute rewards for blocks that the provider submitted progress + if providerProgressEpochs.Has(epoch) { + // get the progress made by all the deal subscribers at `block` + progressDeal, found := k.GetProgressDealAtEpoch(ctx, subscription.DealId, epoch) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "this should not happen!") + } + epochReward := progressDeal.Reward.Reward + for _, progress := range progressDeal.Progress { + if progress.Provider == provider { + reward += int64(float64(epochReward) * float64(progress.Size) / float64(progressDeal.Total)) + break + } + } + providerProgressEpochs.Remove(epoch) + } + } + k.SetProviderLastRewardClaimedEpoch(ctx, provider, subscriptionId, lastEligibleEpoch) + k.SetProgressEpochsProvider(ctx, providerProgressEpochs, provider, subscriptionId) + // send payout + k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.AccAddress(provider), sdk.NewCoins(sdk.NewInt64Coin(topTypes.TokenDenom, int64(reward)))) + + return &types.MsgClaimRewardsResponse{}, nil +} + +func (k msgServer) WithdrawResidue(goCtx context.Context, msg *types.MsgWithdrawResidue) (*types.MsgWithdrawResidueResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + currentBlock := uint64(ctx.BlockHeight()) + + deal, found := k.GetDeal(ctx, msg.DealId) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, "deal with id "+msg.DealId+" not found") + } + if msg.Requester != deal.Requester { + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "only the requester can cancel the deal") + } + if currentBlock < deal.NumEpochs*deal.EpochSize+uint64(topTypes.ChallengePeriod) { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidHeight, "requester can withdraw the reward residue only after the deal's last epoch's challenge period is elasped") + } + residueAmount := deal.AvailableAmount + if residueAmount == 0 { + return nil, errorsmod.Wrap(sdkerrors.ErrInsufficientFunds, "there is no residue reward to withdraw") + } + + k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.AccAddress(msg.Requester), sdk.NewCoins(sdk.NewInt64Coin(topTypes.TokenDenom, int64(residueAmount)))) + + deal.AvailableAmount = 0 + k.SetDeal(ctx, deal) + + return &types.MsgWithdrawResidueResponse{}, nil +} diff --git a/x/subscription/keeper/msg_progress_test.go b/x/subscription/keeper/msg_progress_test.go index 522618a..57dd0a6 100644 --- a/x/subscription/keeper/msg_progress_test.go +++ b/x/subscription/keeper/msg_progress_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "topchain/utils" "topchain/x/subscription/types" "github.com/stretchr/testify/require" @@ -24,13 +25,13 @@ func TestSubmitProgress(t *testing.T) { require.NotNil(t, ms) require.NotNil(t, ctx) - response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 200}) require.NoError(t, err) dealId := response.DealId - // Jump to block 12 to initiate the deal - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 to initiate the deal + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) // Provider joins the deal after it is initiated joinDeal := types.MsgJoinDeal{Provider: Bob, DealId: dealId} joinResponse, err := ms.JoinDeal(ctx, &joinDeal) @@ -47,8 +48,8 @@ func TestSubmitProgress(t *testing.T) { _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId, SubscriptionId: subscriptionId, ObfuscatedVerticesHash: obfuscatedHash1}) // There should not be any error require.NoError(t, err) - // Jump to block 13 - ctx = MockBlockHeight(ctx, am, 13) + // Jump to epoch 13 + ctx = MockBlockHeight(ctx, am, 13*utils.EPOCH_SIZE) // create mock vertices hashes and the corresponding obfuscated hash verticesHashes2 := []string{"666", "777", "888", "999", "1010"} @@ -66,13 +67,13 @@ func TestSubmitProgressWithIncorrectObfuscatedHash(t *testing.T) { require.NotNil(t, ms) require.NotNil(t, ctx) - response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 20}) + response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) require.NoError(t, err) dealId := response.DealId - // Jump to block 12 to initiate the deal - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 to initiate the deal + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) // Provider joins the deal after it is initiated joinDeal := types.MsgJoinDeal{Provider: Bob, DealId: dealId} joinResponse, err := ms.JoinDeal(ctx, &joinDeal) @@ -90,8 +91,8 @@ func TestSubmitProgressWithIncorrectObfuscatedHash(t *testing.T) { _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId, SubscriptionId: subscriptionId, ObfuscatedVerticesHash: obfuscatedHash1}) // There should not be any error require.NoError(t, err) - // Jump to block 13 - ctx = MockBlockHeight(ctx, am, 13) + // Jump to epoch 13 + ctx = MockBlockHeight(ctx, am, 13*utils.EPOCH_SIZE) // create mock vertices hashes and the corresponding obfuscated hash verticesHashes2 := []string{"666", "777", "888", "999", "1010"} @@ -109,13 +110,13 @@ func TestSubmitProgressAfterEpochDeadline(t *testing.T) { require.NotNil(t, ms) require.NotNil(t, ctx) - response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, StartBlock: 10, EndBlock: 25}) + response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 25}) require.NoError(t, err) dealId := response.DealId - // Jump to block 12 to initiate the deal - ctx = MockBlockHeight(ctx, am, 12) + // Jump to epoch 12 to initiate the deal + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) // Provider joins the deal after it is initiated joinDeal := types.MsgJoinDeal{Provider: Bob, DealId: dealId} joinResponse, err := ms.JoinDeal(ctx, &joinDeal) @@ -133,8 +134,8 @@ func TestSubmitProgressAfterEpochDeadline(t *testing.T) { _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId, SubscriptionId: subscriptionId, ObfuscatedVerticesHash: obfuscatedHash1}) // There should not be any error require.NoError(t, err) - // Jump to block 23 - ctx = MockBlockHeight(ctx, am, 23) + // Jump to epoch 23 + ctx = MockBlockHeight(ctx, am, 23*utils.EPOCH_SIZE) // create mock vertices hashes and the corresponding obfuscated hash verticesHashes2 := []string{"666", "777", "888", "999", "1010"} @@ -145,3 +146,147 @@ func TestSubmitProgressAfterEpochDeadline(t *testing.T) { // There should be an error beacuse you submit after the epoch deadline require.Error(t, err) } + +func TestClaimRewardsSingleProvider(t *testing.T) { + k, ms, ctx, am := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) + + response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) + require.NoError(t, err) + + dealId := response.DealId + + // Jump to epoch 12 to initiate the deal + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) + // Provider joins the deal after it is initiated + joinDeal := types.MsgJoinDeal{Provider: Bob, DealId: dealId} + joinResponse, err := ms.JoinDeal(ctx, &joinDeal) + require.NoError(t, err) + + subscriptionId := joinResponse.SubscriptionId + providerId := Bob + + // create mock vertices hashes and the corresponding obfuscated hash + verticesHashes1 := []string{"000", "111", "222", "333", "444", "555"} + obfuscatedHash1 := ObfuscatedDataHashHelper(verticesHashes1, providerId) + + // submit progress + _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId, SubscriptionId: subscriptionId, ObfuscatedVerticesHash: obfuscatedHash1}) + // There should not be any error + require.NoError(t, err) + // Jump to epoch 13 + ctx = MockBlockHeight(ctx, am, 13*utils.EPOCH_SIZE) + + // create mock vertices hashes and the corresponding obfuscated hash + verticesHashes2 := []string{"666", "777", "888", "999", "1010"} + obfuscatedHash2 := ObfuscatedDataHashHelper(verticesHashes2, providerId) + + _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId, SubscriptionId: subscriptionId, PreviousVerticesHashes: verticesHashes1, ObfuscatedVerticesHash: obfuscatedHash2}) + + // There should not be any error + require.NoError(t, err) + + // Jump 100 (ChallengePeriod) blocks forward to elapse the challenge window. + ctx = MockBlockHeight(ctx, am, (13+100/utils.EPOCH_SIZE)*utils.EPOCH_SIZE) + + // deal amount available before claiming rewards + deal, _ := k.GetDeal(ctx, dealId) + dealAmountBefore := deal.AvailableAmount + + _, err = ms.ClaimRewards(ctx, &types.MsgClaimRewards{Provider: providerId, SubscriptionId: subscriptionId}) + require.NoError(t, err) + + deal, _ = k.GetDeal(ctx, dealId) + dealAmountAfter := deal.AvailableAmount + + require.Greater(t, dealAmountBefore, dealAmountAfter) +} + +func TestClaimRewardsDoubleProviders(t *testing.T) { + k, ms, ctx, am := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) + + response, err := ms.CreateDeal(ctx, &types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 10000, NumEpochs: 10, EpochSize: 20}) + require.NoError(t, err) + + dealId := response.DealId + providerId1 := Bob + providerId2 := Carol + + // Jump to epoch 12 to initiate the deal + ctx = MockBlockHeight(ctx, am, 12*utils.EPOCH_SIZE) + // Provider Bob joins the deal after it is initiated + joinDeal := types.MsgJoinDeal{Provider: providerId1, DealId: dealId} + joinResponse, err := ms.JoinDeal(ctx, &joinDeal) + require.NoError(t, err) + + subscriptionId1 := joinResponse.SubscriptionId + + // Provider Carol joins the deal after it is initiated + joinDeal = types.MsgJoinDeal{Provider: providerId2, DealId: dealId} + joinResponse, err = ms.JoinDeal(ctx, &joinDeal) + require.NoError(t, err) + + subscriptionId2 := joinResponse.SubscriptionId + + // create mock vertices hashes and the corresponding obfuscated hash + verticesHashes1 := []string{"000", "111", "222", "333", "444", "555"} + obfuscatedHash1 := ObfuscatedDataHashHelper(verticesHashes1, providerId1) + obfuscatedHash2 := ObfuscatedDataHashHelper(verticesHashes1, providerId2) + + // submit progress provider1 + _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId1, SubscriptionId: subscriptionId1, ObfuscatedVerticesHash: obfuscatedHash1}) + // There should not be any error + require.NoError(t, err) + + // submit progress provider2 + _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId2, SubscriptionId: subscriptionId2, ObfuscatedVerticesHash: obfuscatedHash2}) + // There should not be any error + require.NoError(t, err) + + // Jump to epoch 13 + ctx = MockBlockHeight(ctx, am, 13*utils.EPOCH_SIZE) + + // create mock vertices hashes and the corresponding obfuscated hash + verticesHashes2 := []string{"666", "777", "888", "999", "1010"} + obfuscatedHash12 := ObfuscatedDataHashHelper(verticesHashes2, providerId1) + obfuscatedHash22 := ObfuscatedDataHashHelper(verticesHashes2, providerId2) + + _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId1, SubscriptionId: subscriptionId1, PreviousVerticesHashes: verticesHashes1, ObfuscatedVerticesHash: obfuscatedHash12}) + // There should not be any error + require.NoError(t, err) + + _, err = ms.SubmitProgress(ctx, &types.MsgSubmitProgress{Provider: providerId2, SubscriptionId: subscriptionId2, PreviousVerticesHashes: verticesHashes1, ObfuscatedVerticesHash: obfuscatedHash22}) + // There should not be any error + require.NoError(t, err) + + // Jump 100 (ChallengePeriod) blocks forward to elapse the challenge window. + ctx = MockBlockHeight(ctx, am, (13+100/utils.EPOCH_SIZE)*utils.EPOCH_SIZE) + + // deal amount available before claiming rewards + deal, _ := k.GetDeal(ctx, dealId) + dealAmountBeforeClaims := deal.AvailableAmount + + // Provider1 claims rewards + _, err = ms.ClaimRewards(ctx, &types.MsgClaimRewards{Provider: providerId1, SubscriptionId: subscriptionId1}) + require.NoError(t, err) + + deal, _ = k.GetDeal(ctx, dealId) + dealAmountAfter1Claims := deal.AvailableAmount + + require.Greater(t, dealAmountBeforeClaims, dealAmountAfter1Claims) + + // Provider1 claims rewards + _, err = ms.ClaimRewards(ctx, &types.MsgClaimRewards{Provider: providerId2, SubscriptionId: subscriptionId2}) + require.NoError(t, err) + + deal, _ = k.GetDeal(ctx, dealId) + dealAmountAfter2Claims := deal.AvailableAmount + + require.Greater(t, dealAmountAfter1Claims, dealAmountAfter2Claims) + + // the reward claimed by both providers must be equal since they submit the same vertices hashes + require.Equal(t, dealAmountBeforeClaims-dealAmountAfter1Claims, dealAmountAfter1Claims-dealAmountAfter2Claims) +} diff --git a/x/subscription/keeper/progress.go b/x/subscription/keeper/progress.go index af28073..d76eb4d 100644 --- a/x/subscription/keeper/progress.go +++ b/x/subscription/keeper/progress.go @@ -12,10 +12,26 @@ import ( // ObfuscatedProgressData represents the struct we want to store type ObfuscatedProgressData struct { - EpochNumber int64 + EpochNumber uint64 Hash string } +type ProgressTuple struct { + Provider string + Size uint64 +} + +type ProgressDeal struct { + Total uint64 + Reward ProgressRewardCache + Progress []ProgressTuple +} + +type ProgressRewardCache struct { + Epoch uint64 + Reward uint64 +} + const EPOCH_SIZE = 10 func (k Keeper) SetProgress(ctx sdk.Context, subscription string, hashes types.Set[string]) { @@ -41,7 +57,7 @@ func (k Keeper) GetProgress(ctx sdk.Context, subscription string) (hashes types. return hashes, true } -func (k Keeper) SetObfuscatedProgress(ctx sdk.Context, subscription string, epochNumber int64, hash string) { +func (k Keeper) SetObfuscatedProgress(ctx sdk.Context, subscription string, epochNumber uint64, hash string) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProgressObfuscatedKeyPrefix)) @@ -68,18 +84,18 @@ func (k Keeper) GetObfuscatedProgress(ctx sdk.Context, subscription string) (dat return data, true } -func (k Keeper) SetProgressSize(ctx sdk.Context, subscription string, block int64, size int) { +func (k Keeper) SetProgressSize(ctx sdk.Context, subscription string, epoch uint64, size uint64) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.GetProgressSizeStoreKey(subscription)) - store.Set(sdk.Uint64ToBigEndian(uint64(block)), sdk.Uint64ToBigEndian(uint64(size))) + store.Set(sdk.Uint64ToBigEndian(epoch), sdk.Uint64ToBigEndian(size)) } -func (k Keeper) GetProgressSize(ctx sdk.Context, subscription string, block int64) (size int, found bool) { +func (k Keeper) GetProgressSize(ctx sdk.Context, subscription string, epoch uint64) (size int, found bool) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.GetProgressSizeStoreKey(subscription)) - sizeBytes := store.Get(sdk.Uint64ToBigEndian(uint64(block))) + sizeBytes := store.Get(sdk.Uint64ToBigEndian(epoch)) if sizeBytes == nil { return size, false } @@ -87,21 +103,107 @@ func (k Keeper) GetProgressSize(ctx sdk.Context, subscription string, block int6 return int(sdk.BigEndianToUint64(sizeBytes)), true } -func (k Keeper) SetHashSubmissionBlock(ctx sdk.Context, provider string, hash string, block int64) { +func (k Keeper) SetProgressDealAtEpoch(ctx sdk.Context, deal string, epoch uint64, progressDeal ProgressDeal) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.GetProgressDealStoreKey(deal)) + + buf := &bytes.Buffer{} + gob.NewEncoder(buf).Encode(progressDeal) + store.Set(sdk.Uint64ToBigEndian(epoch), buf.Bytes()) +} + +func (k Keeper) GetProgressDealAtEpoch(ctx sdk.Context, deal string, epoch uint64) (ProgressDeal, bool) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.GetProgressDealStoreKey(deal)) + // Retrieve the progress deal data for the specified block + progressBytes := store.Get(sdk.Uint64ToBigEndian(epoch)) + if progressBytes == nil { + return ProgressDeal{}, false + } + // Decode the retrieved bytes into a ProgressDeal struct + var progressDeal ProgressDeal + buf := bytes.NewBuffer(progressBytes) + gob.NewDecoder(buf).Decode(&progressDeal) + + return progressDeal, true +} + +func (k Keeper) AddProgressEpochsProvider(ctx sdk.Context, provider string, subscription string, epoch uint64) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.GetProgressBlocksProviderKey(provider)) + + var epochs types.Set[uint64] + if epochsBytes := store.Get([]byte(subscription)); epochsBytes == nil { + epochs = types.Set[uint64]{} + } else { + buf := bytes.NewBuffer(epochsBytes) + gob.NewDecoder(buf).Decode(&epochs) + } + + epochs.Add(epoch) + + buf := &bytes.Buffer{} + gob.NewEncoder(buf).Encode(epochs) + store.Set([]byte(subscription), buf.Bytes()) +} + +func (k Keeper) SetProgressEpochsProvider(ctx sdk.Context, epochs types.Set[uint64], provider string, subscription string) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.GetProgressBlocksProviderKey(provider)) + + buf := &bytes.Buffer{} + gob.NewEncoder(buf).Encode(epochs) + store.Set([]byte(subscription), buf.Bytes()) +} + +func (k Keeper) GetProgressEpochsProvider(ctx sdk.Context, provider string, subscription string) (epochs types.Set[uint64], found bool) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.GetProgressBlocksProviderKey(provider)) + + epochsBytes := store.Get([]byte(subscription)) + if epochsBytes == nil { + return epochs, false + } + + buf := bytes.NewBuffer(epochsBytes) + gob.NewDecoder(buf).Decode(&epochs) + return epochs, true +} + +func (k Keeper) SetProviderLastRewardClaimedEpoch(ctx sdk.Context, provider string, subscription string, epoch uint64) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.GetSubscriptionProviderLastClaimedKey(provider)) + + store.Set([]byte(subscription), sdk.Uint64ToBigEndian(epoch)) +} + +func (k Keeper) GetProviderLastRewardClaimedEpoch(ctx sdk.Context, provider, subscription string) (epoch uint64, found bool) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.GetSubscriptionProviderLastClaimedKey(provider)) + + epochBytes := store.Get([]byte(subscription)) + if epochBytes == nil { + return epoch, false + } + + return sdk.BigEndianToUint64(epochBytes), true +} + +func (k Keeper) SetHashSubmissionEpoch(ctx sdk.Context, provider string, hash string, epoch uint64) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.GetHashSubmissionBlockStoreKey(provider)) - store.Set([]byte(hash), sdk.Uint64ToBigEndian(uint64(block))) + store.Set([]byte(hash), sdk.Uint64ToBigEndian(epoch)) } -func (k Keeper) GetHashSubmissionBlock(ctx sdk.Context, provider string, hash string) (block int64, found bool) { +func (k Keeper) GetHashSubmissionEpoch(ctx sdk.Context, provider string, hash string) (epoch uint64, found bool) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.GetHashSubmissionBlockStoreKey(provider)) - blockBytes := store.Get([]byte(hash)) - if blockBytes == nil { - return block, false + epochBytes := store.Get([]byte(hash)) + if epochBytes == nil { + return epoch, false } - return int64(sdk.BigEndianToUint64(blockBytes)), true + return sdk.BigEndianToUint64(epochBytes), true } diff --git a/x/subscription/keeper/query_deal_test.go b/x/subscription/keeper/query_deal_test.go index 8879a14..95ebb29 100644 --- a/x/subscription/keeper/query_deal_test.go +++ b/x/subscription/keeper/query_deal_test.go @@ -16,7 +16,7 @@ func TestQueryDeal(t *testing.T) { require.NotEmpty(t, k) // Create a deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.Nil(t, err) @@ -24,7 +24,7 @@ func TestQueryDeal(t *testing.T) { queryResponse, err := k.Deal(ctx, &types.QueryDealRequest{Id: createResponse.DealId}) require.Nil(t, err) - require.EqualValues(t, createDeal, types.MsgCreateDeal{Requester: queryResponse.Deal.Requester, CroId: queryResponse.Deal.CroId, Amount: queryResponse.Deal.TotalAmount, StartBlock: queryResponse.Deal.StartBlock, EndBlock: queryResponse.Deal.EndBlock}) + require.EqualValues(t, createDeal, types.MsgCreateDeal{Requester: queryResponse.Deal.Requester, CroId: queryResponse.Deal.CroId, Amount: queryResponse.Deal.TotalAmount, NumEpochs: queryResponse.Deal.NumEpochs, EpochSize: queryResponse.Deal.EpochSize}) } func TestQueryDealStatus(t *testing.T) { @@ -34,7 +34,7 @@ func TestQueryDealStatus(t *testing.T) { require.NotEmpty(t, k) // Create a deal - createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse, err := ms.CreateDeal(ctx, &createDeal) require.Nil(t, err) @@ -53,7 +53,7 @@ func TestQueryDeals(t *testing.T) { require.NotEmpty(t, k) // Create a first deal - createDeal1 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro1", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal1 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro1", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse1, err := ms.CreateDeal(ctx, &createDeal1) require.Nil(t, err) @@ -61,7 +61,7 @@ func TestQueryDeals(t *testing.T) { require.True(t, found) // Create a second deal - createDeal2 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro2", Amount: 1000, StartBlock: 20, EndBlock: 30} + createDeal2 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro2", Amount: 1000, NumEpochs: 20, EpochSize: 30} createResponse2, err := ms.CreateDeal(ctx, &createDeal2) require.Nil(t, err) @@ -69,7 +69,7 @@ func TestQueryDeals(t *testing.T) { require.True(t, found) // Create a third deal - createDeal3 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal3 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse3, err := ms.CreateDeal(ctx, &createDeal3) require.Nil(t, err) @@ -92,7 +92,7 @@ func TestQueryDealsWithPagination(t *testing.T) { require.NotEmpty(t, k) // Create a first deal - createDeal1 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro1", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal1 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro1", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse1, err := ms.CreateDeal(ctx, &createDeal1) require.Nil(t, err) @@ -100,7 +100,7 @@ func TestQueryDealsWithPagination(t *testing.T) { require.True(t, found) // Create a second deal - createDeal2 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro2", Amount: 1000, StartBlock: 20, EndBlock: 30} + createDeal2 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro2", Amount: 1000, NumEpochs: 20, EpochSize: 30} createResponse2, err := ms.CreateDeal(ctx, &createDeal2) require.Nil(t, err) @@ -108,7 +108,7 @@ func TestQueryDealsWithPagination(t *testing.T) { require.True(t, found) // Create a third deal - createDeal3 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, StartBlock: 10, EndBlock: 20} + createDeal3 := types.MsgCreateDeal{Requester: Alice, CroId: "alicecro", Amount: 1000, NumEpochs: 10, EpochSize: 20} createResponse3, err := ms.CreateDeal(ctx, &createDeal3) require.Nil(t, err) diff --git a/x/subscription/module/module.go b/x/subscription/module/module.go index 06deb5c..39ad19a 100644 --- a/x/subscription/module/module.go +++ b/x/subscription/module/module.go @@ -22,7 +22,6 @@ import ( // this line is used by starport scaffolding # 1 modulev1 "topchain/api/topchain/subscription/module" - topTypes "topchain/types" "topchain/x/subscription/keeper" "topchain/x/subscription/types" ) @@ -161,41 +160,35 @@ func (am AppModule) EndBlock(goCtx context.Context) error { am.keeper.IterateDeals(ctx, func(deal types.Deal) bool { // deal status updates // return false to callback to continue iteration + currentBlock := uint64(ctx.BlockHeight()) + endBlock := deal.StartBlock + deal.NumEpochs*deal.EpochSize switch deal.Status { case types.Deal_EXPIRED: return false case types.Deal_CANCELLED: return false case types.Deal_SCHEDULED: - if uint64(ctx.BlockHeight()) < deal.StartBlock { + if currentBlock < deal.StartBlock { return false } if am.keeper.IsDealActive(ctx, deal) { deal.Status = types.Deal_ACTIVE - deal = am.PayActiveProvidersPerBlock(ctx, deal) } else { deal.Status = types.Deal_INITIALIZED } case types.Deal_INITIALIZED: - if uint64(ctx.BlockHeight()) > deal.EndBlock { + if currentBlock > endBlock { deal.Status = types.Deal_EXPIRED - // return the remaining amount to the requester - am.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.AccAddress(deal.Requester), sdk.NewCoins(sdk.NewInt64Coin(topTypes.TokenDenom, int64(deal.AvailableAmount)))) } case types.Deal_ACTIVE: - if uint64(ctx.BlockHeight()) > deal.EndBlock { + if currentBlock > endBlock { deal.Status = types.Deal_EXPIRED - // return the remaining amount to the requester - am.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.AccAddress(deal.Requester), sdk.NewCoins(sdk.NewInt64Coin(topTypes.TokenDenom, int64(deal.AvailableAmount)))) } else { - deal = am.PayActiveProvidersPerBlock(ctx, deal) } case types.Deal_INACTIVE: - if uint64(ctx.BlockHeight()) > deal.EndBlock { + if currentBlock > endBlock { deal.Status = types.Deal_EXPIRED - // return the remaining amount to the requester - am.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.AccAddress(deal.Requester), sdk.NewCoins(sdk.NewInt64Coin(topTypes.TokenDenom, int64(deal.AvailableAmount)))) } default: return false @@ -207,34 +200,6 @@ func (am AppModule) EndBlock(goCtx context.Context) error { return nil } -func (am AppModule) PayActiveProvidersPerBlock(ctx sdk.Context, deal types.Deal) types.Deal { - activeSubscriptions := am.keeper.GetAllActiveSubscriptions(ctx, deal) - blockReward := am.keeper.CalculateBlockReward(ctx, deal) - currentBlock := ctx.BlockHeight() - // iterate through the progress to get the total while recording the progress of each provider - providerProgress := make(map[string]int) - totalProgress := 0 - for subscription, provider := range activeSubscriptions { - progress, found := am.keeper.GetProgressSize(ctx, subscription, currentBlock) - if !found { - providerProgress[provider] = 0 - } - providerProgress[provider] = progress - totalProgress += progress - } - - totalRewardSent := int64(0) - for subscription, provider := range activeSubscriptions { - // reward based on the progress size - reward := int64(float64(blockReward) * float64(providerProgress[activeSubscriptions[subscription]]) / float64(totalProgress)) - am.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.AccAddress(provider), sdk.NewCoins(sdk.NewInt64Coin(topTypes.TokenDenom, reward))) - totalRewardSent += reward - } - - deal.AvailableAmount -= uint64(totalRewardSent) - return deal -} - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} diff --git a/x/subscription/types/deal.pb.go b/x/subscription/types/deal.pb.go index ac2e468..827af63 100644 --- a/x/subscription/types/deal.pb.go +++ b/x/subscription/types/deal.pb.go @@ -71,8 +71,10 @@ type Deal struct { TotalAmount uint64 `protobuf:"varint,6,opt,name=total_amount,json=totalAmount,proto3" json:"total_amount,omitempty"` AvailableAmount uint64 `protobuf:"varint,7,opt,name=available_amount,json=availableAmount,proto3" json:"available_amount,omitempty"` StartBlock uint64 `protobuf:"varint,8,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - EndBlock uint64 `protobuf:"varint,9,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` - InitialFrontier []string `protobuf:"bytes,10,rep,name=initial_frontier,json=initialFrontier,proto3" json:"initial_frontier,omitempty"` + EpochSize uint64 `protobuf:"varint,9,opt,name=epoch_size,json=epochSize,proto3" json:"epoch_size,omitempty"` + NumEpochs uint64 `protobuf:"varint,10,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` + RewardPerEpoch uint64 `protobuf:"varint,11,opt,name=reward_per_epoch,json=rewardPerEpoch,proto3" json:"reward_per_epoch,omitempty"` + InitialFrontier []string `protobuf:"bytes,12,rep,name=initial_frontier,json=initialFrontier,proto3" json:"initial_frontier,omitempty"` } func (m *Deal) Reset() { *m = Deal{} } @@ -164,9 +166,23 @@ func (m *Deal) GetStartBlock() uint64 { return 0 } -func (m *Deal) GetEndBlock() uint64 { +func (m *Deal) GetEpochSize() uint64 { if m != nil { - return m.EndBlock + return m.EpochSize + } + return 0 +} + +func (m *Deal) GetNumEpochs() uint64 { + if m != nil { + return m.NumEpochs + } + return 0 +} + +func (m *Deal) GetRewardPerEpoch() uint64 { + if m != nil { + return m.RewardPerEpoch } return 0 } @@ -186,34 +202,36 @@ func init() { func init() { proto.RegisterFile("topchain/subscription/deal.proto", fileDescriptor_9de14b4f09b5e255) } var fileDescriptor_9de14b4f09b5e255 = []byte{ - // 419 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x4f, 0x6b, 0xdb, 0x30, - 0x18, 0xc6, 0xe3, 0xfc, 0x71, 0xe3, 0x37, 0x5d, 0x63, 0x04, 0x05, 0xc1, 0x36, 0xcf, 0xcb, 0x29, - 0xbd, 0xb8, 0xb0, 0x1d, 0x06, 0xbb, 0xa5, 0xb1, 0xca, 0x04, 0xc1, 0x0c, 0xb7, 0x1d, 0xa3, 0x17, - 0xa3, 0x58, 0x1a, 0x13, 0x73, 0xad, 0x4c, 0x52, 0xc6, 0xf6, 0x2d, 0xf6, 0xb1, 0x76, 0xec, 0xb1, - 0xc7, 0x91, 0x7c, 0x91, 0x61, 0xc5, 0xcd, 0x32, 0xd8, 0x51, 0xbf, 0xe7, 0xf7, 0x8a, 0xf7, 0x85, - 0x07, 0x62, 0xab, 0x56, 0xe5, 0x67, 0x26, 0xeb, 0x73, 0xb3, 0x5e, 0x9a, 0x52, 0xcb, 0x95, 0x95, - 0xaa, 0x3e, 0xe7, 0x82, 0x55, 0xc9, 0x4a, 0x2b, 0xab, 0xd0, 0xe9, 0xa3, 0x91, 0x1c, 0x1a, 0x93, - 0x87, 0x1e, 0xf4, 0x53, 0xc1, 0x2a, 0x74, 0x02, 0x5d, 0xc9, 0xb1, 0x17, 0x7b, 0xd3, 0x20, 0xef, - 0x4a, 0x8e, 0x9e, 0x41, 0xa0, 0xc5, 0xd7, 0xb5, 0x30, 0x56, 0x68, 0xdc, 0x75, 0xf8, 0x2f, 0x40, - 0xa7, 0xe0, 0x97, 0x5a, 0x15, 0x92, 0xe3, 0x9e, 0x8b, 0x06, 0xa5, 0x56, 0x94, 0xa3, 0x33, 0x08, - 0x0f, 0x7f, 0x2f, 0x24, 0x37, 0xb8, 0x1f, 0xf7, 0xa6, 0x41, 0x3e, 0x3e, 0xe4, 0x94, 0x1b, 0xf4, - 0x16, 0x7c, 0x63, 0x99, 0x5d, 0x1b, 0x3c, 0x88, 0xbd, 0xe9, 0xc9, 0xab, 0x49, 0xf2, 0xdf, 0x05, - 0x93, 0x66, 0xb9, 0xe4, 0xca, 0x99, 0x79, 0x3b, 0x81, 0x5e, 0xc2, 0xb1, 0x55, 0x96, 0x55, 0x05, - 0xbb, 0x53, 0xeb, 0xda, 0x62, 0x3f, 0xf6, 0xa6, 0xfd, 0x7c, 0xe4, 0xd8, 0xcc, 0xa1, 0x66, 0x13, - 0xf6, 0x8d, 0xc9, 0x8a, 0x2d, 0x2b, 0xf1, 0xa8, 0x1d, 0x39, 0x6d, 0xbc, 0xe7, 0xad, 0xfa, 0x02, - 0x46, 0xc6, 0x32, 0x6d, 0x8b, 0x65, 0xa5, 0xca, 0x2f, 0x78, 0xe8, 0x2c, 0x70, 0xe8, 0xa2, 0x21, - 0xe8, 0x29, 0x04, 0xa2, 0xe6, 0x6d, 0x1c, 0xb8, 0x78, 0x28, 0x6a, 0xbe, 0x0b, 0xcf, 0x20, 0x94, - 0xb5, 0xb4, 0x92, 0x55, 0xc5, 0x27, 0xad, 0x6a, 0x2b, 0x85, 0xc6, 0xb0, 0x3b, 0xb9, 0xe5, 0x97, - 0x2d, 0x9e, 0xdc, 0x81, 0xbf, 0x3b, 0x04, 0x3d, 0x81, 0xe0, 0x26, 0x4b, 0xc9, 0x25, 0xcd, 0x48, - 0x1a, 0x76, 0x9a, 0xe7, 0xd5, 0xfc, 0x1d, 0x49, 0x6f, 0x16, 0x24, 0x0d, 0x3d, 0x34, 0x86, 0x11, - 0xcd, 0xe8, 0x35, 0x9d, 0x2d, 0xe8, 0x2d, 0x49, 0xc3, 0x2e, 0x02, 0xf0, 0x67, 0xf3, 0x6b, 0xfa, - 0x81, 0x84, 0x3d, 0x74, 0x0c, 0x43, 0x9a, 0xb5, 0xaf, 0x7e, 0x33, 0x39, 0x9f, 0x65, 0x73, 0xb2, - 0x68, 0x26, 0x07, 0x68, 0x04, 0x47, 0xe4, 0xe3, 0x7b, 0x9a, 0x93, 0x34, 0xf4, 0x2f, 0xde, 0xfc, - 0xda, 0x44, 0xde, 0xfd, 0x26, 0xf2, 0x7e, 0x6f, 0x22, 0xef, 0xe7, 0x36, 0xea, 0xdc, 0x6f, 0xa3, - 0xce, 0xc3, 0x36, 0xea, 0xdc, 0x3e, 0xdf, 0xb7, 0xe5, 0xfb, 0xbf, 0x7d, 0xb1, 0x3f, 0x56, 0xc2, - 0x2c, 0x7d, 0xd7, 0x98, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3c, 0x14, 0x66, 0x42, 0x55, - 0x02, 0x00, 0x00, + // 461 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x4d, 0x6b, 0xdb, 0x30, + 0x18, 0xc7, 0xe3, 0xbc, 0xb8, 0xf5, 0x93, 0x2c, 0x31, 0x82, 0x82, 0x0e, 0xab, 0x97, 0xe5, 0x94, + 0x5d, 0x52, 0xd8, 0x0e, 0x83, 0xdd, 0xd2, 0x58, 0x65, 0x82, 0x10, 0x8a, 0xd3, 0x8e, 0xd1, 0x8b, + 0x51, 0x6c, 0x8d, 0x8a, 0x39, 0x96, 0x27, 0xc9, 0x7b, 0xe9, 0xa7, 0xd8, 0x77, 0xd8, 0x97, 0xd9, + 0xb1, 0xc7, 0x1d, 0x47, 0xf2, 0x45, 0x86, 0x65, 0xb7, 0xcb, 0x60, 0x47, 0xfd, 0xfe, 0xbf, 0x47, + 0xfc, 0x79, 0x78, 0x60, 0x6c, 0x64, 0x91, 0xdc, 0x32, 0x91, 0x9f, 0xe9, 0x72, 0xa3, 0x13, 0x25, + 0x0a, 0x23, 0x64, 0x7e, 0x96, 0x72, 0x96, 0xcd, 0x0a, 0x25, 0x8d, 0x44, 0x27, 0x0f, 0xc6, 0xec, + 0xd0, 0x98, 0xfc, 0xe8, 0x42, 0x37, 0xe4, 0x2c, 0x43, 0x43, 0x68, 0x8b, 0x14, 0x3b, 0x63, 0x67, + 0xea, 0x45, 0x6d, 0x91, 0xa2, 0xa7, 0xe0, 0x29, 0xfe, 0xa9, 0xe4, 0xda, 0x70, 0x85, 0xdb, 0x16, + 0xff, 0x05, 0xe8, 0x04, 0xdc, 0x44, 0xc9, 0x58, 0xa4, 0xb8, 0x63, 0xa3, 0x5e, 0xa2, 0x24, 0x4d, + 0xd1, 0x0b, 0xf0, 0x0f, 0x7f, 0x8f, 0x45, 0xaa, 0x71, 0x77, 0xdc, 0x99, 0x7a, 0xd1, 0xe8, 0x90, + 0xd3, 0x54, 0xa3, 0x37, 0xe0, 0x6a, 0xc3, 0x4c, 0xa9, 0x71, 0x6f, 0xec, 0x4c, 0x87, 0x2f, 0x27, + 0xb3, 0xff, 0x16, 0x9c, 0x55, 0xe5, 0x66, 0x6b, 0x6b, 0x46, 0xcd, 0x04, 0x7a, 0x0e, 0x03, 0x23, + 0x0d, 0xcb, 0x62, 0xb6, 0x95, 0x65, 0x6e, 0xb0, 0x3b, 0x76, 0xa6, 0xdd, 0xa8, 0x6f, 0xd9, 0xdc, + 0xa2, 0xaa, 0x09, 0xfb, 0xcc, 0x44, 0xc6, 0x36, 0x19, 0x7f, 0xd0, 0x8e, 0xac, 0x36, 0x7a, 0xe4, + 0x8d, 0xfa, 0x0c, 0xfa, 0xda, 0x30, 0x65, 0xe2, 0x4d, 0x26, 0x93, 0x8f, 0xf8, 0xd8, 0x5a, 0x60, + 0xd1, 0x79, 0x45, 0xd0, 0x29, 0x00, 0x2f, 0x64, 0x72, 0x1b, 0x6b, 0x71, 0xc7, 0xb1, 0x67, 0x73, + 0xcf, 0x92, 0xb5, 0xb8, 0xe3, 0x55, 0x9c, 0x97, 0xdb, 0xd8, 0x02, 0x8d, 0xa1, 0x8e, 0xf3, 0x72, + 0x4b, 0x2c, 0x40, 0x53, 0xf0, 0x15, 0xff, 0xc2, 0x54, 0x1a, 0x17, 0x5c, 0xd5, 0x16, 0xee, 0x5b, + 0x69, 0x58, 0xf3, 0x4b, 0xae, 0xac, 0x5a, 0x75, 0x16, 0xb9, 0x30, 0x82, 0x65, 0xf1, 0x07, 0x25, + 0x73, 0x23, 0xb8, 0xc2, 0x83, 0x7a, 0x7b, 0x0d, 0xbf, 0x68, 0xf0, 0x64, 0x0b, 0x6e, 0xbd, 0x13, + 0xf4, 0x04, 0xbc, 0xeb, 0x55, 0x48, 0x2e, 0xe8, 0x8a, 0x84, 0x7e, 0xab, 0x7a, 0xae, 0x17, 0x6f, + 0x49, 0x78, 0xbd, 0x24, 0xa1, 0xef, 0xa0, 0x11, 0xf4, 0xe9, 0x8a, 0x5e, 0xd1, 0xf9, 0x92, 0xde, + 0x90, 0xd0, 0x6f, 0x23, 0x00, 0x77, 0xbe, 0xb8, 0xa2, 0xef, 0x88, 0xdf, 0x41, 0x03, 0x38, 0xa6, + 0xab, 0xe6, 0xd5, 0xad, 0x26, 0x17, 0xf3, 0xd5, 0x82, 0x2c, 0xab, 0xc9, 0x1e, 0xea, 0xc3, 0x11, + 0x79, 0x7f, 0x49, 0x23, 0x12, 0xfa, 0xee, 0xf9, 0xeb, 0x9f, 0xbb, 0xc0, 0xb9, 0xdf, 0x05, 0xce, + 0xef, 0x5d, 0xe0, 0x7c, 0xdf, 0x07, 0xad, 0xfb, 0x7d, 0xd0, 0xfa, 0xb5, 0x0f, 0x5a, 0x37, 0xa7, + 0x8f, 0x87, 0xf7, 0xf5, 0xdf, 0xd3, 0x33, 0xdf, 0x0a, 0xae, 0x37, 0xae, 0x3d, 0xbe, 0x57, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x95, 0xe8, 0x0c, 0xa0, 0x02, 0x00, 0x00, } func (m *Deal) Marshal() (dAtA []byte, err error) { @@ -242,11 +260,21 @@ func (m *Deal) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.InitialFrontier[iNdEx]) i = encodeVarintDeal(dAtA, i, uint64(len(m.InitialFrontier[iNdEx]))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x62 } } - if m.EndBlock != 0 { - i = encodeVarintDeal(dAtA, i, uint64(m.EndBlock)) + if m.RewardPerEpoch != 0 { + i = encodeVarintDeal(dAtA, i, uint64(m.RewardPerEpoch)) + i-- + dAtA[i] = 0x58 + } + if m.NumEpochs != 0 { + i = encodeVarintDeal(dAtA, i, uint64(m.NumEpochs)) + i-- + dAtA[i] = 0x50 + } + if m.EpochSize != 0 { + i = encodeVarintDeal(dAtA, i, uint64(m.EpochSize)) i-- dAtA[i] = 0x48 } @@ -350,8 +378,14 @@ func (m *Deal) Size() (n int) { if m.StartBlock != 0 { n += 1 + sovDeal(uint64(m.StartBlock)) } - if m.EndBlock != 0 { - n += 1 + sovDeal(uint64(m.EndBlock)) + if m.EpochSize != 0 { + n += 1 + sovDeal(uint64(m.EpochSize)) + } + if m.NumEpochs != 0 { + n += 1 + sovDeal(uint64(m.NumEpochs)) + } + if m.RewardPerEpoch != 0 { + n += 1 + sovDeal(uint64(m.RewardPerEpoch)) } if len(m.InitialFrontier) > 0 { for _, s := range m.InitialFrontier { @@ -603,9 +637,9 @@ func (m *Deal) Unmarshal(dAtA []byte) error { } case 9: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EpochSize", wireType) } - m.EndBlock = 0 + m.EpochSize = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDeal @@ -615,12 +649,50 @@ func (m *Deal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.EndBlock |= uint64(b&0x7F) << shift + m.EpochSize |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) + } + m.NumEpochs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumEpochs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardPerEpoch", wireType) + } + m.RewardPerEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RewardPerEpoch |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InitialFrontier", wireType) } diff --git a/x/subscription/types/keys.go b/x/subscription/types/keys.go index ccba75f..7146924 100644 --- a/x/subscription/types/keys.go +++ b/x/subscription/types/keys.go @@ -10,14 +10,17 @@ const ( // MemStoreKey defines the in-memory store key MemStoreKey = "mem_subscription" - DealKeyPrefix = "Deal/value" - DealRequesterKeyPrefix = "Deal/Requester/value" - SubscriptionKeyPrefix = "Subscription/value" - SubscriptionProviderKeyPrefix = "Subscription/Provider/value" - ProgressKeyPrefix = "Progress/value" - ProgressObfuscatedKeyPrefix = "Progress/Obfuscated/value" - ProgressSizeKeyPrefix = "Progress/Size/value" - HashSubmissionBlockKeyPrefix = "HashSubmissionBlock/value" + DealKeyPrefix = "Deal/value" + DealRequesterKeyPrefix = "Deal/Requester/value" + SubscriptionKeyPrefix = "Subscription/value" + SubscriptionProviderKeyPrefix = "Subscription/Provider/value" + SubscriptionProviderLastClaimedKeyPrefix = "Subscription/Provider/Claim/value" + ProgressKeyPrefix = "Progress/value" + ProgressObfuscatedKeyPrefix = "Progress/Obfuscated/value" + ProgressSizeKeyPrefix = "Progress/Size/value" + HashSubmissionBlockKeyPrefix = "HashSubmissionBlock/value" + ProgressDealKeyPrefix = "Progress/Deal/value" + ProgressBlocksProviderKeyPrefix = "Progress/Provider/value" ) var ParamsKey = []byte("p_subscription") @@ -43,3 +46,15 @@ func GetProgressSizeStoreKey(subscription string) []byte { func GetHashSubmissionBlockStoreKey(provider string) []byte { return KeyPrefix(HashSubmissionBlockKeyPrefix + "/" + provider) } + +func GetProgressDealStoreKey(deal string) []byte { + return KeyPrefix(ProgressDealKeyPrefix + "/" + deal) +} + +func GetProgressBlocksProviderKey(provider string) []byte { + return KeyPrefix(ProgressBlocksProviderKeyPrefix + "/" + provider) +} + +func GetSubscriptionProviderLastClaimedKey(provider string) []byte { + return KeyPrefix(SubscriptionProviderLastClaimedKeyPrefix + "/" + provider) +} diff --git a/x/subscription/types/subscription.pb.go b/x/subscription/types/subscription.pb.go index 196cc47..5e7a6c6 100644 --- a/x/subscription/types/subscription.pb.go +++ b/x/subscription/types/subscription.pb.go @@ -26,8 +26,8 @@ type Subscription struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` DealId string `protobuf:"bytes,2,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - StartBlock uint64 `protobuf:"varint,4,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - EndBlock uint64 `protobuf:"varint,5,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` + StartEpoch uint64 `protobuf:"varint,4,opt,name=start_epoch,json=startEpoch,proto3" json:"start_epoch,omitempty"` + EndEpoch uint64 `protobuf:"varint,5,opt,name=end_epoch,json=endEpoch,proto3" json:"end_epoch,omitempty"` } func (m *Subscription) Reset() { *m = Subscription{} } @@ -84,16 +84,16 @@ func (m *Subscription) GetProvider() string { return "" } -func (m *Subscription) GetStartBlock() uint64 { +func (m *Subscription) GetStartEpoch() uint64 { if m != nil { - return m.StartBlock + return m.StartEpoch } return 0 } -func (m *Subscription) GetEndBlock() uint64 { +func (m *Subscription) GetEndEpoch() uint64 { if m != nil { - return m.EndBlock + return m.EndEpoch } return 0 } @@ -115,13 +115,13 @@ var fileDescriptor_f6aa30eaaa7d0617 = []byte{ 0x60, 0xd4, 0xe0, 0x0c, 0x62, 0xca, 0x4c, 0x11, 0x12, 0xe7, 0x62, 0x4f, 0x49, 0x4d, 0xcc, 0x89, 0xcf, 0x4c, 0x91, 0x60, 0x02, 0x0b, 0xb2, 0x81, 0xb8, 0x9e, 0x29, 0x42, 0x52, 0x5c, 0x1c, 0x05, 0x45, 0xf9, 0x65, 0x99, 0x29, 0xa9, 0x45, 0x12, 0xcc, 0x60, 0x19, 0x38, 0x5f, 0x48, 0x9e, 0x8b, - 0xbb, 0xb8, 0x24, 0xb1, 0xa8, 0x24, 0x3e, 0x29, 0x27, 0x3f, 0x39, 0x5b, 0x82, 0x45, 0x81, 0x51, - 0x83, 0x25, 0x88, 0x0b, 0x2c, 0xe4, 0x04, 0x12, 0x11, 0x92, 0xe6, 0xe2, 0x4c, 0xcd, 0x4b, 0x81, + 0xbb, 0xb8, 0x24, 0xb1, 0xa8, 0x24, 0x3e, 0xb5, 0x20, 0x3f, 0x39, 0x43, 0x82, 0x45, 0x81, 0x51, + 0x83, 0x25, 0x88, 0x0b, 0x2c, 0xe4, 0x0a, 0x12, 0x11, 0x92, 0xe6, 0xe2, 0x4c, 0xcd, 0x4b, 0x81, 0x4a, 0xb3, 0x82, 0xa5, 0x39, 0x52, 0xf3, 0x52, 0xc0, 0x92, 0x4e, 0xe6, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x25, 0x0b, 0xf7, 0x6e, 0x05, 0xaa, 0x87, 0x4b, 0x2a, 0x0b, - 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x5e, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x33, 0x98, - 0x06, 0x16, 0x01, 0x00, 0x00, + 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x5e, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x4f, 0xa0, 0xaa, + 0x1a, 0x16, 0x01, 0x00, 0x00, } func (m *Subscription) Marshal() (dAtA []byte, err error) { @@ -144,13 +144,13 @@ func (m *Subscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.EndBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.EndBlock)) + if m.EndEpoch != 0 { + i = encodeVarintSubscription(dAtA, i, uint64(m.EndEpoch)) i-- dAtA[i] = 0x28 } - if m.StartBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.StartBlock)) + if m.StartEpoch != 0 { + i = encodeVarintSubscription(dAtA, i, uint64(m.StartEpoch)) i-- dAtA[i] = 0x20 } @@ -207,11 +207,11 @@ func (m *Subscription) Size() (n int) { if l > 0 { n += 1 + l + sovSubscription(uint64(l)) } - if m.StartBlock != 0 { - n += 1 + sovSubscription(uint64(m.StartBlock)) + if m.StartEpoch != 0 { + n += 1 + sovSubscription(uint64(m.StartEpoch)) } - if m.EndBlock != 0 { - n += 1 + sovSubscription(uint64(m.EndBlock)) + if m.EndEpoch != 0 { + n += 1 + sovSubscription(uint64(m.EndEpoch)) } return n } @@ -349,9 +349,9 @@ func (m *Subscription) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartBlock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StartEpoch", wireType) } - m.StartBlock = 0 + m.StartEpoch = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscription @@ -361,16 +361,16 @@ func (m *Subscription) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.StartBlock |= uint64(b&0x7F) << shift + m.StartEpoch |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EndEpoch", wireType) } - m.EndBlock = 0 + m.EndEpoch = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscription @@ -380,7 +380,7 @@ func (m *Subscription) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.EndBlock |= uint64(b&0x7F) << shift + m.EndEpoch |= uint64(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/subscription/types/tx.pb.go b/x/subscription/types/tx.pb.go index 0a09b39..6dd45ed 100644 --- a/x/subscription/types/tx.pb.go +++ b/x/subscription/types/tx.pb.go @@ -129,8 +129,9 @@ type MsgCreateDeal struct { CroId string `protobuf:"bytes,2,opt,name=cro_id,json=croId,proto3" json:"cro_id,omitempty"` Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` StartBlock uint64 `protobuf:"varint,4,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - EndBlock uint64 `protobuf:"varint,5,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` - InitialFrontier []string `protobuf:"bytes,6,rep,name=initial_frontier,json=initialFrontier,proto3" json:"initial_frontier,omitempty"` + EpochSize uint64 `protobuf:"varint,5,opt,name=epoch_size,json=epochSize,proto3" json:"epoch_size,omitempty"` + NumEpochs uint64 `protobuf:"varint,6,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` + InitialFrontier []string `protobuf:"bytes,7,rep,name=initial_frontier,json=initialFrontier,proto3" json:"initial_frontier,omitempty"` } func (m *MsgCreateDeal) Reset() { *m = MsgCreateDeal{} } @@ -194,9 +195,16 @@ func (m *MsgCreateDeal) GetStartBlock() uint64 { return 0 } -func (m *MsgCreateDeal) GetEndBlock() uint64 { +func (m *MsgCreateDeal) GetEpochSize() uint64 { if m != nil { - return m.EndBlock + return m.EpochSize + } + return 0 +} + +func (m *MsgCreateDeal) GetNumEpochs() uint64 { + if m != nil { + return m.NumEpochs } return 0 } @@ -346,7 +354,8 @@ type MsgUpdateDeal struct { // these fields should be optional, errors with pulsar Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` StartBlock uint64 `protobuf:"varint,4,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - EndBlock uint64 `protobuf:"varint,5,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` + EpochSize uint64 `protobuf:"varint,5,opt,name=epoch_size,json=epochSize,proto3" json:"epoch_size,omitempty"` + NumEpochs uint64 `protobuf:"varint,6,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` } func (m *MsgUpdateDeal) Reset() { *m = MsgUpdateDeal{} } @@ -410,9 +419,16 @@ func (m *MsgUpdateDeal) GetStartBlock() uint64 { return 0 } -func (m *MsgUpdateDeal) GetEndBlock() uint64 { +func (m *MsgUpdateDeal) GetEpochSize() uint64 { + if m != nil { + return m.EpochSize + } + return 0 +} + +func (m *MsgUpdateDeal) GetNumEpochs() uint64 { if m != nil { - return m.EndBlock + return m.NumEpochs } return 0 } @@ -837,6 +853,182 @@ func (m *MsgSubmitProgressResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitProgressResponse proto.InternalMessageInfo +type MsgClaimRewards struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + SubscriptionId string `protobuf:"bytes,2,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` +} + +func (m *MsgClaimRewards) Reset() { *m = MsgClaimRewards{} } +func (m *MsgClaimRewards) String() string { return proto.CompactTextString(m) } +func (*MsgClaimRewards) ProtoMessage() {} +func (*MsgClaimRewards) Descriptor() ([]byte, []int) { + return fileDescriptor_7efc119a28a1fb6f, []int{16} +} +func (m *MsgClaimRewards) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimRewards.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 *MsgClaimRewards) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimRewards.Merge(m, src) +} +func (m *MsgClaimRewards) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimRewards) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimRewards.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimRewards proto.InternalMessageInfo + +func (m *MsgClaimRewards) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *MsgClaimRewards) GetSubscriptionId() string { + if m != nil { + return m.SubscriptionId + } + return "" +} + +type MsgClaimRewardsResponse struct { +} + +func (m *MsgClaimRewardsResponse) Reset() { *m = MsgClaimRewardsResponse{} } +func (m *MsgClaimRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClaimRewardsResponse) ProtoMessage() {} +func (*MsgClaimRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7efc119a28a1fb6f, []int{17} +} +func (m *MsgClaimRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimRewardsResponse.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 *MsgClaimRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimRewardsResponse.Merge(m, src) +} +func (m *MsgClaimRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimRewardsResponse proto.InternalMessageInfo + +type MsgWithdrawResidue struct { + Requester string `protobuf:"bytes,1,opt,name=requester,proto3" json:"requester,omitempty"` + DealId string `protobuf:"bytes,2,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` +} + +func (m *MsgWithdrawResidue) Reset() { *m = MsgWithdrawResidue{} } +func (m *MsgWithdrawResidue) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawResidue) ProtoMessage() {} +func (*MsgWithdrawResidue) Descriptor() ([]byte, []int) { + return fileDescriptor_7efc119a28a1fb6f, []int{18} +} +func (m *MsgWithdrawResidue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawResidue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawResidue.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 *MsgWithdrawResidue) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawResidue.Merge(m, src) +} +func (m *MsgWithdrawResidue) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawResidue) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawResidue.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawResidue proto.InternalMessageInfo + +func (m *MsgWithdrawResidue) GetRequester() string { + if m != nil { + return m.Requester + } + return "" +} + +func (m *MsgWithdrawResidue) GetDealId() string { + if m != nil { + return m.DealId + } + return "" +} + +type MsgWithdrawResidueResponse struct { +} + +func (m *MsgWithdrawResidueResponse) Reset() { *m = MsgWithdrawResidueResponse{} } +func (m *MsgWithdrawResidueResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawResidueResponse) ProtoMessage() {} +func (*MsgWithdrawResidueResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7efc119a28a1fb6f, []int{19} +} +func (m *MsgWithdrawResidueResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawResidueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawResidueResponse.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 *MsgWithdrawResidueResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawResidueResponse.Merge(m, src) +} +func (m *MsgWithdrawResidueResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawResidueResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawResidueResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawResidueResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "topchain.subscription.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "topchain.subscription.MsgUpdateParamsResponse") @@ -854,65 +1046,76 @@ func init() { proto.RegisterType((*MsgLeaveDealResponse)(nil), "topchain.subscription.MsgLeaveDealResponse") proto.RegisterType((*MsgSubmitProgress)(nil), "topchain.subscription.MsgSubmitProgress") proto.RegisterType((*MsgSubmitProgressResponse)(nil), "topchain.subscription.MsgSubmitProgressResponse") + proto.RegisterType((*MsgClaimRewards)(nil), "topchain.subscription.MsgClaimRewards") + proto.RegisterType((*MsgClaimRewardsResponse)(nil), "topchain.subscription.MsgClaimRewardsResponse") + proto.RegisterType((*MsgWithdrawResidue)(nil), "topchain.subscription.MsgWithdrawResidue") + proto.RegisterType((*MsgWithdrawResidueResponse)(nil), "topchain.subscription.MsgWithdrawResidueResponse") } func init() { proto.RegisterFile("topchain/subscription/tx.proto", fileDescriptor_7efc119a28a1fb6f) } var fileDescriptor_7efc119a28a1fb6f = []byte{ - // 848 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9b, 0x6d, 0xa8, 0x5f, 0x77, 0x5b, 0xd6, 0xdb, 0x26, 0xae, 0x97, 0xf5, 0x46, 0x66, - 0xc5, 0x86, 0xc0, 0x26, 0xcb, 0x22, 0x7e, 0xa8, 0x07, 0xc4, 0x06, 0x84, 0x08, 0x22, 0xd2, 0xe2, - 0x15, 0x7b, 0xa8, 0x84, 0xc2, 0xc4, 0x9e, 0x3a, 0x23, 0x12, 0x8f, 0x99, 0x99, 0x84, 0x56, 0x5c, - 0x10, 0x47, 0x4e, 0xfc, 0x19, 0x1c, 0x38, 0xf4, 0xc0, 0x1f, 0xc0, 0x8d, 0x1e, 0x2b, 0x24, 0x24, - 0x24, 0x24, 0x84, 0xda, 0x43, 0xff, 0x0d, 0xe4, 0x1f, 0x19, 0x3b, 0x3f, 0xdc, 0x06, 0xd1, 0xbd, - 0xb4, 0x99, 0xf7, 0x7d, 0xef, 0x7d, 0xef, 0x7b, 0xf6, 0x3c, 0x19, 0x4c, 0x41, 0x03, 0xa7, 0x8f, - 0x88, 0xdf, 0xe4, 0xa3, 0x1e, 0x77, 0x18, 0x09, 0x04, 0xa1, 0x7e, 0x53, 0x1c, 0x34, 0x02, 0x46, - 0x05, 0xd5, 0xb6, 0x27, 0x78, 0x23, 0x8b, 0x1b, 0x37, 0xd1, 0x90, 0xf8, 0xb4, 0x19, 0xfd, 0x8d, - 0x99, 0x46, 0xc5, 0xa1, 0x7c, 0x48, 0x79, 0x73, 0xc8, 0xbd, 0xe6, 0xf8, 0x8d, 0xf0, 0x5f, 0x02, - 0xec, 0xc4, 0x40, 0x37, 0x3a, 0x35, 0xe3, 0x43, 0x02, 0x6d, 0x79, 0xd4, 0xa3, 0x71, 0x3c, 0xfc, - 0x95, 0x44, 0xad, 0xc5, 0x3d, 0x05, 0x88, 0xa1, 0x61, 0x92, 0x69, 0xfd, 0xa6, 0xc0, 0x66, 0x87, - 0x7b, 0x9f, 0x07, 0x2e, 0x12, 0xf8, 0x49, 0x84, 0x68, 0x6f, 0x83, 0x8a, 0x46, 0xa2, 0x4f, 0x19, - 0x11, 0x87, 0xba, 0x52, 0x55, 0x6a, 0x6a, 0x4b, 0xff, 0xfd, 0x97, 0x07, 0x5b, 0x89, 0xe4, 0x63, - 0xd7, 0x65, 0x98, 0xf3, 0xa7, 0x82, 0x11, 0xdf, 0xb3, 0x53, 0xaa, 0xf6, 0x3e, 0x94, 0xe2, 0xda, - 0xfa, 0x4a, 0x55, 0xa9, 0xad, 0x3f, 0xba, 0xd3, 0x58, 0x68, 0xba, 0x11, 0xcb, 0xb4, 0xd4, 0xe3, - 0xbf, 0xef, 0x16, 0x7e, 0x3a, 0x3f, 0xaa, 0x2b, 0x76, 0x92, 0xb7, 0xbb, 0xfb, 0xfd, 0xf9, 0x51, - 0x3d, 0xad, 0xf8, 0xc3, 0xf9, 0x51, 0xfd, 0xbe, 0x34, 0x71, 0x30, 0x6d, 0x63, 0xa6, 0x6b, 0x6b, - 0x07, 0x2a, 0x33, 0x21, 0x1b, 0xf3, 0x80, 0xfa, 0x1c, 0x5b, 0x7f, 0x28, 0x70, 0xa3, 0xc3, 0xbd, - 0x0f, 0x18, 0x46, 0x02, 0x7f, 0x88, 0xd1, 0x40, 0x7b, 0x09, 0x54, 0x86, 0xbf, 0x1e, 0x61, 0x2e, - 0x30, 0x8b, 0x2d, 0xda, 0x69, 0x40, 0xdb, 0x86, 0x92, 0xc3, 0x68, 0x97, 0xb8, 0x91, 0x11, 0xd5, - 0x5e, 0x75, 0x18, 0x6d, 0xbb, 0x5a, 0x19, 0x4a, 0x68, 0x48, 0x47, 0xbe, 0xd0, 0x8b, 0x55, 0xa5, - 0x76, 0xcd, 0x4e, 0x4e, 0xda, 0x5d, 0x58, 0xe7, 0x02, 0x31, 0xd1, 0xed, 0x0d, 0xa8, 0xf3, 0x95, - 0x7e, 0x2d, 0x02, 0x21, 0x0a, 0xb5, 0xc2, 0x88, 0x76, 0x1b, 0x54, 0xec, 0xbb, 0x09, 0xbc, 0x1a, - 0xc1, 0x6b, 0xd8, 0x77, 0x63, 0xf0, 0x55, 0x78, 0x91, 0xf8, 0x44, 0x10, 0x34, 0xe8, 0xee, 0x33, - 0xea, 0x0b, 0x82, 0x99, 0x5e, 0xaa, 0x16, 0x6b, 0xaa, 0xbd, 0x99, 0xc4, 0x3f, 0x4a, 0xc2, 0xbb, - 0x1b, 0xd1, 0x78, 0x64, 0x9f, 0xd6, 0x43, 0xd8, 0x9e, 0xb2, 0x35, 0x31, 0xac, 0x55, 0xe0, 0x05, - 0x17, 0xa3, 0x41, 0xe8, 0x20, 0x36, 0x57, 0x0a, 0x8f, 0x6d, 0xd7, 0x7a, 0x16, 0x0f, 0x02, 0xf9, - 0x0e, 0x1e, 0x2c, 0x31, 0x88, 0x4c, 0x9d, 0x95, 0x6c, 0x9d, 0xb9, 0x4e, 0x2a, 0x71, 0x27, 0xb2, - 0xae, 0x1c, 0xfd, 0xcf, 0xf1, 0xe8, 0xe3, 0xc7, 0xf2, 0x3f, 0x14, 0x9f, 0xcf, 0xf0, 0x73, 0x7c, - 0xa4, 0xdd, 0x4a, 0x1f, 0xdf, 0x40, 0xb9, 0xc3, 0xbd, 0xb6, 0xef, 0x30, 0x3c, 0xc4, 0xbe, 0x08, - 0xb1, 0xc7, 0x71, 0x03, 0x57, 0xeb, 0x67, 0xae, 0xa3, 0x2a, 0x98, 0x8b, 0x85, 0x65, 0x6b, 0x9f, - 0xc1, 0x7a, 0x87, 0x7b, 0x9f, 0x50, 0xe2, 0x47, 0xf3, 0x35, 0x60, 0x2d, 0x60, 0x74, 0x4c, 0x5c, - 0xd9, 0x8e, 0x3c, 0xe7, 0x3f, 0xcf, 0x1b, 0xa1, 0xaa, 0xe4, 0x59, 0xef, 0xc1, 0xad, 0x4c, 0x49, - 0xf9, 0x5a, 0xdd, 0x87, 0xcd, 0xec, 0x15, 0x4c, 0x5f, 0xaf, 0x8d, 0x6c, 0xb8, 0xed, 0x5a, 0x36, - 0x5c, 0xef, 0x70, 0xef, 0x53, 0x8c, 0xc6, 0xf8, 0xca, 0x7a, 0x2a, 0xc3, 0x56, 0xb6, 0xa6, 0xb4, - 0xff, 0x97, 0x02, 0x37, 0x3b, 0xdc, 0x7b, 0x3a, 0xea, 0x0d, 0x89, 0x78, 0xc2, 0xa8, 0x17, 0x2e, - 0xa7, 0x0b, 0x15, 0x17, 0xd8, 0x58, 0x59, 0x64, 0x43, 0x7b, 0x17, 0xf4, 0x80, 0xe1, 0x31, 0xa1, - 0x23, 0xde, 0x1d, 0x63, 0x26, 0x88, 0x83, 0x79, 0xb7, 0x8f, 0x78, 0x1f, 0x73, 0xbd, 0x18, 0x5d, - 0xd1, 0xf2, 0x04, 0x7f, 0x96, 0xc0, 0x1f, 0x47, 0x68, 0x98, 0x49, 0x7b, 0xfb, 0x23, 0xee, 0x20, - 0x81, 0xdd, 0xe9, 0xdc, 0xe8, 0x15, 0x55, 0xed, 0x72, 0x8a, 0x67, 0x73, 0x67, 0x5d, 0xdf, 0x86, - 0x9d, 0x39, 0x73, 0x13, 0xeb, 0x8f, 0x7e, 0x2d, 0x41, 0xb1, 0xc3, 0x3d, 0x6d, 0x1f, 0xae, 0x4f, - 0x2d, 0xf0, 0x57, 0x72, 0x16, 0xef, 0xcc, 0x7e, 0x34, 0x1a, 0xcb, 0xf1, 0xe4, 0xf3, 0xff, 0x12, - 0x20, 0xb3, 0x43, 0xef, 0xe5, 0x67, 0xa7, 0x2c, 0xe3, 0xf5, 0x65, 0x58, 0x53, 0x0a, 0xe9, 0x72, - 0xba, 0x48, 0x41, 0xb2, 0x2e, 0x54, 0x98, 0x5b, 0x48, 0xa1, 0x42, 0x66, 0x19, 0xdd, 0xbb, 0x6c, - 0x02, 0x97, 0x29, 0xcc, 0xaf, 0x0a, 0xed, 0x5b, 0xb8, 0xb5, 0x68, 0x4f, 0x3c, 0xc8, 0x2f, 0xb2, - 0x80, 0x6e, 0xbc, 0xf5, 0x9f, 0xe8, 0x52, 0x7c, 0x0f, 0xd6, 0xe4, 0x26, 0xb0, 0xf2, 0x4b, 0x4c, - 0x38, 0x46, 0xfd, 0x72, 0x8e, 0xac, 0xfd, 0x05, 0xa8, 0xe9, 0x95, 0x7e, 0x39, 0x3f, 0x51, 0x92, - 0x8c, 0xd7, 0x96, 0x20, 0xc9, 0xf2, 0x03, 0xd8, 0x98, 0xb9, 0xc4, 0xb5, 0xfc, 0xf4, 0x69, 0xa6, - 0xf1, 0x70, 0x59, 0xe6, 0x44, 0xcd, 0x58, 0xfd, 0x2e, 0xfc, 0xf2, 0x68, 0xbd, 0x73, 0x7c, 0x6a, - 0x2a, 0x27, 0xa7, 0xa6, 0xf2, 0xcf, 0xa9, 0xa9, 0xfc, 0x78, 0x66, 0x16, 0x4e, 0xce, 0xcc, 0xc2, - 0x9f, 0x67, 0x66, 0x61, 0xef, 0x4e, 0xde, 0x87, 0x87, 0x38, 0x0c, 0x30, 0xef, 0x95, 0xa2, 0xef, - 0xa7, 0x37, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x90, 0xeb, 0x1f, 0x40, 0xf9, 0x09, 0x00, 0x00, + // 956 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0x8e, 0x93, 0x66, 0x1b, 0xbf, 0xa4, 0x09, 0x75, 0x93, 0x8d, 0x63, 0x9a, 0xed, 0xca, 0x54, + 0x74, 0x1b, 0xe8, 0x6e, 0x5b, 0xc4, 0x0f, 0xe5, 0x80, 0x68, 0x0a, 0x88, 0x20, 0x56, 0x2a, 0x8e, + 0x28, 0x52, 0x11, 0x5a, 0x66, 0xed, 0x89, 0x77, 0xc4, 0xda, 0x63, 0x66, 0xc6, 0x9b, 0xb6, 0x5c, + 0x10, 0x47, 0x4e, 0x5c, 0xf9, 0x0f, 0x38, 0xe6, 0xc0, 0xff, 0x40, 0x2f, 0x48, 0x15, 0x27, 0x24, + 0x24, 0x84, 0x92, 0x43, 0xfe, 0x03, 0xce, 0xc8, 0x3f, 0x76, 0xec, 0xfd, 0xe1, 0xcd, 0x22, 0x56, + 0xea, 0x25, 0xd9, 0x79, 0xef, 0x7b, 0xef, 0x7b, 0xdf, 0x8c, 0xe7, 0xb3, 0xa1, 0x22, 0x68, 0x60, + 0x77, 0x10, 0xf1, 0x1b, 0x3c, 0x6c, 0x73, 0x9b, 0x91, 0x40, 0x10, 0xea, 0x37, 0xc4, 0xe3, 0x7a, + 0xc0, 0xa8, 0xa0, 0xda, 0x46, 0x3f, 0x5f, 0xcf, 0xe7, 0x8d, 0xcb, 0xc8, 0x23, 0x3e, 0x6d, 0xc4, + 0x7f, 0x13, 0xa4, 0xb1, 0x69, 0x53, 0xee, 0x51, 0xde, 0xf0, 0xb8, 0xdb, 0xe8, 0xdd, 0x89, 0xfe, + 0xa5, 0x89, 0xad, 0x24, 0xd1, 0x8a, 0x57, 0x8d, 0x64, 0x91, 0xa6, 0xd6, 0x5d, 0xea, 0xd2, 0x24, + 0x1e, 0xfd, 0x4a, 0xa3, 0xe6, 0xf8, 0x99, 0x02, 0xc4, 0x90, 0x97, 0x56, 0x9a, 0xbf, 0x2a, 0xb0, + 0xd6, 0xe4, 0xee, 0x67, 0x81, 0x83, 0x04, 0x7e, 0x10, 0x67, 0xb4, 0xb7, 0x40, 0x45, 0xa1, 0xe8, + 0x50, 0x46, 0xc4, 0x13, 0x5d, 0xa9, 0x2a, 0x35, 0x75, 0x4f, 0xff, 0xfd, 0x97, 0x5b, 0xeb, 0x29, + 0xe5, 0x3d, 0xc7, 0x61, 0x98, 0xf3, 0x03, 0xc1, 0x88, 0xef, 0x5a, 0x19, 0x54, 0x7b, 0x0f, 0x4a, + 0x49, 0x6f, 0x7d, 0xbe, 0xaa, 0xd4, 0x96, 0xef, 0x6e, 0xd7, 0xc7, 0x8a, 0xae, 0x27, 0x34, 0x7b, + 0xea, 0xb3, 0xbf, 0xae, 0xcd, 0xfd, 0x7c, 0x76, 0xbc, 0xa3, 0x58, 0x69, 0xdd, 0xee, 0xee, 0xf7, + 0x67, 0xc7, 0x3b, 0x59, 0xc7, 0x1f, 0xce, 0x8e, 0x77, 0x6e, 0x48, 0x11, 0x8f, 0x07, 0x65, 0x0c, + 0x4d, 0x6d, 0x6e, 0xc1, 0xe6, 0x50, 0xc8, 0xc2, 0x3c, 0xa0, 0x3e, 0xc7, 0xe6, 0x3f, 0x0a, 0x5c, + 0x6a, 0x72, 0xf7, 0x3e, 0xc3, 0x48, 0xe0, 0xf7, 0x31, 0xea, 0x6a, 0x57, 0x41, 0x65, 0xf8, 0x9b, + 0x10, 0x73, 0x81, 0x59, 0x22, 0xd1, 0xca, 0x02, 0xda, 0x06, 0x94, 0x6c, 0x46, 0x5b, 0xc4, 0x89, + 0x85, 0xa8, 0xd6, 0xa2, 0xcd, 0xe8, 0xbe, 0xa3, 0x95, 0xa1, 0x84, 0x3c, 0x1a, 0xfa, 0x42, 0x5f, + 0xa8, 0x2a, 0xb5, 0x0b, 0x56, 0xba, 0xd2, 0xae, 0xc1, 0x32, 0x17, 0x88, 0x89, 0x56, 0xbb, 0x4b, + 0xed, 0xaf, 0xf5, 0x0b, 0x71, 0x12, 0xe2, 0xd0, 0x5e, 0x14, 0xd1, 0xb6, 0x01, 0x70, 0x40, 0xed, + 0x4e, 0x8b, 0x93, 0xa7, 0x58, 0x5f, 0x8c, 0xf3, 0x6a, 0x1c, 0x39, 0x20, 0x4f, 0x71, 0x94, 0xf6, + 0x43, 0xaf, 0x15, 0x07, 0xb8, 0x5e, 0x4a, 0xd2, 0x7e, 0xe8, 0x7d, 0x10, 0x07, 0xb4, 0x9b, 0xf0, + 0x12, 0xf1, 0x89, 0x20, 0xa8, 0xdb, 0x3a, 0x64, 0xd4, 0x17, 0x04, 0x33, 0xfd, 0x62, 0x75, 0xa1, + 0xa6, 0x5a, 0x6b, 0x69, 0xfc, 0xc3, 0x34, 0xbc, 0xbb, 0x1a, 0xef, 0x9f, 0x14, 0x62, 0xde, 0x86, + 0x8d, 0x01, 0xdd, 0xfd, 0x1d, 0xd1, 0x36, 0xe1, 0xa2, 0x83, 0x51, 0x37, 0x92, 0x98, 0xa8, 0x2f, + 0x45, 0xcb, 0x7d, 0xc7, 0x7c, 0x98, 0xec, 0x14, 0xf2, 0x6d, 0xdc, 0x9d, 0x62, 0xa7, 0x72, 0x7d, + 0xe6, 0xf3, 0x7d, 0x46, 0x26, 0xd9, 0x4c, 0x26, 0x91, 0x7d, 0xe5, 0xd9, 0xfc, 0x96, 0x9c, 0x4d, + 0x72, 0x6e, 0xff, 0x83, 0xf1, 0x05, 0x9d, 0x4e, 0x81, 0xd0, 0x4c, 0x8e, 0x14, 0x7a, 0x04, 0xe5, + 0x26, 0x77, 0xf7, 0x7d, 0x9b, 0x61, 0x0f, 0xfb, 0x22, 0xca, 0xdd, 0x4b, 0x26, 0x9c, 0xad, 0xe0, + 0x91, 0x89, 0xaa, 0x50, 0x19, 0x4f, 0x2c, 0x47, 0xfb, 0x14, 0x96, 0x9b, 0xdc, 0xfd, 0x98, 0x12, + 0x3f, 0x3e, 0x00, 0x03, 0x96, 0x02, 0x46, 0x7b, 0xc4, 0x91, 0xe3, 0xc8, 0x75, 0xf1, 0x81, 0x5f, + 0x8a, 0x58, 0x25, 0xce, 0x7c, 0x17, 0xae, 0xe4, 0x5a, 0xca, 0xe7, 0xee, 0x06, 0xac, 0xe5, 0x2f, + 0x71, 0xf6, 0xfc, 0xad, 0xe6, 0xc3, 0xfb, 0x8e, 0x69, 0xc1, 0x4a, 0x93, 0xbb, 0x9f, 0x60, 0xd4, + 0xc3, 0x33, 0x9b, 0xa9, 0x0c, 0xeb, 0xf9, 0x9e, 0x52, 0xfe, 0x9f, 0x0a, 0x5c, 0x6e, 0x72, 0xf7, + 0x20, 0x6c, 0x7b, 0x44, 0x3c, 0x60, 0xd4, 0x8d, 0xec, 0x6d, 0x22, 0xe3, 0x18, 0x19, 0xf3, 0xe3, + 0x64, 0x68, 0xef, 0x80, 0x1e, 0x30, 0xdc, 0x23, 0x34, 0xe4, 0xad, 0x1e, 0x66, 0x82, 0xd8, 0x98, + 0xb7, 0x3a, 0x88, 0x77, 0x30, 0xd7, 0x17, 0xe2, 0x3b, 0x5c, 0xee, 0xe7, 0x1f, 0xa6, 0xe9, 0x8f, + 0xe2, 0x6c, 0x54, 0x49, 0xdb, 0x87, 0x21, 0xb7, 0x91, 0xc0, 0xce, 0x60, 0x6d, 0xfc, 0x0c, 0xab, + 0x56, 0x39, 0xcb, 0xe7, 0x6b, 0x87, 0x55, 0xbf, 0x0c, 0x5b, 0x23, 0xe2, 0xa4, 0x74, 0x1c, 0xbb, + 0xff, 0xfd, 0x2e, 0x22, 0x9e, 0x85, 0x8f, 0x10, 0x73, 0x66, 0xa3, 0x7b, 0x78, 0x86, 0xc4, 0x9b, + 0xf3, 0x34, 0x72, 0x82, 0x2f, 0x40, 0x6b, 0x72, 0xf7, 0x73, 0x22, 0x3a, 0x0e, 0x43, 0x47, 0x16, + 0xe6, 0xc4, 0x09, 0xf1, 0xac, 0x5c, 0xe7, 0x2a, 0x18, 0xa3, 0xcd, 0xfb, 0xd4, 0x77, 0x7f, 0x5a, + 0x82, 0x85, 0x26, 0x77, 0xb5, 0x43, 0x58, 0x19, 0x78, 0xff, 0xbd, 0x5a, 0xf0, 0xde, 0x1a, 0x7a, + 0xbd, 0x18, 0xf5, 0xe9, 0x70, 0xf2, 0xe1, 0xff, 0x0a, 0x20, 0xf7, 0x0a, 0xba, 0x5e, 0x5c, 0x9d, + 0xa1, 0x8c, 0xd7, 0xa7, 0x41, 0x0d, 0x30, 0x64, 0xd6, 0x3d, 0x89, 0x41, 0xa2, 0x26, 0x32, 0x8c, + 0xd8, 0x75, 0xc4, 0x90, 0xb3, 0xea, 0xeb, 0xe7, 0xed, 0xc0, 0x79, 0x0c, 0xa3, 0x3e, 0xa9, 0x7d, + 0x0b, 0x57, 0xc6, 0x99, 0xe4, 0xad, 0xe2, 0x26, 0x63, 0xe0, 0xc6, 0x9b, 0xff, 0x09, 0x2e, 0xc9, + 0x1f, 0xc1, 0x92, 0xb4, 0x41, 0xb3, 0xb8, 0x45, 0x1f, 0x63, 0xec, 0x9c, 0x8f, 0x91, 0xbd, 0xbf, + 0x04, 0x35, 0xf3, 0xb3, 0x57, 0x8a, 0x0b, 0x25, 0xc8, 0x78, 0x6d, 0x0a, 0x90, 0x6c, 0xdf, 0x85, + 0xd5, 0x21, 0x07, 0xab, 0x15, 0x97, 0x0f, 0x22, 0x8d, 0xdb, 0xd3, 0x22, 0x25, 0xdb, 0x21, 0xac, + 0xd8, 0x79, 0xd7, 0x98, 0x70, 0x67, 0xf2, 0xd7, 0x7e, 0xd2, 0x9d, 0x19, 0x67, 0x0f, 0x1a, 0x85, + 0xb5, 0xa3, 0x21, 0x6f, 0xb8, 0x59, 0xdc, 0x62, 0xe8, 0xa6, 0x1b, 0x77, 0xa6, 0x86, 0xf6, 0x09, + 0x8d, 0xc5, 0xef, 0xa2, 0x2f, 0xd2, 0xbd, 0xb7, 0x9f, 0x9d, 0x54, 0x94, 0xe7, 0x27, 0x15, 0xe5, + 0xef, 0x93, 0x8a, 0xf2, 0xe3, 0x69, 0x65, 0xee, 0xf9, 0x69, 0x65, 0xee, 0x8f, 0xd3, 0xca, 0xdc, + 0xa3, 0xed, 0xa2, 0x0f, 0x52, 0xf1, 0x24, 0xc0, 0xbc, 0x5d, 0x8a, 0xbf, 0xab, 0xdf, 0xf8, 0x37, + 0x00, 0x00, 0xff, 0xff, 0xcd, 0xe1, 0x81, 0x45, 0x11, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -937,6 +1140,8 @@ type MsgClient interface { JoinDeal(ctx context.Context, in *MsgJoinDeal, opts ...grpc.CallOption) (*MsgJoinDealResponse, error) LeaveDeal(ctx context.Context, in *MsgLeaveDeal, opts ...grpc.CallOption) (*MsgLeaveDealResponse, error) SubmitProgress(ctx context.Context, in *MsgSubmitProgress, opts ...grpc.CallOption) (*MsgSubmitProgressResponse, error) + ClaimRewards(ctx context.Context, in *MsgClaimRewards, opts ...grpc.CallOption) (*MsgClaimRewardsResponse, error) + WithdrawResidue(ctx context.Context, in *MsgWithdrawResidue, opts ...grpc.CallOption) (*MsgWithdrawResidueResponse, error) } type msgClient struct { @@ -1019,6 +1224,24 @@ func (c *msgClient) SubmitProgress(ctx context.Context, in *MsgSubmitProgress, o return out, nil } +func (c *msgClient) ClaimRewards(ctx context.Context, in *MsgClaimRewards, opts ...grpc.CallOption) (*MsgClaimRewardsResponse, error) { + out := new(MsgClaimRewardsResponse) + err := c.cc.Invoke(ctx, "/topchain.subscription.Msg/claimRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawResidue(ctx context.Context, in *MsgWithdrawResidue, opts ...grpc.CallOption) (*MsgWithdrawResidueResponse, error) { + out := new(MsgWithdrawResidueResponse) + err := c.cc.Invoke(ctx, "/topchain.subscription.Msg/withdrawResidue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // UpdateParams defines a (governance) operation for updating the module @@ -1031,6 +1254,8 @@ type MsgServer interface { JoinDeal(context.Context, *MsgJoinDeal) (*MsgJoinDealResponse, error) LeaveDeal(context.Context, *MsgLeaveDeal) (*MsgLeaveDealResponse, error) SubmitProgress(context.Context, *MsgSubmitProgress) (*MsgSubmitProgressResponse, error) + ClaimRewards(context.Context, *MsgClaimRewards) (*MsgClaimRewardsResponse, error) + WithdrawResidue(context.Context, *MsgWithdrawResidue) (*MsgWithdrawResidueResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1061,6 +1286,12 @@ func (*UnimplementedMsgServer) LeaveDeal(ctx context.Context, req *MsgLeaveDeal) func (*UnimplementedMsgServer) SubmitProgress(ctx context.Context, req *MsgSubmitProgress) (*MsgSubmitProgressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitProgress not implemented") } +func (*UnimplementedMsgServer) ClaimRewards(ctx context.Context, req *MsgClaimRewards) (*MsgClaimRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimRewards not implemented") +} +func (*UnimplementedMsgServer) WithdrawResidue(ctx context.Context, req *MsgWithdrawResidue) (*MsgWithdrawResidueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawResidue not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1210,6 +1441,42 @@ func _Msg_SubmitProgress_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Msg_ClaimRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimRewards) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/topchain.subscription.Msg/ClaimRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimRewards(ctx, req.(*MsgClaimRewards)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawResidue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawResidue) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawResidue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/topchain.subscription.Msg/WithdrawResidue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawResidue(ctx, req.(*MsgWithdrawResidue)) + } + return interceptor(ctx, in, info, handler) +} + var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "topchain.subscription.Msg", @@ -1247,6 +1514,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitProgress", Handler: _Msg_SubmitProgress_Handler, }, + { + MethodName: "claimRewards", + Handler: _Msg_ClaimRewards_Handler, + }, + { + MethodName: "withdrawResidue", + Handler: _Msg_WithdrawResidue_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "topchain/subscription/tx.proto", @@ -1341,11 +1616,16 @@ func (m *MsgCreateDeal) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.InitialFrontier[iNdEx]) i = encodeVarintTx(dAtA, i, uint64(len(m.InitialFrontier[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a } } - if m.EndBlock != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.EndBlock)) + if m.NumEpochs != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NumEpochs)) + i-- + dAtA[i] = 0x30 + } + if m.EpochSize != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.EpochSize)) i-- dAtA[i] = 0x28 } @@ -1486,8 +1766,13 @@ func (m *MsgUpdateDeal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.EndBlock != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.EndBlock)) + if m.NumEpochs != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NumEpochs)) + i-- + dAtA[i] = 0x30 + } + if m.EpochSize != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.EpochSize)) i-- dAtA[i] = 0x28 } @@ -1809,53 +2094,173 @@ func (m *MsgSubmitProgressResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgClaimRewards) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgClaimRewards) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.SubscriptionId) > 0 { + i -= len(m.SubscriptionId) + copy(dAtA[i:], m.SubscriptionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SubscriptionId))) + i-- + dAtA[i] = 0x12 } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintTx(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgClaimRewardsResponse) 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 *MsgClaimRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgCreateDeal) Size() (n int) { - if m == nil { - return 0 +func (m *MsgWithdrawResidue) 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 *MsgWithdrawResidue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawResidue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Requester) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.CroId) - if l > 0 { + if len(m.DealId) > 0 { + i -= len(m.DealId) + copy(dAtA[i:], m.DealId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DealId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Requester) > 0 { + i -= len(m.Requester) + copy(dAtA[i:], m.Requester) + i = encodeVarintTx(dAtA, i, uint64(len(m.Requester))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawResidueResponse) 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 *MsgWithdrawResidueResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawResidueResponse) 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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateDeal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Requester) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CroId) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } if m.Amount != 0 { @@ -1864,8 +2269,11 @@ func (m *MsgCreateDeal) Size() (n int) { if m.StartBlock != 0 { n += 1 + sovTx(uint64(m.StartBlock)) } - if m.EndBlock != 0 { - n += 1 + sovTx(uint64(m.EndBlock)) + if m.EpochSize != 0 { + n += 1 + sovTx(uint64(m.EpochSize)) + } + if m.NumEpochs != 0 { + n += 1 + sovTx(uint64(m.NumEpochs)) } if len(m.InitialFrontier) > 0 { for _, s := range m.InitialFrontier { @@ -1935,8 +2343,11 @@ func (m *MsgUpdateDeal) Size() (n int) { if m.StartBlock != 0 { n += 1 + sovTx(uint64(m.StartBlock)) } - if m.EndBlock != 0 { - n += 1 + sovTx(uint64(m.EndBlock)) + if m.EpochSize != 0 { + n += 1 + sovTx(uint64(m.EpochSize)) + } + if m.NumEpochs != 0 { + n += 1 + sovTx(uint64(m.NumEpochs)) } return n } @@ -2071,6 +2482,58 @@ func (m *MsgSubmitProgressResponse) Size() (n int) { return n } +func (m *MsgClaimRewards) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SubscriptionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgClaimRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawResidue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Requester) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DealId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgWithdrawResidueResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2375,9 +2838,9 @@ func (m *MsgCreateDeal) Unmarshal(dAtA []byte) error { } case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EpochSize", wireType) } - m.EndBlock = 0 + m.EpochSize = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2387,12 +2850,31 @@ func (m *MsgCreateDeal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.EndBlock |= uint64(b&0x7F) << shift + m.EpochSize |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) + } + m.NumEpochs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumEpochs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InitialFrontier", wireType) } @@ -2824,9 +3306,28 @@ func (m *MsgUpdateDeal) Unmarshal(dAtA []byte) error { } case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EpochSize", wireType) + } + m.EpochSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) } - m.EndBlock = 0 + m.NumEpochs = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2836,7 +3337,7 @@ func (m *MsgUpdateDeal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.EndBlock |= uint64(b&0x7F) << shift + m.NumEpochs |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3683,6 +4184,334 @@ func (m *MsgSubmitProgressResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgClaimRewards) 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: MsgClaimRewards: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimRewards: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", 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.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionId", 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.SubscriptionId = string(dAtA[iNdEx:postIndex]) + 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 *MsgClaimRewardsResponse) 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: MsgClaimRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimRewardsResponse: 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 *MsgWithdrawResidue) 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: MsgWithdrawResidue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawResidue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Requester", 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.Requester = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", 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.DealId = string(dAtA[iNdEx:postIndex]) + 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 *MsgWithdrawResidueResponse) 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: MsgWithdrawResidueResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawResidueResponse: 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