diff --git a/api/regen/ecocredit/marketplace/v1/events.pulsar.go b/api/regen/ecocredit/marketplace/v1/events.pulsar.go index 187f77ada6..996f3b97de 100644 --- a/api/regen/ecocredit/marketplace/v1/events.pulsar.go +++ b/api/regen/ecocredit/marketplace/v1/events.pulsar.go @@ -4,6 +4,7 @@ package marketplacev1 import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" + v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/v1beta1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -417,14 +418,22 @@ func (x *fastReflection_EventSell) ProtoMethods() *protoiface.Methods { } var ( - md_EventBuyDirect protoreflect.MessageDescriptor - fd_EventBuyDirect_sell_order_id protoreflect.FieldDescriptor + md_EventBuyDirect protoreflect.MessageDescriptor + fd_EventBuyDirect_sell_order_id protoreflect.FieldDescriptor + fd_EventBuyDirect_seller protoreflect.FieldDescriptor + fd_EventBuyDirect_seller_fee_paid protoreflect.FieldDescriptor + fd_EventBuyDirect_buyer protoreflect.FieldDescriptor + fd_EventBuyDirect_buyer_fee_paid protoreflect.FieldDescriptor ) func init() { file_regen_ecocredit_marketplace_v1_events_proto_init() md_EventBuyDirect = File_regen_ecocredit_marketplace_v1_events_proto.Messages().ByName("EventBuyDirect") fd_EventBuyDirect_sell_order_id = md_EventBuyDirect.Fields().ByName("sell_order_id") + fd_EventBuyDirect_seller = md_EventBuyDirect.Fields().ByName("seller") + fd_EventBuyDirect_seller_fee_paid = md_EventBuyDirect.Fields().ByName("seller_fee_paid") + fd_EventBuyDirect_buyer = md_EventBuyDirect.Fields().ByName("buyer") + fd_EventBuyDirect_buyer_fee_paid = md_EventBuyDirect.Fields().ByName("buyer_fee_paid") } var _ protoreflect.Message = (*fastReflection_EventBuyDirect)(nil) @@ -498,6 +507,30 @@ func (x *fastReflection_EventBuyDirect) Range(f func(protoreflect.FieldDescripto return } } + if x.Seller != "" { + value := protoreflect.ValueOfString(x.Seller) + if !f(fd_EventBuyDirect_seller, value) { + return + } + } + if x.SellerFeePaid != nil { + value := protoreflect.ValueOfMessage(x.SellerFeePaid.ProtoReflect()) + if !f(fd_EventBuyDirect_seller_fee_paid, value) { + return + } + } + if x.Buyer != "" { + value := protoreflect.ValueOfString(x.Buyer) + if !f(fd_EventBuyDirect_buyer, value) { + return + } + } + if x.BuyerFeePaid != nil { + value := protoreflect.ValueOfMessage(x.BuyerFeePaid.ProtoReflect()) + if !f(fd_EventBuyDirect_buyer_fee_paid, value) { + return + } + } } // Has reports whether a field is populated. @@ -515,6 +548,14 @@ func (x *fastReflection_EventBuyDirect) Has(fd protoreflect.FieldDescriptor) boo switch fd.FullName() { case "regen.ecocredit.marketplace.v1.EventBuyDirect.sell_order_id": return x.SellOrderId != uint64(0) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller": + return x.Seller != "" + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller_fee_paid": + return x.SellerFeePaid != nil + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer": + return x.Buyer != "" + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer_fee_paid": + return x.BuyerFeePaid != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.EventBuyDirect")) @@ -533,6 +574,14 @@ func (x *fastReflection_EventBuyDirect) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "regen.ecocredit.marketplace.v1.EventBuyDirect.sell_order_id": x.SellOrderId = uint64(0) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller": + x.Seller = "" + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller_fee_paid": + x.SellerFeePaid = nil + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer": + x.Buyer = "" + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer_fee_paid": + x.BuyerFeePaid = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.EventBuyDirect")) @@ -552,6 +601,18 @@ func (x *fastReflection_EventBuyDirect) Get(descriptor protoreflect.FieldDescrip case "regen.ecocredit.marketplace.v1.EventBuyDirect.sell_order_id": value := x.SellOrderId return protoreflect.ValueOfUint64(value) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller": + value := x.Seller + return protoreflect.ValueOfString(value) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller_fee_paid": + value := x.SellerFeePaid + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer": + value := x.Buyer + return protoreflect.ValueOfString(value) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer_fee_paid": + value := x.BuyerFeePaid + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.EventBuyDirect")) @@ -574,6 +635,14 @@ func (x *fastReflection_EventBuyDirect) Set(fd protoreflect.FieldDescriptor, val switch fd.FullName() { case "regen.ecocredit.marketplace.v1.EventBuyDirect.sell_order_id": x.SellOrderId = value.Uint() + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller": + x.Seller = value.Interface().(string) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller_fee_paid": + x.SellerFeePaid = value.Message().Interface().(*v1beta1.Coin) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer": + x.Buyer = value.Interface().(string) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer_fee_paid": + x.BuyerFeePaid = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.EventBuyDirect")) @@ -594,8 +663,22 @@ func (x *fastReflection_EventBuyDirect) Set(fd protoreflect.FieldDescriptor, val // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_EventBuyDirect) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller_fee_paid": + if x.SellerFeePaid == nil { + x.SellerFeePaid = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.SellerFeePaid.ProtoReflect()) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer_fee_paid": + if x.BuyerFeePaid == nil { + x.BuyerFeePaid = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.BuyerFeePaid.ProtoReflect()) case "regen.ecocredit.marketplace.v1.EventBuyDirect.sell_order_id": panic(fmt.Errorf("field sell_order_id of message regen.ecocredit.marketplace.v1.EventBuyDirect is not mutable")) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller": + panic(fmt.Errorf("field seller of message regen.ecocredit.marketplace.v1.EventBuyDirect is not mutable")) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer": + panic(fmt.Errorf("field buyer of message regen.ecocredit.marketplace.v1.EventBuyDirect is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.EventBuyDirect")) @@ -611,6 +694,16 @@ func (x *fastReflection_EventBuyDirect) NewField(fd protoreflect.FieldDescriptor switch fd.FullName() { case "regen.ecocredit.marketplace.v1.EventBuyDirect.sell_order_id": return protoreflect.ValueOfUint64(uint64(0)) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller": + return protoreflect.ValueOfString("") + case "regen.ecocredit.marketplace.v1.EventBuyDirect.seller_fee_paid": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer": + return protoreflect.ValueOfString("") + case "regen.ecocredit.marketplace.v1.EventBuyDirect.buyer_fee_paid": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.EventBuyDirect")) @@ -683,6 +776,22 @@ func (x *fastReflection_EventBuyDirect) ProtoMethods() *protoiface.Methods { if x.SellOrderId != 0 { n += 1 + runtime.Sov(uint64(x.SellOrderId)) } + l = len(x.Seller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.SellerFeePaid != nil { + l = options.Size(x.SellerFeePaid) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Buyer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BuyerFeePaid != nil { + l = options.Size(x.BuyerFeePaid) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -712,6 +821,48 @@ func (x *fastReflection_EventBuyDirect) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.BuyerFeePaid != nil { + encoded, err := options.Marshal(x.BuyerFeePaid) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if len(x.Buyer) > 0 { + i -= len(x.Buyer) + copy(dAtA[i:], x.Buyer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Buyer))) + i-- + dAtA[i] = 0x22 + } + if x.SellerFeePaid != nil { + encoded, err := options.Marshal(x.SellerFeePaid) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.Seller) > 0 { + i -= len(x.Seller) + copy(dAtA[i:], x.Seller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Seller))) + i-- + dAtA[i] = 0x12 + } if x.SellOrderId != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.SellOrderId)) i-- @@ -785,6 +936,142 @@ func (x *fastReflection_EventBuyDirect) ProtoMethods() *protoiface.Methods { break } } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Seller", 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.Seller = 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 SellerFeePaid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.SellerFeePaid == nil { + x.SellerFeePaid = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SellerFeePaid); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Buyer", 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.Buyer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BuyerFeePaid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.BuyerFeePaid == nil { + x.BuyerFeePaid = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BuyerFeePaid); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2527,6 +2814,16 @@ type EventBuyDirect struct { // sell_order_id is the unique identifier of the sell order that credits were // purchased from. SellOrderId uint64 `protobuf:"varint,1,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` + // seller is the address of the account that sold the credits. + Seller string `protobuf:"bytes,2,opt,name=seller,proto3" json:"seller,omitempty"` + // seller_fee_paid is the amount of coins paid by the seller + // to the marketplace as a fee for facilitating the sale. + SellerFeePaid *v1beta1.Coin `protobuf:"bytes,3,opt,name=seller_fee_paid,json=sellerFeePaid,proto3" json:"seller_fee_paid,omitempty"` + // buyer is the address of the account that purchased the credits. + Buyer string `protobuf:"bytes,4,opt,name=buyer,proto3" json:"buyer,omitempty"` + // buyer_fee_paid is the amount of coins paid by the buyer + // to the marketplace as a fee for facilitating the sale. + BuyerFeePaid *v1beta1.Coin `protobuf:"bytes,5,opt,name=buyer_fee_paid,json=buyerFeePaid,proto3" json:"buyer_fee_paid,omitempty"` } func (x *EventBuyDirect) Reset() { @@ -2556,6 +2853,34 @@ func (x *EventBuyDirect) GetSellOrderId() uint64 { return 0 } +func (x *EventBuyDirect) GetSeller() string { + if x != nil { + return x.Seller + } + return "" +} + +func (x *EventBuyDirect) GetSellerFeePaid() *v1beta1.Coin { + if x != nil { + return x.SellerFeePaid + } + return nil +} + +func (x *EventBuyDirect) GetBuyer() string { + if x != nil { + return x.Buyer + } + return "" +} + +func (x *EventBuyDirect) GetBuyerFeePaid() *v1beta1.Coin { + if x != nil { + return x.BuyerFeePaid + } + return nil +} + // EventUpdateSellOrder is an event emitted when a sell order is updated. type EventUpdateSellOrder struct { state protoimpl.MessageState @@ -2718,46 +3043,59 @@ var file_regen_ecocredit_marketplace_v1_events_proto_rawDesc = []byte{ 0x74, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x2f, 0x0a, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x6c, 0x6c, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x34, - 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, - 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, - 0x65, 0x72, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0d, - 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, - 0x22, 0x3a, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, - 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, - 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0f, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, - 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x2f, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, - 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0xa4, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x72, - 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x56, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6c, 0x65, 0x64, - 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, - 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x4d, 0xaa, 0x02, 0x1e, 0x52, 0x65, 0x67, - 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x4d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1e, 0x52, 0x65, - 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x4d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2a, 0x52, - 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x21, 0x52, 0x65, 0x67, 0x65, - 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x4d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0xe6, + 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x41, 0x0a, + 0x0f, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x52, 0x0d, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x0e, 0x62, 0x75, 0x79, 0x65, 0x72, 0x5f, + 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0c, 0x62, 0x75, 0x79, 0x65, 0x72, + 0x46, 0x65, 0x65, 0x50, 0x61, 0x69, 0x64, 0x22, 0x3a, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x73, + 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, + 0x27, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x2f, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, + 0x6e, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0xa4, 0x02, 0x0a, 0x22, 0x63, 0x6f, + 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x4d, 0xaa, 0x02, 0x1e, + 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, + 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x2a, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x21, 0x52, + 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, + 0x3a, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2780,13 +3118,16 @@ var file_regen_ecocredit_marketplace_v1_events_proto_goTypes = []interface{}{ (*EventCancelSellOrder)(nil), // 3: regen.ecocredit.marketplace.v1.EventCancelSellOrder (*EventAllowDenom)(nil), // 4: regen.ecocredit.marketplace.v1.EventAllowDenom (*EventRemoveAllowedDenom)(nil), // 5: regen.ecocredit.marketplace.v1.EventRemoveAllowedDenom + (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin } var file_regen_ecocredit_marketplace_v1_events_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 6, // 0: regen.ecocredit.marketplace.v1.EventBuyDirect.seller_fee_paid:type_name -> cosmos.base.v1beta1.Coin + 6, // 1: regen.ecocredit.marketplace.v1.EventBuyDirect.buyer_fee_paid:type_name -> cosmos.base.v1beta1.Coin + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_regen_ecocredit_marketplace_v1_events_proto_init() } diff --git a/api/regen/ecocredit/marketplace/v1/tx.pulsar.go b/api/regen/ecocredit/marketplace/v1/tx.pulsar.go index 48f16558e4..87993b8a52 100644 --- a/api/regen/ecocredit/marketplace/v1/tx.pulsar.go +++ b/api/regen/ecocredit/marketplace/v1/tx.pulsar.go @@ -3,7 +3,6 @@ package marketplacev1 import ( fmt "fmt" - _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/v1beta1" _ "github.com/cosmos/cosmos-sdk/api/cosmos/msg/v1" @@ -603,7 +602,7 @@ func (x *MsgSell_Order) ProtoReflect() protoreflect.Message { } func (x *MsgSell_Order) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[14] + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2393,7 +2392,7 @@ func (x *MsgUpdateSellOrders_Update) ProtoReflect() protoreflect.Message { } func (x *MsgUpdateSellOrders_Update) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[15] + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4815,7 +4814,7 @@ func (x *MsgBuyDirect_Order) ProtoReflect() protoreflect.Message { } func (x *MsgBuyDirect_Order) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[16] + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4907,8 +4906,8 @@ func (x *fastReflection_MsgBuyDirect_Order) Range(f func(protoreflect.FieldDescr return } } - if x.MaxFeeAmount != "" { - value := protoreflect.ValueOfString(x.MaxFeeAmount) + if x.MaxFeeAmount != nil { + value := protoreflect.ValueOfMessage(x.MaxFeeAmount.ProtoReflect()) if !f(fd_MsgBuyDirect_Order_max_fee_amount, value) { return } @@ -4941,7 +4940,7 @@ func (x *fastReflection_MsgBuyDirect_Order) Has(fd protoreflect.FieldDescriptor) case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.retirement_reason": return x.RetirementReason != "" case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.max_fee_amount": - return x.MaxFeeAmount != "" + return x.MaxFeeAmount != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order")) @@ -4971,7 +4970,7 @@ func (x *fastReflection_MsgBuyDirect_Order) Clear(fd protoreflect.FieldDescripto case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.retirement_reason": x.RetirementReason = "" case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.max_fee_amount": - x.MaxFeeAmount = "" + x.MaxFeeAmount = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order")) @@ -5008,7 +5007,7 @@ func (x *fastReflection_MsgBuyDirect_Order) Get(descriptor protoreflect.FieldDes return protoreflect.ValueOfString(value) case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.max_fee_amount": value := x.MaxFeeAmount - return protoreflect.ValueOfString(value) + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order")) @@ -5042,7 +5041,7 @@ func (x *fastReflection_MsgBuyDirect_Order) Set(fd protoreflect.FieldDescriptor, case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.retirement_reason": x.RetirementReason = value.Interface().(string) case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.max_fee_amount": - x.MaxFeeAmount = value.Interface().(string) + x.MaxFeeAmount = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order")) @@ -5068,6 +5067,11 @@ func (x *fastReflection_MsgBuyDirect_Order) Mutable(fd protoreflect.FieldDescrip x.BidPrice = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.BidPrice.ProtoReflect()) + case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.max_fee_amount": + if x.MaxFeeAmount == nil { + x.MaxFeeAmount = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.MaxFeeAmount.ProtoReflect()) case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.sell_order_id": panic(fmt.Errorf("field sell_order_id of message regen.ecocredit.marketplace.v1.MsgBuyDirect.Order is not mutable")) case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.quantity": @@ -5078,8 +5082,6 @@ func (x *fastReflection_MsgBuyDirect_Order) Mutable(fd protoreflect.FieldDescrip panic(fmt.Errorf("field retirement_jurisdiction of message regen.ecocredit.marketplace.v1.MsgBuyDirect.Order is not mutable")) case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.retirement_reason": panic(fmt.Errorf("field retirement_reason of message regen.ecocredit.marketplace.v1.MsgBuyDirect.Order is not mutable")) - case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.max_fee_amount": - panic(fmt.Errorf("field max_fee_amount of message regen.ecocredit.marketplace.v1.MsgBuyDirect.Order is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order")) @@ -5107,7 +5109,8 @@ func (x *fastReflection_MsgBuyDirect_Order) NewField(fd protoreflect.FieldDescri case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.retirement_reason": return protoreflect.ValueOfString("") case "regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.max_fee_amount": - return protoreflect.ValueOfString("") + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order")) @@ -5199,8 +5202,8 @@ func (x *fastReflection_MsgBuyDirect_Order) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.MaxFeeAmount) - if l > 0 { + if x.MaxFeeAmount != nil { + l = options.Size(x.MaxFeeAmount) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -5232,10 +5235,17 @@ func (x *fastReflection_MsgBuyDirect_Order) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.MaxFeeAmount) > 0 { - i -= len(x.MaxFeeAmount) - copy(dAtA[i:], x.MaxFeeAmount) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxFeeAmount))) + if x.MaxFeeAmount != nil { + encoded, err := options.Marshal(x.MaxFeeAmount) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0x42 } @@ -5513,7 +5523,7 @@ func (x *fastReflection_MsgBuyDirect_Order) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxFeeAmount", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -5523,23 +5533,27 @@ func (x *fastReflection_MsgBuyDirect_Order) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.MaxFeeAmount = string(dAtA[iNdEx:postIndex]) + if x.MaxFeeAmount == nil { + x.MaxFeeAmount = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MaxFeeAmount); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex default: iNdEx = preIndex @@ -8579,199 +8593,1177 @@ func (x *fastReflection_MsgGovSetFeeParamsResponse) ProtoMethods() *protoiface.M } } -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: regen/ecocredit/marketplace/v1/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) -) - -// MsgSell is the Msg/Sell request type. -type MsgSell struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +var _ protoreflect.List = (*_MsgGovSendFromFeePool_3_list)(nil) - // seller is the address of the account that is selling credits. - Seller string `protobuf:"bytes,1,opt,name=seller,proto3" json:"seller,omitempty"` - // orders are the sell orders being created. - Orders []*MsgSell_Order `protobuf:"bytes,2,rep,name=orders,proto3" json:"orders,omitempty"` +type _MsgGovSendFromFeePool_3_list struct { + list *[]*v1beta1.Coin } -func (x *MsgSell) Reset() { - *x = MsgSell{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *_MsgGovSendFromFeePool_3_list) Len() int { + if x.list == nil { + return 0 } + return len(*x.list) } -func (x *MsgSell) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *_MsgGovSendFromFeePool_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (*MsgSell) ProtoMessage() {} - -// Deprecated: Use MsgSell.ProtoReflect.Descriptor instead. -func (*MsgSell) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{0} +func (x *_MsgGovSendFromFeePool_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue } -func (x *MsgSell) GetSeller() string { - if x != nil { - return x.Seller - } - return "" +func (x *_MsgGovSendFromFeePool_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) } -func (x *MsgSell) GetOrders() []*MsgSell_Order { - if x != nil { - return x.Orders - } - return nil +func (x *_MsgGovSendFromFeePool_3_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) } -// MsgSellResponse is the Msg/Sell response type. -type MsgSellResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // sell_order_ids are the sell order IDs of the newly created sell orders. - SellOrderIds []uint64 `protobuf:"varint,1,rep,packed,name=sell_order_ids,json=sellOrderIds,proto3" json:"sell_order_ids,omitempty"` +func (x *_MsgGovSendFromFeePool_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] } -func (x *MsgSellResponse) Reset() { - *x = MsgSellResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (x *_MsgGovSendFromFeePool_3_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *MsgSellResponse) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *_MsgGovSendFromFeePool_3_list) IsValid() bool { + return x.list != nil } -func (*MsgSellResponse) ProtoMessage() {} +var ( + md_MsgGovSendFromFeePool protoreflect.MessageDescriptor + fd_MsgGovSendFromFeePool_authority protoreflect.FieldDescriptor + fd_MsgGovSendFromFeePool_recipient protoreflect.FieldDescriptor + fd_MsgGovSendFromFeePool_coins protoreflect.FieldDescriptor +) -// Deprecated: Use MsgSellResponse.ProtoReflect.Descriptor instead. -func (*MsgSellResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{1} +func init() { + file_regen_ecocredit_marketplace_v1_tx_proto_init() + md_MsgGovSendFromFeePool = File_regen_ecocredit_marketplace_v1_tx_proto.Messages().ByName("MsgGovSendFromFeePool") + fd_MsgGovSendFromFeePool_authority = md_MsgGovSendFromFeePool.Fields().ByName("authority") + fd_MsgGovSendFromFeePool_recipient = md_MsgGovSendFromFeePool.Fields().ByName("recipient") + fd_MsgGovSendFromFeePool_coins = md_MsgGovSendFromFeePool.Fields().ByName("coins") } -func (x *MsgSellResponse) GetSellOrderIds() []uint64 { - if x != nil { - return x.SellOrderIds - } - return nil -} +var _ protoreflect.Message = (*fastReflection_MsgGovSendFromFeePool)(nil) -// MsgUpdateSellOrders is the Msg/UpdateSellOrders request type. -type MsgUpdateSellOrders struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +type fastReflection_MsgGovSendFromFeePool MsgGovSendFromFeePool - // seller is the address of the account that is selling credits. - Seller string `protobuf:"bytes,1,opt,name=seller,proto3" json:"seller,omitempty"` - // updates are updates to existing sell orders. - Updates []*MsgUpdateSellOrders_Update `protobuf:"bytes,2,rep,name=updates,proto3" json:"updates,omitempty"` +func (x *MsgGovSendFromFeePool) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgGovSendFromFeePool)(x) } -func (x *MsgUpdateSellOrders) Reset() { - *x = MsgUpdateSellOrders{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[2] +func (x *MsgGovSendFromFeePool) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } + return mi.MessageOf(x) } -func (x *MsgUpdateSellOrders) String() string { - return protoimpl.X.MessageStringOf(x) -} +var _fastReflection_MsgGovSendFromFeePool_messageType fastReflection_MsgGovSendFromFeePool_messageType +var _ protoreflect.MessageType = fastReflection_MsgGovSendFromFeePool_messageType{} -func (*MsgUpdateSellOrders) ProtoMessage() {} +type fastReflection_MsgGovSendFromFeePool_messageType struct{} -// Deprecated: Use MsgUpdateSellOrders.ProtoReflect.Descriptor instead. -func (*MsgUpdateSellOrders) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{2} +func (x fastReflection_MsgGovSendFromFeePool_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgGovSendFromFeePool)(nil) } - -func (x *MsgUpdateSellOrders) GetSeller() string { - if x != nil { - return x.Seller - } - return "" +func (x fastReflection_MsgGovSendFromFeePool_messageType) New() protoreflect.Message { + return new(fastReflection_MsgGovSendFromFeePool) } - -func (x *MsgUpdateSellOrders) GetUpdates() []*MsgUpdateSellOrders_Update { - if x != nil { - return x.Updates - } - return nil +func (x fastReflection_MsgGovSendFromFeePool_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgGovSendFromFeePool } -// MsgUpdateSellOrdersResponse is the Msg/UpdateSellOrders response type. -type MsgUpdateSellOrdersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgGovSendFromFeePool) Descriptor() protoreflect.MessageDescriptor { + return md_MsgGovSendFromFeePool } -func (x *MsgUpdateSellOrdersResponse) Reset() { - *x = MsgUpdateSellOrdersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[3] - 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_MsgGovSendFromFeePool) Type() protoreflect.MessageType { + return _fastReflection_MsgGovSendFromFeePool_messageType } -func (x *MsgUpdateSellOrdersResponse) String() string { - return protoimpl.X.MessageStringOf(x) +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgGovSendFromFeePool) New() protoreflect.Message { + return new(fastReflection_MsgGovSendFromFeePool) } -func (*MsgUpdateSellOrdersResponse) ProtoMessage() {} - -// Deprecated: Use MsgUpdateSellOrdersResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateSellOrdersResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{3} +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgGovSendFromFeePool) Interface() protoreflect.ProtoMessage { + return (*MsgGovSendFromFeePool)(x) } -// MsgCancelSellOrder is the Msg/CancelSellOrder request type. -type MsgCancelSellOrder struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // seller is the address of the account that created the sell order and is - // therefore authorized to cancel the sell order. - Seller string `protobuf:"bytes,1,opt,name=seller,proto3" json:"seller,omitempty"` - // sell_order_id is the id of the seller order to cancel. - SellOrderId uint64 `protobuf:"varint,2,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` +// 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_MsgGovSendFromFeePool) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgGovSendFromFeePool_authority, value) { + return + } + } + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_MsgGovSendFromFeePool_recipient, value) { + return + } + } + if len(x.Coins) != 0 { + value := protoreflect.ValueOfList(&_MsgGovSendFromFeePool_3_list{list: &x.Coins}) + if !f(fd_MsgGovSendFromFeePool_coins, value) { + return + } + } } -func (x *MsgCancelSellOrder) Reset() { - *x = MsgCancelSellOrder{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +// 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_MsgGovSendFromFeePool) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.authority": + return x.Authority != "" + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.recipient": + return x.Recipient != "" + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.coins": + return len(x.Coins) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool does not contain field %s", fd.FullName())) } } -func (x *MsgCancelSellOrder) String() string { - return protoimpl.X.MessageStringOf(x) +// 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_MsgGovSendFromFeePool) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.authority": + x.Authority = "" + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.recipient": + x.Recipient = "" + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.coins": + x.Coins = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool 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_MsgGovSendFromFeePool) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.coins": + if len(x.Coins) == 0 { + return protoreflect.ValueOfList(&_MsgGovSendFromFeePool_3_list{}) + } + listValue := &_MsgGovSendFromFeePool_3_list{list: &x.Coins} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool 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_MsgGovSendFromFeePool) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.authority": + x.Authority = value.Interface().(string) + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.recipient": + x.Recipient = value.Interface().(string) + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.coins": + lv := value.List() + clv := lv.(*_MsgGovSendFromFeePool_3_list) + x.Coins = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool 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_MsgGovSendFromFeePool) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.coins": + if x.Coins == nil { + x.Coins = []*v1beta1.Coin{} + } + value := &_MsgGovSendFromFeePool_3_list{list: &x.Coins} + return protoreflect.ValueOfList(value) + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.authority": + panic(fmt.Errorf("field authority of message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool is not mutable")) + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.recipient": + panic(fmt.Errorf("field recipient of message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool 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_MsgGovSendFromFeePool) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.authority": + return protoreflect.ValueOfString("") + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.recipient": + return protoreflect.ValueOfString("") + case "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.coins": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgGovSendFromFeePool_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool 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_MsgGovSendFromFeePool) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool", 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_MsgGovSendFromFeePool) 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_MsgGovSendFromFeePool) 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_MsgGovSendFromFeePool) 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_MsgGovSendFromFeePool) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgGovSendFromFeePool) + 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.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Recipient) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Coins) > 0 { + for _, e := range x.Coins { + l = options.Size(e) + 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().(*MsgGovSendFromFeePool) + 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.Coins) > 0 { + for iNdEx := len(x.Coins) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Coins[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgGovSendFromFeePool) + 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: MsgGovSendFromFeePool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgGovSendFromFeePool: 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 Authority", 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.Authority = 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 Recipient", 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.Recipient = 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 Coins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Coins = append(x.Coins, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Coins[len(x.Coins)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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_MsgGovSendFromFeePoolResponse protoreflect.MessageDescriptor +) + +func init() { + file_regen_ecocredit_marketplace_v1_tx_proto_init() + md_MsgGovSendFromFeePoolResponse = File_regen_ecocredit_marketplace_v1_tx_proto.Messages().ByName("MsgGovSendFromFeePoolResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgGovSendFromFeePoolResponse)(nil) + +type fastReflection_MsgGovSendFromFeePoolResponse MsgGovSendFromFeePoolResponse + +func (x *MsgGovSendFromFeePoolResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgGovSendFromFeePoolResponse)(x) +} + +func (x *MsgGovSendFromFeePoolResponse) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[15] + 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_MsgGovSendFromFeePoolResponse_messageType fastReflection_MsgGovSendFromFeePoolResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgGovSendFromFeePoolResponse_messageType{} + +type fastReflection_MsgGovSendFromFeePoolResponse_messageType struct{} + +func (x fastReflection_MsgGovSendFromFeePoolResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgGovSendFromFeePoolResponse)(nil) +} +func (x fastReflection_MsgGovSendFromFeePoolResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgGovSendFromFeePoolResponse) +} +func (x fastReflection_MsgGovSendFromFeePoolResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgGovSendFromFeePoolResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgGovSendFromFeePoolResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgGovSendFromFeePoolResponse +} + +// 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_MsgGovSendFromFeePoolResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgGovSendFromFeePoolResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgGovSendFromFeePoolResponse) New() protoreflect.Message { + return new(fastReflection_MsgGovSendFromFeePoolResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgGovSendFromFeePoolResponse) Interface() protoreflect.ProtoMessage { + return (*MsgGovSendFromFeePoolResponse)(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_MsgGovSendFromFeePoolResponse) 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_MsgGovSendFromFeePoolResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse 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_MsgGovSendFromFeePoolResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse 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_MsgGovSendFromFeePoolResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse 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_MsgGovSendFromFeePoolResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse 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_MsgGovSendFromFeePoolResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse 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_MsgGovSendFromFeePoolResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse 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_MsgGovSendFromFeePoolResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse", 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_MsgGovSendFromFeePoolResponse) 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_MsgGovSendFromFeePoolResponse) 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_MsgGovSendFromFeePoolResponse) 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_MsgGovSendFromFeePoolResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgGovSendFromFeePoolResponse) + 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().(*MsgGovSendFromFeePoolResponse) + 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().(*MsgGovSendFromFeePoolResponse) + 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: MsgGovSendFromFeePoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgGovSendFromFeePoolResponse: 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: regen/ecocredit/marketplace/v1/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) +) + +// MsgSell is the Msg/Sell request type. +type MsgSell struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // seller is the address of the account that is selling credits. + Seller string `protobuf:"bytes,1,opt,name=seller,proto3" json:"seller,omitempty"` + // orders are the sell orders being created. + Orders []*MsgSell_Order `protobuf:"bytes,2,rep,name=orders,proto3" json:"orders,omitempty"` +} + +func (x *MsgSell) Reset() { + *x = MsgSell{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSell) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSell) ProtoMessage() {} + +// Deprecated: Use MsgSell.ProtoReflect.Descriptor instead. +func (*MsgSell) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgSell) GetSeller() string { + if x != nil { + return x.Seller + } + return "" +} + +func (x *MsgSell) GetOrders() []*MsgSell_Order { + if x != nil { + return x.Orders + } + return nil +} + +// MsgSellResponse is the Msg/Sell response type. +type MsgSellResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // sell_order_ids are the sell order IDs of the newly created sell orders. + SellOrderIds []uint64 `protobuf:"varint,1,rep,packed,name=sell_order_ids,json=sellOrderIds,proto3" json:"sell_order_ids,omitempty"` +} + +func (x *MsgSellResponse) Reset() { + *x = MsgSellResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSellResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSellResponse) ProtoMessage() {} + +// Deprecated: Use MsgSellResponse.ProtoReflect.Descriptor instead. +func (*MsgSellResponse) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgSellResponse) GetSellOrderIds() []uint64 { + if x != nil { + return x.SellOrderIds + } + return nil +} + +// MsgUpdateSellOrders is the Msg/UpdateSellOrders request type. +type MsgUpdateSellOrders struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // seller is the address of the account that is selling credits. + Seller string `protobuf:"bytes,1,opt,name=seller,proto3" json:"seller,omitempty"` + // updates are updates to existing sell orders. + Updates []*MsgUpdateSellOrders_Update `protobuf:"bytes,2,rep,name=updates,proto3" json:"updates,omitempty"` +} + +func (x *MsgUpdateSellOrders) Reset() { + *x = MsgUpdateSellOrders{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateSellOrders) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateSellOrders) ProtoMessage() {} + +// Deprecated: Use MsgUpdateSellOrders.ProtoReflect.Descriptor instead. +func (*MsgUpdateSellOrders) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgUpdateSellOrders) GetSeller() string { + if x != nil { + return x.Seller + } + return "" +} + +func (x *MsgUpdateSellOrders) GetUpdates() []*MsgUpdateSellOrders_Update { + if x != nil { + return x.Updates + } + return nil +} + +// MsgUpdateSellOrdersResponse is the Msg/UpdateSellOrders response type. +type MsgUpdateSellOrdersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateSellOrdersResponse) Reset() { + *x = MsgUpdateSellOrdersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateSellOrdersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateSellOrdersResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateSellOrdersResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateSellOrdersResponse) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{3} +} + +// MsgCancelSellOrder is the Msg/CancelSellOrder request type. +type MsgCancelSellOrder struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // seller is the address of the account that created the sell order and is + // therefore authorized to cancel the sell order. + Seller string `protobuf:"bytes,1,opt,name=seller,proto3" json:"seller,omitempty"` + // sell_order_id is the id of the seller order to cancel. + SellOrderId uint64 `protobuf:"varint,2,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` +} + +func (x *MsgCancelSellOrder) Reset() { + *x = MsgCancelSellOrder{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCancelSellOrder) String() string { + return protoimpl.X.MessageStringOf(x) } func (*MsgCancelSellOrder) ProtoMessage() {} @@ -9143,6 +10135,88 @@ func (*MsgGovSetFeeParamsResponse) Descriptor() ([]byte, []int) { return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{13} } +// MsgSendFromFeePool is the Msg/SendFromFeePool request type. +type MsgGovSendFromFeePool struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // recipient is the address of the account that will receive the funds. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + // coins is the amount of coins to send from the fee pool. + Coins []*v1beta1.Coin `protobuf:"bytes,3,rep,name=coins,proto3" json:"coins,omitempty"` +} + +func (x *MsgGovSendFromFeePool) Reset() { + *x = MsgGovSendFromFeePool{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgGovSendFromFeePool) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgGovSendFromFeePool) ProtoMessage() {} + +// Deprecated: Use MsgGovSendFromFeePool.ProtoReflect.Descriptor instead. +func (*MsgGovSendFromFeePool) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{14} +} + +func (x *MsgGovSendFromFeePool) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgGovSendFromFeePool) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +func (x *MsgGovSendFromFeePool) GetCoins() []*v1beta1.Coin { + if x != nil { + return x.Coins + } + return nil +} + +// MsgSendFromFeePoolResponse is the Msg/SendFromFeePool response type. +type MsgGovSendFromFeePoolResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgGovSendFromFeePoolResponse) Reset() { + *x = MsgGovSendFromFeePoolResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgGovSendFromFeePoolResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgGovSendFromFeePoolResponse) ProtoMessage() {} + +// Deprecated: Use MsgGovSendFromFeePoolResponse.ProtoReflect.Descriptor instead. +func (*MsgGovSendFromFeePoolResponse) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP(), []int{15} +} + // Order is the content of a new sell order. type MsgSell_Order struct { state protoimpl.MessageState @@ -9173,7 +10247,7 @@ type MsgSell_Order struct { func (x *MsgSell_Order) Reset() { *x = MsgSell_Order{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[14] + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9248,7 +10322,7 @@ type MsgUpdateSellOrders_Update struct { func (x *MsgUpdateSellOrders_Update) Reset() { *x = MsgUpdateSellOrders_Update{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[15] + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9330,19 +10404,16 @@ type MsgBuyDirect_Order struct { RetirementReason string `protobuf:"bytes,7,opt,name=retirement_reason,json=retirementReason,proto3" json:"retirement_reason,omitempty"` // max_fee_amount is the maximum amount of buyer side fees being paid to the marketplace. // If the marketplace fees end up being greater than this amount, the transaction will fail. - // If this field is left empty, the marketplace fees will be calculated based on the bid price - // and quantity and automatically deducted from the buyer's account. - // Fees are always paid in the same denomination as the bid price and max fee amount should - // be an integer value of that denom. + // Fees are always paid in the same denomination as the bid price. // // Since Revision 3 - MaxFeeAmount string `protobuf:"bytes,8,opt,name=max_fee_amount,json=maxFeeAmount,proto3" json:"max_fee_amount,omitempty"` + MaxFeeAmount *v1beta1.Coin `protobuf:"bytes,8,opt,name=max_fee_amount,json=maxFeeAmount,proto3" json:"max_fee_amount,omitempty"` } func (x *MsgBuyDirect_Order) Reset() { *x = MsgBuyDirect_Order{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[16] + mi := &file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9401,11 +10472,11 @@ func (x *MsgBuyDirect_Order) GetRetirementReason() string { return "" } -func (x *MsgBuyDirect_Order) GetMaxFeeAmount() string { +func (x *MsgBuyDirect_Order) GetMaxFeeAmount() *v1beta1.Coin { if x != nil { return x.MaxFeeAmount } - return "" + return nil } var File_regen_ecocredit_marketplace_v1_tx_proto protoreflect.FileDescriptor @@ -9419,103 +10490,102 @@ var file_regen_ecocredit_marketplace_v1_tx_proto_rawDesc = []byte{ 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, - 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xe6, 0x02, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, - 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x2e, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x1a, 0xee, 0x01, 0x0a, 0x05, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, 0x74, 0x63, - 0x68, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x52, 0x08, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x74, 0x69, 0x72, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x65, 0x78, - 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, - 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x0b, 0x82, 0xe7, - 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x37, 0x0a, 0x0f, 0x4d, 0x73, 0x67, - 0x53, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, - 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x04, 0x52, 0x0c, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, - 0x64, 0x73, 0x22, 0x9a, 0x03, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, - 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x54, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, - 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x1a, 0x87, 0x02, 0x0a, 0x06, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x71, - 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, - 0x65, 0x77, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x0d, 0x6e, 0x65, - 0x77, 0x5f, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0b, 0x6e, 0x65, - 0x77, 0x41, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, 0x47, 0x0a, 0x0e, 0x6e, 0x65, 0x77, - 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, - 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x77, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x22, - 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5d, - 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0d, - 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, - 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x1c, 0x0a, - 0x1a, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xca, 0x03, 0x0a, 0x0c, - 0x4d, 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x79, - 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, - 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x1a, 0xcb, - 0x02, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, - 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x09, 0x62, 0x69, 0x64, 0x5f, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x08, 0x62, 0x69, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, - 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x6f, - 0x5f, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, - 0x12, 0x37, 0x0a, 0x17, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6a, - 0x75, 0x72, 0x69, 0x73, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x16, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4a, 0x75, 0x72, - 0x69, 0x73, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x74, - 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, - 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, + 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, 0x02, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6c, + 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x06, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, + 0x6c, 0x6c, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, + 0x1a, 0xee, 0x01, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x71, + 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, + 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x73, 0x6b, 0x5f, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x08, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, + 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, + 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, + 0x40, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, + 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x37, + 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0c, 0x73, 0x65, 0x6c, 0x6c, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0x9a, 0x03, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x1a, 0x87, 0x02, + 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, + 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x6e, 0x65, 0x77, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, + 0x3d, 0x0a, 0x0d, 0x6e, 0x65, 0x77, 0x5f, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x41, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2e, + 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x72, + 0x65, 0x74, 0x69, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, 0x47, + 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x77, 0x45, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, + 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x5d, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6c, + 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6c, 0x6c, 0x65, + 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x49, 0x64, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6c, 0x6c, + 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, + 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xd5, 0x03, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, + 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x73, 0x1a, 0xd6, 0x02, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x22, 0x0a, + 0x0d, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, + 0x09, 0x62, 0x69, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x08, 0x62, 0x69, 0x64, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, + 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x17, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x72, 0x69, 0x73, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x4a, 0x75, 0x72, 0x69, 0x73, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, + 0x0a, 0x11, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x72, 0x65, 0x74, 0x69, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0e, 0x6d, + 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x22, 0x16, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, @@ -9548,81 +10618,104 @@ var file_regen_ecocredit_marketplace_v1_tx_proto_rawDesc = []byte{ 0x04, 0x66, 0x65, 0x65, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x47, 0x6f, 0x76, 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0xf8, 0x06, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x04, 0x53, - 0x65, 0x6c, 0x6c, 0x12, 0x27, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x1a, 0x2f, 0x2e, 0x72, + 0x6e, 0x73, 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x47, 0x6f, 0x76, 0x53, 0x65, + 0x6e, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x46, 0x65, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, + 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x0e, 0x82, 0xe7, + 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1f, 0x0a, 0x1d, + 0x4d, 0x73, 0x67, 0x47, 0x6f, 0x76, 0x53, 0x65, 0x6e, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x46, 0x65, + 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x85, 0x08, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x04, 0x53, 0x65, 0x6c, 0x6c, 0x12, 0x27, 0x2e, + 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x1a, 0x2f, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x33, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x84, 0x01, - 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x73, 0x12, 0x33, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x73, 0x1a, 0x3b, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, + 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, + 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, + 0x01, 0x0a, 0x0f, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x12, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, - 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x1a, 0x3b, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, - 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, - 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, - 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x1a, 0x3a, 0x2e, 0x72, - 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x09, 0x42, 0x75, 0x79, 0x44, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, - 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, - 0x65, 0x63, 0x74, 0x1a, 0x34, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x41, 0x64, - 0x64, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x32, 0x2e, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, 0x65, 0x6c, + 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x1a, 0x3a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x09, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, + 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x1a, 0x34, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x41, 0x64, 0x64, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, - 0x6d, 0x1a, 0x3a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01, - 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, - 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x35, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, - 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x3d, 0x2e, 0x72, 0x65, + 0x73, 0x67, 0x42, 0x75, 0x79, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x41, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, + 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x41, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x3a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, - 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x47, - 0x6f, 0x76, 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x32, + 0x41, 0x64, 0x64, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x35, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x47, 0x6f, 0x76, 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x1a, 0x3a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x6f, 0x76, 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa0, - 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, - 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, - 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x4d, 0xaa, 0x02, - 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x2a, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x21, - 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x3a, 0x3a, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, + 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x3d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x6f, 0x76, 0x53, 0x65, 0x74, 0x46, + 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x6f, 0x76, + 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x3a, 0x2e, 0x72, + 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x47, 0x6f, 0x76, 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x47, 0x6f, 0x76, + 0x53, 0x65, 0x6e, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x46, 0x65, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x12, + 0x35, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x6f, 0x76, 0x53, 0x65, 0x6e, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x46, + 0x65, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x3d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x6f, 0x76, 0x53, 0x65, + 0x6e, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x46, 0x65, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa0, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, + 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, + 0x69, 0x74, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x3b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x52, 0x45, 0x4d, 0xaa, 0x02, 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2a, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, + 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x21, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -9637,7 +10730,7 @@ func file_regen_ecocredit_marketplace_v1_tx_proto_rawDescGZIP() []byte { return file_regen_ecocredit_marketplace_v1_tx_proto_rawDescData } -var file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_regen_ecocredit_marketplace_v1_tx_proto_goTypes = []interface{}{ (*MsgSell)(nil), // 0: regen.ecocredit.marketplace.v1.MsgSell (*MsgSellResponse)(nil), // 1: regen.ecocredit.marketplace.v1.MsgSellResponse @@ -9653,42 +10746,48 @@ var file_regen_ecocredit_marketplace_v1_tx_proto_goTypes = []interface{}{ (*MsgRemoveAllowedDenomResponse)(nil), // 11: regen.ecocredit.marketplace.v1.MsgRemoveAllowedDenomResponse (*MsgGovSetFeeParams)(nil), // 12: regen.ecocredit.marketplace.v1.MsgGovSetFeeParams (*MsgGovSetFeeParamsResponse)(nil), // 13: regen.ecocredit.marketplace.v1.MsgGovSetFeeParamsResponse - (*MsgSell_Order)(nil), // 14: regen.ecocredit.marketplace.v1.MsgSell.Order - (*MsgUpdateSellOrders_Update)(nil), // 15: regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.Update - (*MsgBuyDirect_Order)(nil), // 16: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order - (*FeeParams)(nil), // 17: regen.ecocredit.marketplace.v1.FeeParams - (*v1beta1.Coin)(nil), // 18: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp + (*MsgGovSendFromFeePool)(nil), // 14: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool + (*MsgGovSendFromFeePoolResponse)(nil), // 15: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse + (*MsgSell_Order)(nil), // 16: regen.ecocredit.marketplace.v1.MsgSell.Order + (*MsgUpdateSellOrders_Update)(nil), // 17: regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.Update + (*MsgBuyDirect_Order)(nil), // 18: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order + (*FeeParams)(nil), // 19: regen.ecocredit.marketplace.v1.FeeParams + (*v1beta1.Coin)(nil), // 20: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp } var file_regen_ecocredit_marketplace_v1_tx_proto_depIdxs = []int32{ - 14, // 0: regen.ecocredit.marketplace.v1.MsgSell.orders:type_name -> regen.ecocredit.marketplace.v1.MsgSell.Order - 15, // 1: regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.updates:type_name -> regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.Update - 16, // 2: regen.ecocredit.marketplace.v1.MsgBuyDirect.orders:type_name -> regen.ecocredit.marketplace.v1.MsgBuyDirect.Order - 17, // 3: regen.ecocredit.marketplace.v1.MsgGovSetFeeParams.fees:type_name -> regen.ecocredit.marketplace.v1.FeeParams - 18, // 4: regen.ecocredit.marketplace.v1.MsgSell.Order.ask_price:type_name -> cosmos.base.v1beta1.Coin - 19, // 5: regen.ecocredit.marketplace.v1.MsgSell.Order.expiration:type_name -> google.protobuf.Timestamp - 18, // 6: regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.Update.new_ask_price:type_name -> cosmos.base.v1beta1.Coin - 19, // 7: regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.Update.new_expiration:type_name -> google.protobuf.Timestamp - 18, // 8: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.bid_price:type_name -> cosmos.base.v1beta1.Coin - 0, // 9: regen.ecocredit.marketplace.v1.Msg.Sell:input_type -> regen.ecocredit.marketplace.v1.MsgSell - 2, // 10: regen.ecocredit.marketplace.v1.Msg.UpdateSellOrders:input_type -> regen.ecocredit.marketplace.v1.MsgUpdateSellOrders - 4, // 11: regen.ecocredit.marketplace.v1.Msg.CancelSellOrder:input_type -> regen.ecocredit.marketplace.v1.MsgCancelSellOrder - 6, // 12: regen.ecocredit.marketplace.v1.Msg.BuyDirect:input_type -> regen.ecocredit.marketplace.v1.MsgBuyDirect - 8, // 13: regen.ecocredit.marketplace.v1.Msg.AddAllowedDenom:input_type -> regen.ecocredit.marketplace.v1.MsgAddAllowedDenom - 10, // 14: regen.ecocredit.marketplace.v1.Msg.RemoveAllowedDenom:input_type -> regen.ecocredit.marketplace.v1.MsgRemoveAllowedDenom - 12, // 15: regen.ecocredit.marketplace.v1.Msg.GovSetFeeParams:input_type -> regen.ecocredit.marketplace.v1.MsgGovSetFeeParams - 1, // 16: regen.ecocredit.marketplace.v1.Msg.Sell:output_type -> regen.ecocredit.marketplace.v1.MsgSellResponse - 3, // 17: regen.ecocredit.marketplace.v1.Msg.UpdateSellOrders:output_type -> regen.ecocredit.marketplace.v1.MsgUpdateSellOrdersResponse - 5, // 18: regen.ecocredit.marketplace.v1.Msg.CancelSellOrder:output_type -> regen.ecocredit.marketplace.v1.MsgCancelSellOrderResponse - 7, // 19: regen.ecocredit.marketplace.v1.Msg.BuyDirect:output_type -> regen.ecocredit.marketplace.v1.MsgBuyDirectResponse - 9, // 20: regen.ecocredit.marketplace.v1.Msg.AddAllowedDenom:output_type -> regen.ecocredit.marketplace.v1.MsgAddAllowedDenomResponse - 11, // 21: regen.ecocredit.marketplace.v1.Msg.RemoveAllowedDenom:output_type -> regen.ecocredit.marketplace.v1.MsgRemoveAllowedDenomResponse - 13, // 22: regen.ecocredit.marketplace.v1.Msg.GovSetFeeParams:output_type -> regen.ecocredit.marketplace.v1.MsgGovSetFeeParamsResponse - 16, // [16:23] is the sub-list for method output_type - 9, // [9:16] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 16, // 0: regen.ecocredit.marketplace.v1.MsgSell.orders:type_name -> regen.ecocredit.marketplace.v1.MsgSell.Order + 17, // 1: regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.updates:type_name -> regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.Update + 18, // 2: regen.ecocredit.marketplace.v1.MsgBuyDirect.orders:type_name -> regen.ecocredit.marketplace.v1.MsgBuyDirect.Order + 19, // 3: regen.ecocredit.marketplace.v1.MsgGovSetFeeParams.fees:type_name -> regen.ecocredit.marketplace.v1.FeeParams + 20, // 4: regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool.coins:type_name -> cosmos.base.v1beta1.Coin + 20, // 5: regen.ecocredit.marketplace.v1.MsgSell.Order.ask_price:type_name -> cosmos.base.v1beta1.Coin + 21, // 6: regen.ecocredit.marketplace.v1.MsgSell.Order.expiration:type_name -> google.protobuf.Timestamp + 20, // 7: regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.Update.new_ask_price:type_name -> cosmos.base.v1beta1.Coin + 21, // 8: regen.ecocredit.marketplace.v1.MsgUpdateSellOrders.Update.new_expiration:type_name -> google.protobuf.Timestamp + 20, // 9: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.bid_price:type_name -> cosmos.base.v1beta1.Coin + 20, // 10: regen.ecocredit.marketplace.v1.MsgBuyDirect.Order.max_fee_amount:type_name -> cosmos.base.v1beta1.Coin + 0, // 11: regen.ecocredit.marketplace.v1.Msg.Sell:input_type -> regen.ecocredit.marketplace.v1.MsgSell + 2, // 12: regen.ecocredit.marketplace.v1.Msg.UpdateSellOrders:input_type -> regen.ecocredit.marketplace.v1.MsgUpdateSellOrders + 4, // 13: regen.ecocredit.marketplace.v1.Msg.CancelSellOrder:input_type -> regen.ecocredit.marketplace.v1.MsgCancelSellOrder + 6, // 14: regen.ecocredit.marketplace.v1.Msg.BuyDirect:input_type -> regen.ecocredit.marketplace.v1.MsgBuyDirect + 8, // 15: regen.ecocredit.marketplace.v1.Msg.AddAllowedDenom:input_type -> regen.ecocredit.marketplace.v1.MsgAddAllowedDenom + 10, // 16: regen.ecocredit.marketplace.v1.Msg.RemoveAllowedDenom:input_type -> regen.ecocredit.marketplace.v1.MsgRemoveAllowedDenom + 12, // 17: regen.ecocredit.marketplace.v1.Msg.GovSetFeeParams:input_type -> regen.ecocredit.marketplace.v1.MsgGovSetFeeParams + 14, // 18: regen.ecocredit.marketplace.v1.Msg.GovSendFromFeePool:input_type -> regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool + 1, // 19: regen.ecocredit.marketplace.v1.Msg.Sell:output_type -> regen.ecocredit.marketplace.v1.MsgSellResponse + 3, // 20: regen.ecocredit.marketplace.v1.Msg.UpdateSellOrders:output_type -> regen.ecocredit.marketplace.v1.MsgUpdateSellOrdersResponse + 5, // 21: regen.ecocredit.marketplace.v1.Msg.CancelSellOrder:output_type -> regen.ecocredit.marketplace.v1.MsgCancelSellOrderResponse + 7, // 22: regen.ecocredit.marketplace.v1.Msg.BuyDirect:output_type -> regen.ecocredit.marketplace.v1.MsgBuyDirectResponse + 9, // 23: regen.ecocredit.marketplace.v1.Msg.AddAllowedDenom:output_type -> regen.ecocredit.marketplace.v1.MsgAddAllowedDenomResponse + 11, // 24: regen.ecocredit.marketplace.v1.Msg.RemoveAllowedDenom:output_type -> regen.ecocredit.marketplace.v1.MsgRemoveAllowedDenomResponse + 13, // 25: regen.ecocredit.marketplace.v1.Msg.GovSetFeeParams:output_type -> regen.ecocredit.marketplace.v1.MsgGovSetFeeParamsResponse + 15, // 26: regen.ecocredit.marketplace.v1.Msg.GovSendFromFeePool:output_type -> regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse + 19, // [19:27] is the sub-list for method output_type + 11, // [11:19] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_regen_ecocredit_marketplace_v1_tx_proto_init() } @@ -9867,7 +10966,7 @@ func file_regen_ecocredit_marketplace_v1_tx_proto_init() { } } file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgSell_Order); i { + switch v := v.(*MsgGovSendFromFeePool); i { case 0: return &v.state case 1: @@ -9879,7 +10978,7 @@ func file_regen_ecocredit_marketplace_v1_tx_proto_init() { } } file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateSellOrders_Update); i { + switch v := v.(*MsgGovSendFromFeePoolResponse); i { case 0: return &v.state case 1: @@ -9891,6 +10990,30 @@ func file_regen_ecocredit_marketplace_v1_tx_proto_init() { } } file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSell_Order); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateSellOrders_Update); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_regen_ecocredit_marketplace_v1_tx_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgBuyDirect_Order); i { case 0: return &v.state @@ -9909,7 +11032,7 @@ func file_regen_ecocredit_marketplace_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_regen_ecocredit_marketplace_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 17, + NumMessages: 19, NumExtensions: 0, NumServices: 1, }, diff --git a/api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go b/api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go index 627959b2c0..e1c1512e4a 100644 --- a/api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go +++ b/api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go @@ -26,6 +26,7 @@ const ( Msg_AddAllowedDenom_FullMethodName = "/regen.ecocredit.marketplace.v1.Msg/AddAllowedDenom" Msg_RemoveAllowedDenom_FullMethodName = "/regen.ecocredit.marketplace.v1.Msg/RemoveAllowedDenom" Msg_GovSetFeeParams_FullMethodName = "/regen.ecocredit.marketplace.v1.Msg/GovSetFeeParams" + Msg_GovSendFromFeePool_FullMethodName = "/regen.ecocredit.marketplace.v1.Msg/GovSendFromFeePool" ) // MsgClient is the client API for Msg service. @@ -53,6 +54,11 @@ type MsgClient interface { // // Since Revision 3 GovSetFeeParams(ctx context.Context, in *MsgGovSetFeeParams, opts ...grpc.CallOption) (*MsgGovSetFeeParamsResponse, error) + // GovSendFromFeePool is a governance method that allows the sending of the + // marketplace fees. + // + // Since Revision 3 + GovSendFromFeePool(ctx context.Context, in *MsgGovSendFromFeePool, opts ...grpc.CallOption) (*MsgGovSendFromFeePoolResponse, error) } type msgClient struct { @@ -126,6 +132,15 @@ func (c *msgClient) GovSetFeeParams(ctx context.Context, in *MsgGovSetFeeParams, return out, nil } +func (c *msgClient) GovSendFromFeePool(ctx context.Context, in *MsgGovSendFromFeePool, opts ...grpc.CallOption) (*MsgGovSendFromFeePoolResponse, error) { + out := new(MsgGovSendFromFeePoolResponse) + err := c.cc.Invoke(ctx, Msg_GovSendFromFeePool_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 @@ -151,6 +166,11 @@ type MsgServer interface { // // Since Revision 3 GovSetFeeParams(context.Context, *MsgGovSetFeeParams) (*MsgGovSetFeeParamsResponse, error) + // GovSendFromFeePool is a governance method that allows the sending of the + // marketplace fees. + // + // Since Revision 3 + GovSendFromFeePool(context.Context, *MsgGovSendFromFeePool) (*MsgGovSendFromFeePoolResponse, error) mustEmbedUnimplementedMsgServer() } @@ -179,6 +199,9 @@ func (UnimplementedMsgServer) RemoveAllowedDenom(context.Context, *MsgRemoveAllo func (UnimplementedMsgServer) GovSetFeeParams(context.Context, *MsgGovSetFeeParams) (*MsgGovSetFeeParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GovSetFeeParams not implemented") } +func (UnimplementedMsgServer) GovSendFromFeePool(context.Context, *MsgGovSendFromFeePool) (*MsgGovSendFromFeePoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovSendFromFeePool not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -318,6 +341,24 @@ func _Msg_GovSetFeeParams_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_GovSendFromFeePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGovSendFromFeePool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GovSendFromFeePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_GovSendFromFeePool_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GovSendFromFeePool(ctx, req.(*MsgGovSendFromFeePool)) + } + 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) @@ -353,6 +394,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "GovSetFeeParams", Handler: _Msg_GovSetFeeParams_Handler, }, + { + MethodName: "GovSendFromFeePool", + Handler: _Msg_GovSendFromFeePool_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "regen/ecocredit/marketplace/v1/tx.proto", diff --git a/app/app.go b/app/app.go index 166756d771..d3def5fee1 100644 --- a/app/app.go +++ b/app/app.go @@ -119,6 +119,7 @@ import ( datamodule "github.com/regen-network/regen-ledger/x/data/v3/module" "github.com/regen-network/regen-ledger/x/ecocredit/v3" baskettypes "github.com/regen-network/regen-ledger/x/ecocredit/v3/basket" + "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace" ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/v3/module" "github.com/regen-network/regen-ledger/x/intertx" intertxkeeper "github.com/regen-network/regen-ledger/x/intertx/keeper" @@ -191,6 +192,7 @@ var ( ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, ecocredit.ModuleName: {authtypes.Burner}, baskettypes.BasketSubModuleName: {authtypes.Burner, authtypes.Minter}, + marketplace.FeePoolName: {authtypes.Burner}, } return perms diff --git a/proto/regen/ecocredit/marketplace/v1/events.proto b/proto/regen/ecocredit/marketplace/v1/events.proto index e5d6023579..a629b1a01c 100644 --- a/proto/regen/ecocredit/marketplace/v1/events.proto +++ b/proto/regen/ecocredit/marketplace/v1/events.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package regen.ecocredit.marketplace.v1; +import "cosmos/base/v1beta1/coin.proto"; + option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/marketplace/types/v1"; // EventSell is an event emitted when a sell order is created. @@ -17,6 +19,20 @@ message EventBuyDirect { // sell_order_id is the unique identifier of the sell order that credits were // purchased from. uint64 sell_order_id = 1; + + // seller is the address of the account that sold the credits. + string seller = 2; + + // seller_fee_paid is the amount of coins paid by the seller + // to the marketplace as a fee for facilitating the sale. + cosmos.base.v1beta1.Coin seller_fee_paid = 3; + + // buyer is the address of the account that purchased the credits. + string buyer = 4; + + // buyer_fee_paid is the amount of coins paid by the buyer + // to the marketplace as a fee for facilitating the sale. + cosmos.base.v1beta1.Coin buyer_fee_paid = 5; } // EventUpdateSellOrder is an event emitted when a sell order is updated. diff --git a/proto/regen/ecocredit/marketplace/v1/tx.proto b/proto/regen/ecocredit/marketplace/v1/tx.proto index 62a1f1c657..d809f8b831 100644 --- a/proto/regen/ecocredit/marketplace/v1/tx.proto +++ b/proto/regen/ecocredit/marketplace/v1/tx.proto @@ -4,7 +4,6 @@ package regen.ecocredit.marketplace.v1; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; -import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "regen/ecocredit/marketplace/v1/state.proto"; @@ -44,6 +43,14 @@ service Msg { // Since Revision 3 rpc GovSetFeeParams(MsgGovSetFeeParams) returns (MsgGovSetFeeParamsResponse); + + // GovSendFromFeePool is a governance method that allows the sending of the + // marketplace fees. + // + // Since Revision 3 + rpc GovSendFromFeePool(MsgGovSendFromFeePool) + returns (MsgGovSendFromFeePoolResponse); + } // MsgSell is the Msg/Sell request type. @@ -185,13 +192,10 @@ message MsgBuyDirect { // max_fee_amount is the maximum amount of buyer side fees being paid to the marketplace. // If the marketplace fees end up being greater than this amount, the transaction will fail. - // If this field is left empty, the marketplace fees will be calculated based on the bid price - // and quantity and automatically deducted from the buyer's account. - // Fees are always paid in the same denomination as the bid price and max fee amount should - // be an integer value of that denom. + // Fees are always paid in the same denomination as the bid price. // // Since Revision 3 - string max_fee_amount = 8 [(cosmos_proto.scalar) = "cosmos.Int"]; + cosmos.base.v1beta1.Coin max_fee_amount = 8; } } @@ -255,3 +259,23 @@ message MsgGovSetFeeParams { // MsgSetFeeParamsResponse is the Msg/SetFeeParams response type. message MsgGovSetFeeParamsResponse {} + +// MsgSendFromFeePool is the Msg/SendFromFeePool request type. +message MsgGovSendFromFeePool { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1; + + // recipient is the address of the account that will receive the funds. + string recipient = 2; + + // coins is the amount of coins to send from the fee pool. + repeated cosmos.base.v1beta1.Coin coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgSendFromFeePoolResponse is the Msg/SendFromFeePool response type. +message MsgGovSendFromFeePoolResponse {} \ No newline at end of file diff --git a/x/ecocredit/marketplace/keeper/features/msg_buy_direct.feature b/x/ecocredit/marketplace/keeper/features/msg_buy_direct.feature index b6ad089613..ae755f06e1 100644 --- a/x/ecocredit/marketplace/keeper/features/msg_buy_direct.feature +++ b/x/ecocredit/marketplace/keeper/features/msg_buy_direct.feature @@ -51,7 +51,7 @@ Feature: Msg/BuyDirect Background: Given a credit type And alice created a sell order with ask denom "regen" - And bob has a bank balance with denom "regen" + And bob has bank balance "100regen" Scenario: bid denom matches sell denom When bob attempts to buy credits with bid denom "regen" @@ -68,35 +68,35 @@ Feature: Msg/BuyDirect Scenario Outline: buyer bank balance is greater than or equal to total cost (single buy order) Given alice created a sell order with quantity "10" and ask amount "10" - And bob has a bank balance with amount "" + And bob has bank balance "" When bob attempts to buy credits with quantity "10" and bid amount "10" Then expect no error Examples: | description | balance-amount | - | greater than | 200 | - | equal to | 100 | + | greater than | 200regen | + | equal to | 100regen | Scenario Outline: buyer bank balance is greater than or equal to total cost (multiple buy orders) Given alice created two sell orders each with quantity "10" and ask amount "10" - And bob has a bank balance with amount "" + And bob has bank balance "" When bob attempts to buy credits in two orders each with quantity "10" and bid amount "10" Then expect no error Examples: | description | balance-amount | - | greater than | 400 | - | equal to | 200 | + | greater than | 400regen | + | equal to | 200regen | Scenario: buyer bank balance is less than total cost (single buy order) Given alice created a sell order with quantity "10" and ask amount "10" - And bob has a bank balance with amount "50" + And bob has bank balance "50regen" When bob attempts to buy credits with quantity "10" and bid amount "10" Then expect the error "orders[0]: quantity: 10, ask price: 10regen, total price: 100regen, bank balance: 50regen: insufficient funds" Scenario: buyer bank balance is less than total cost (multiple buy orders) Given alice created two sell orders each with quantity "10" and ask amount "10" - And bob has a bank balance with amount "150" + And bob has bank balance "150regen" When bob attempts to buy credits in two orders each with quantity "10" and bid amount "10" Then expect the error "orders[1]: quantity: 10, ask price: 10regen, total price: 100regen, bank balance: 50regen: insufficient funds" @@ -105,7 +105,7 @@ Feature: Msg/BuyDirect Background: Given a credit type And alice created a sell order with ask amount "10" - And bob has a bank balance with amount "100" + And bob has bank balance "100regen" Scenario Outline: bid price greater than or equal to ask price When bob attempts to buy credits with quantity "10" and bid amount "" @@ -125,7 +125,7 @@ Feature: Msg/BuyDirect Background: Given a credit type And alice created a sell order with quantity "10" - And bob has a bank balance with amount "150" + And bob has bank balance "150regen" Scenario Outline: quantity less than or equal to sell order quantity When bob attempts to buy credits with quantity "" @@ -220,7 +220,7 @@ Feature: Msg/BuyDirect Scenario: buyer bank balance updated Given alice created a sell order with quantity "10" and ask price "10regen" - And bob has the bank balance "100regen" + And bob has bank balance "100regen" When bob attempts to buy credits with quantity "10" and bid price "10regen" Then expect bob bank balance "0regen" @@ -344,12 +344,15 @@ Feature: Msg/BuyDirect Background: Given a credit type And alice's address "regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68" + And alice has bank balance "100regen" And bob's address "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + And bob has bank balance "100regen" Scenario: EventTransfer is emitted Given alice created a sell order with id "1" When bob attempts to buy credits with quantity "10" - Then expect event transfer with properties + Then expect no error + And expect event transfer with properties """ { "sender": "regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68", @@ -363,7 +366,8 @@ Feature: Msg/BuyDirect Scenario: EventRetire is emitted Given alice created a sell order with id "1" When bob attempts to buy credits with sell order id "1" and retirement reason "offsetting electricity consumption" - Then expect event retire with properties + Then expect no error + And expect event retire with properties """ { "owner": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", @@ -376,9 +380,102 @@ Feature: Msg/BuyDirect Scenario: EventBuyDirect is emitted Given alice created a sell order with id "1" When bob attempts to buy credits with sell order id "1" - Then expect event buy direct with properties + Then expect no error + And expect event buy direct with properties + """ + { + "sell_order_id": 1, + "seller": "regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68", + "seller_fee_paid":{ + "amount": "0", + "denom": "regen" + }, + "buyer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "buyer_fee_paid":{ + "amount": "0", + "denom": "regen" + } + } + """ + + Rule: buyer fees are deducted from buyer, seller fees are deducted from seller, and both go to fee pool or get burned + Background: + Given a credit type + + Scenario: fees go to fee pool + Given alice's address "regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68" + * bob's address "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + * alice created a sell order with quantity "10" and ask price "10foo" + * bob has bank balance "110foo" + * alice has bank balance "0foo" + * buyer fees are 0.1 and seller fees are 0.05 + * bob sets a max fee of "10foo" + When bob attempts to buy credits with quantity "10" and bid price "10foo" + Then expect no error + * expect alice bank balance "95foo" + * expect bob bank balance "0foo" + * expect fee pool balance "15foo" + And expect event buy direct with properties """ { - "sell_order_id": 1 + "sell_order_id": 1, + "seller": "regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68", + "seller_fee_paid":{ + "amount": "5", + "denom": "foo" + }, + "buyer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "buyer_fee_paid":{ + "amount": "10", + "denom": "foo" + } } """ + + Scenario: fees get burned + Given alice's address "regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68" + * bob's address "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + * alice created a sell order with quantity "10" and ask price "20uregen" + * bob has bank balance "240uregen" + * alice has bank balance "0regen" + * buyer fees are 0.2 and seller fees are 0.1 + * bob sets a max fee of "40uregen" + When bob attempts to buy credits with quantity "10" and bid price "20uregen" + Then expect no error + * expect alice bank balance "180uregen" + * expect bob bank balance "0uregen" + * expect fee pool balance "0uregen" + And expect event buy direct with properties + """ + { + "sell_order_id": 1, + "seller": "regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68", + "seller_fee_paid":{ + "amount": "20", + "denom": "uregen" + }, + "buyer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "buyer_fee_paid":{ + "amount": "40", + "denom": "uregen" + } + } + """ + + Rule: max_fee_amount is enforced + Scenario Outline: max_fee_amount is enforced + Given a credit type + * alice created a sell order with quantity "10" and ask price "10foo" + * buyer fees are 0.2 and seller fees are 0.1 + * bob has bank balance "200foo" + * bob sets a max fee of "" + When bob attempts to buy credits with quantity "10" and bid price "20foo" + Then expect error contains "" + + Examples: + | max_fee_amount | error | + | 10foo | max fee | + | 20foo | | + | 30foo | | + + diff --git a/x/ecocredit/marketplace/keeper/features/msg_gov_send_from_fee_pool.feature b/x/ecocredit/marketplace/keeper/features/msg_gov_send_from_fee_pool.feature new file mode 100644 index 0000000000..928b533900 --- /dev/null +++ b/x/ecocredit/marketplace/keeper/features/msg_gov_send_from_fee_pool.feature @@ -0,0 +1,41 @@ +Feature: Msg/SendFromFeePool + + Background: + Given recipient "regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68" + + Rule: gov authority must be authorized + Scenario: gov authority is not authorized + Given authority is set to "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw" + When funds are sent + Then expect error contains "unauthorized" + + Scenario: gov authority is authorized + Given authority is set to the keeper authority + When funds are sent + Then expect no error + + Rule: the fee pool must have enough funds to cover the fee + Background: + Given authority is set to the keeper authority + + Scenario: fee pool is underfunded + Given fee pool balance "100foo" + And send amount "200foo" + When funds are sent + Then expect error contains "insufficient funds" + + Scenario: fee pool is well funded + Given fee pool balance "1000foo" + And send amount "200foo" + When funds are sent + Then expect no error + + Rule: funds are transferred from the fee pool to the recipient + Scenario: funds are transferred + Given authority is set to the keeper authority + Given fee pool balance "1000foo" + And send amount "200foo" + When funds are sent + Then expect no error + And fee pool balance "800foo" + And recipient balance "200foo" diff --git a/x/ecocredit/marketplace/keeper/features/msg_gov_set_fee_params.feature b/x/ecocredit/marketplace/keeper/features/msg_gov_set_fee_params.feature new file mode 100644 index 0000000000..69fa442615 --- /dev/null +++ b/x/ecocredit/marketplace/keeper/features/msg_gov_set_fee_params.feature @@ -0,0 +1,51 @@ +Feature: Msg/SetFeeParams + + Rule: gov authority must be authorized + Background: + Given fee params + """ + {} + """ + + Scenario: gov authority is not authorized + Given authority is set to "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw" + When fee params are set + Then expect error contains "unauthorized" + + Scenario: gov authority is authorized + Given authority is set to the keeper authority + When fee params are set + Then expect no error + + Rule: fee params get saved + Scenario: non-empty fee params + Given authority is set to the keeper authority + And fee params + """ + { + "buyer_percentage_fee": "0.01", + "seller_percentage_fee": "0.01" + } + """ + When fee params are set + Then expect no error + And expect fee params + """ + { + "buyer_percentage_fee": "0.01", + "seller_percentage_fee": "0.01" + } + """ + + Scenario: empty fee params + Given authority is set to the keeper authority + And fee params + """ + {} + """ + When fee params are set + Then expect no error + And expect fee params + """ + {} + """ diff --git a/x/ecocredit/marketplace/keeper/keeper.go b/x/ecocredit/marketplace/keeper/keeper.go index 107e49d6eb..41de8aed5c 100644 --- a/x/ecocredit/marketplace/keeper/keeper.go +++ b/x/ecocredit/marketplace/keeper/keeper.go @@ -6,6 +6,7 @@ import ( marketapi "github.com/regen-network/regen-ledger/api/v2/regen/ecocredit/marketplace/v1" baseapi "github.com/regen-network/regen-ledger/api/v2/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/x/ecocredit/v3" + "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace" types "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" ) @@ -15,18 +16,19 @@ var ( ) type Keeper struct { - stateStore marketapi.StateStore - baseStore baseapi.StateStore - bankKeeper ecocredit.BankKeeper - authority sdk.AccAddress + stateStore marketapi.StateStore + baseStore baseapi.StateStore + bankKeeper ecocredit.BankKeeper + authority sdk.AccAddress + feePoolName string } -func NewKeeper(ss marketapi.StateStore, cs baseapi.StateStore, bk ecocredit.BankKeeper, - authority sdk.AccAddress) Keeper { +func NewKeeper(ss marketapi.StateStore, cs baseapi.StateStore, bk ecocredit.BankKeeper, authority sdk.AccAddress) Keeper { return Keeper{ - baseStore: cs, - stateStore: ss, - bankKeeper: bk, - authority: authority, + baseStore: cs, + stateStore: ss, + bankKeeper: bk, + authority: authority, + feePoolName: marketplace.FeePoolName, } } diff --git a/x/ecocredit/marketplace/keeper/msg_buy_direct.go b/x/ecocredit/marketplace/keeper/msg_buy_direct.go index cd46e6bc72..5ba4b1d3e8 100644 --- a/x/ecocredit/marketplace/keeper/msg_buy_direct.go +++ b/x/ecocredit/marketplace/keeper/msg_buy_direct.go @@ -92,13 +92,38 @@ func (k Keeper) BuyDirect(ctx context.Context, req *types.MsgBuyDirect) (*types. ) } - // check address has the total cost (price per * order quantity) - buyerBalance := k.bankKeeper.GetBalance(sdkCtx, buyerAcc, order.BidPrice.Denom) - cost, err := getTotalCost(sellOrderAskAmount, buyQuantity) + // calc sub-total (price per * order quantity) + subtotal, err := getSubTotalCost(sellOrderAskAmount, buyQuantity) + if err != nil { + return nil, err + } + + // add buyer fees + feeParams, err := k.stateStore.FeeParamsTable().Get(ctx) if err != nil { return nil, err } - totalCost := sdk.Coin{Amount: cost, Denom: market.BankDenom} + total, buyerFee, err := getTotalCostAndBuyerFee(subtotal, feeParams) + if err != nil { + return nil, err + } + totalCost := sdk.Coin{Amount: total.SdkIntTrim(), Denom: market.BankDenom} + + // check max fee + maxFee := order.MaxFeeAmount + if maxFee == nil { + maxFee = &sdk.Coin{Amount: sdk.NewInt(0), Denom: market.BankDenom} + } + buyerFeeCoin := sdk.Coin{Amount: buyerFee.SdkIntTrim(), Denom: market.BankDenom} + if maxFee.IsLT(buyerFeeCoin) { + return nil, sdkerrors.ErrInvalidRequest.Wrapf( + "%s: max fee: %s, required fee: %s", + orderIndex, maxFee, buyerFeeCoin, + ) + } + + // check address has the total cost + buyerBalance := k.bankKeeper.GetBalance(sdkCtx, buyerAcc, order.BidPrice.Denom) if buyerBalance.IsLT(totalCost) { return nil, sdkerrors.ErrInsufficientFunds.Wrapf( "%s: quantity: %s, ask price: %s%s, total price: %v, bank balance: %v", @@ -113,17 +138,15 @@ func (k Keeper) BuyDirect(ctx context.Context, req *types.MsgBuyDirect) (*types. sellOrder: sellOrder, buyerAcc: buyerAcc, buyQuantity: buyQuantity, - totalCost: totalCost, + totalCost: total, + subTotalCost: subtotal, + buyerFee: buyerFee, autoRetire: !order.DisableAutoRetire, batchDenom: batch.Denom, + bankDenom: market.BankDenom, jurisdiction: order.RetirementJurisdiction, reason: order.RetirementReason, - }); err != nil { - return nil, err - } - - if err = sdkCtx.EventManager().EmitTypedEvent(&types.EventBuyDirect{ - SellOrderId: sellOrder.Id, + feeParams: feeParams, }); err != nil { return nil, err } diff --git a/x/ecocredit/marketplace/keeper/msg_buy_direct_test.go b/x/ecocredit/marketplace/keeper/msg_buy_direct_test.go index be003fad75..53014eea70 100644 --- a/x/ecocredit/marketplace/keeper/msg_buy_direct_test.go +++ b/x/ecocredit/marketplace/keeper/msg_buy_direct_test.go @@ -6,10 +6,17 @@ import ( "strconv" "testing" - sdkmath "cosmossdk.io/math" + "github.com/cockroachdb/apd/v3" "github.com/gogo/protobuf/jsonpb" + gogoproto "github.com/gogo/protobuf/proto" + "github.com/golang/mock/gomock" + "github.com/google/go-cmp/cmp" "github.com/regen-network/gocuke" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/testing/protocmp" "github.com/cosmos/cosmos-sdk/orm/types/ormerrors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,15 +26,16 @@ import ( "github.com/regen-network/regen-ledger/types/v2/math" "github.com/regen-network/regen-ledger/types/v2/testutil" basetypes "github.com/regen-network/regen-ledger/x/ecocredit/v3/base/types/v1" + "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace" types "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" ) type buyDirectSuite struct { *baseSuite alice sdk.AccAddress - aliceBankBalance sdk.Coin bob sdk.AccAddress - bobBankBalance sdk.Coin + balances map[string]sdk.Coins + moduleBalances map[string]sdk.Coins creditTypeAbbrev string classID string batchDenom string @@ -38,6 +46,7 @@ type buyDirectSuite struct { bidPrice sdk.Coin res *types.MsgBuyDirectResponse err error + maxFee *sdk.Coin } func TestBuyDirect(t *testing.T) { @@ -48,14 +57,16 @@ func (s *buyDirectSuite) Before(t gocuke.TestingT) { s.baseSuite = setupBase(t, 2) s.alice = s.addrs[0] s.bob = s.addrs[1] - s.aliceBankBalance = sdk.Coin{ + s.balances = map[string]sdk.Coins{} + s.balances[s.alice.String()] = sdk.Coins{sdk.Coin{ Denom: "regen", Amount: sdk.NewInt(100), - } - s.bobBankBalance = sdk.Coin{ + }} + s.balances[s.bob.String()] = sdk.Coins{sdk.Coin{ Denom: "regen", Amount: sdk.NewInt(100), - } + }} + s.moduleBalances = map[string]sdk.Coins{} s.creditTypeAbbrev = "C" s.classID = testClassID s.batchDenom = testBatchDenom @@ -69,6 +80,8 @@ func (s *buyDirectSuite) Before(t gocuke.TestingT) { Denom: "regen", Amount: sdk.NewInt(10), } + + s.buyOrderExpectCalls() } func (s *buyDirectSuite) ACreditType() { @@ -93,25 +106,14 @@ func (s *buyDirectSuite) AliceHasBankBalance(a string) { coin, err := sdk.ParseCoinNormalized(a) require.NoError(s.t, err) - s.aliceBankBalance = coin + s.balances[s.alice.String()] = sdk.Coins{coin} } -func (s *buyDirectSuite) BobHasTheBankBalance(a string) { +func (s *buyDirectSuite) BobHasBankBalance(a string) { coin, err := sdk.ParseCoinNormalized(a) require.NoError(s.t, err) - s.bobBankBalance = coin -} - -func (s *buyDirectSuite) BobHasABankBalanceWithDenom(a string) { - s.bobBankBalance = sdk.NewCoin(a, s.bobBankBalance.Amount) -} - -func (s *buyDirectSuite) BobHasABankBalanceWithAmount(a string) { - amount, ok := sdk.NewIntFromString(a) - require.True(s.t, ok) - - s.bobBankBalance = sdk.NewCoin(s.bidPrice.Denom, amount) + s.balances[s.bob.String()] = sdk.Coins{coin} } func (s *buyDirectSuite) AliceHasTheBatchBalance(a gocuke.DocString) { @@ -171,6 +173,11 @@ func (s *buyDirectSuite) BobsAddress(a string) { require.NoError(s.t, err) s.bob = addr } +func (s *buyDirectSuite) BobSetsAMaxFeeOf(a string) { + maxFee, err := sdk.ParseCoinNormalized(a) + require.NoError(s.t, err) + s.maxFee = &maxFee +} func (s *buyDirectSuite) AliceCreatedASellOrderWithId(a string) { id, err := strconv.ParseUint(a, 10, 32) @@ -255,8 +262,6 @@ func (s *buyDirectSuite) AliceAttemptsToBuyCreditsWithSellOrderId(a string) { id, err := strconv.ParseUint(a, 10, 32) require.NoError(s.t, err) - s.singleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.alice.String(), Orders: []*types.MsgBuyDirect_Order{ @@ -273,8 +278,6 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithSellOrderId(a string) { id, err := strconv.ParseUint(a, 10, 32) require.NoError(s.t, err) - s.singleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), Orders: []*types.MsgBuyDirect_Order{ @@ -291,7 +294,7 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithSellOrderIdAndRetirementReas id, err := strconv.ParseUint(a, 10, 32) require.NoError(s.t, err) - s.singleBuyOrderExpectCalls() + s.buyOrderExpectCalls() s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), @@ -307,8 +310,6 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithSellOrderIdAndRetirementReas } func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithBidDenom(a string) { - s.singleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), Orders: []*types.MsgBuyDirect_Order{ @@ -328,8 +329,6 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithDisableAutoRetire(a string) disableAutoRetire, err := strconv.ParseBool(a) require.NoError(s.t, err) - s.singleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), Orders: []*types.MsgBuyDirect_Order{ @@ -346,8 +345,6 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithDisableAutoRetire(a string) func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithQuantity(a string) { s.quantity = a - s.singleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), Orders: []*types.MsgBuyDirect_Order{ @@ -364,8 +361,6 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithQuantityAndBidAmount(a strin bidAmount, ok := sdk.NewIntFromString(b) require.True(s.t, ok) - s.singleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), Orders: []*types.MsgBuyDirect_Order{ @@ -385,15 +380,14 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithQuantityAndBidPrice(a string bidPrice, err := sdk.ParseCoinNormalized(b) require.NoError(s.t, err) - s.singleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), Orders: []*types.MsgBuyDirect_Order{ { - SellOrderId: s.sellOrderID, - Quantity: a, - BidPrice: &bidPrice, + SellOrderId: s.sellOrderID, + Quantity: a, + BidPrice: &bidPrice, + MaxFeeAmount: s.maxFee, }, }, }) @@ -403,8 +397,6 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsWithQuantityAndDisableAutoRetire disableAutoRetire, err := strconv.ParseBool(b) require.NoError(s.t, err) - s.singleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), Orders: []*types.MsgBuyDirect_Order{ @@ -424,8 +416,6 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsInTwoOrdersEachWithQuantityAndBi bidAmount, ok := sdk.NewIntFromString(b) require.True(s.t, ok) - s.multipleBuyOrderExpectCalls() - s.res, s.err = s.k.BuyDirect(s.ctx, &types.MsgBuyDirect{ Buyer: s.bob.String(), Orders: []*types.MsgBuyDirect_Order{ @@ -448,6 +438,13 @@ func (s *buyDirectSuite) BobAttemptsToBuyCreditsInTwoOrdersEachWithQuantityAndBi }, }) } +func (s *buyDirectSuite) BuyerFeesAreAndSellerFeesAre(buyerFee *apd.Decimal, sellerFee *apd.Decimal) { + err := s.k.stateStore.FeeParamsTable().Save(s.ctx, &api.FeeParams{ + BuyerPercentageFee: buyerFee.String(), + SellerPercentageFee: sellerFee.String(), + }) + require.NoError(s.t, err) +} func (s *buyDirectSuite) ExpectNoError() { require.NoError(s.t, s.err) @@ -457,6 +454,14 @@ func (s *buyDirectSuite) ExpectTheError(a string) { require.EqualError(s.t, s.err, a) } +func (s *buyDirectSuite) ExpectErrorContains(a string) { + if a == "" { + require.NoError(s.t, s.err) + } else { + require.ErrorContains(s.t, s.err, a) + } +} + func (s *buyDirectSuite) ExpectSellOrderWithId(a string) { id, err := strconv.ParseUint(a, 10, 32) require.NoError(s.t, err) @@ -483,19 +488,22 @@ func (s *buyDirectSuite) ExpectNoSellOrderWithId(a string) { } func (s *buyDirectSuite) ExpectAliceBankBalance(a string) { - bankBalance, err := sdk.ParseCoinNormalized(a) - require.NoError(s.t, err) - - require.Equal(s.t, bankBalance.Denom, s.aliceBankBalance.Denom) - require.Equal(s.t, bankBalance.Amount.String(), s.aliceBankBalance.Amount.String()) + s.expectBalance(s.alice, a) } func (s *buyDirectSuite) ExpectBobBankBalance(a string) { - bankBalance, err := sdk.ParseCoinNormalized(a) + s.expectBalance(s.bob, a) +} + +func (s *buyDirectSuite) expectBalance(address sdk.Address, a string) { + expected, err := sdk.ParseCoinsNormalized(a) require.NoError(s.t, err) - require.Equal(s.t, bankBalance.Denom, s.bobBankBalance.Denom) - require.Equal(s.t, bankBalance.Amount.String(), s.bobBankBalance.Amount.String()) + actual := s.balances[address.String()] + + if !actual.IsEqual(expected) { + s.t.Fatalf("expected: %s, actual: %s", a, actual.String()) + } } func (s *buyDirectSuite) ExpectAliceBatchBalance(a gocuke.DocString) { @@ -547,14 +555,30 @@ func (s *buyDirectSuite) ExpectBatchSupply(a gocuke.DocString) { func (s *buyDirectSuite) ExpectEventBuyDirectWithProperties(a gocuke.DocString) { var event types.EventBuyDirect - err := json.Unmarshal([]byte(a.Content), &event) + err := jsonpb.UnmarshalString(a.Content, &event) require.NoError(s.t, err) - sdkEvent, found := testutil.GetEvent(&event, s.sdkCtx.EventManager().Events()) + s.expectEvent(&event) +} + +func (s *buyDirectSuite) expectEvent(expected gogoproto.Message) { + sdkEvent, found := testutil.GetEvent(expected, s.sdkCtx.EventManager().Events()) require.True(s.t, found) - err = testutil.MatchEvent(&event, sdkEvent) + foundEvt, err := sdk.ParseTypedEvent(abci.Event(sdkEvent)) + require.NoError(s.t, err) + + msgType, err := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(gogoproto.MessageName(expected))) require.NoError(s.t, err) + evt := msgType.New().Interface() + evt2 := msgType.New().Interface() + + require.NoError(s.t, gogoToProtoReflect(foundEvt, evt)) + require.NoError(s.t, gogoToProtoReflect(expected, evt2)) + + if diff := cmp.Diff(evt, evt2, protocmp.Transform()); diff != "" { + s.t.Fatalf("unexpected event diff: %s", diff) + } } func (s *buyDirectSuite) ExpectEventTransferWithProperties(a gocuke.DocString) { @@ -581,6 +605,17 @@ func (s *buyDirectSuite) ExpectEventRetireWithProperties(a gocuke.DocString) { require.NoError(s.t, err) } +func (s *buyDirectSuite) ExpectFeePoolBalance(a string) { + expected, err := sdk.ParseCoinsNormalized(a) + require.NoError(s.t, err) + + actual := s.moduleBalances[marketplace.FeePoolName] + + if !actual.IsEqual(expected) { + s.t.Fatalf("expected: %s, actual: %s", a, actual.String()) + } +} + // count is the number of sell orders created func (s *buyDirectSuite) createSellOrders(count int) { totalQuantity := s.quantity @@ -644,58 +679,41 @@ func (s *buyDirectSuite) createSellOrders(count int) { } } -func (s *buyDirectSuite) singleBuyOrderExpectCalls() { - askTotal := s.calculateAskTotal(s.quantity, s.askPrice.Amount.String()) - sendCoin := sdk.NewCoin(s.askPrice.Denom, askTotal) - sendCoins := sdk.NewCoins(sendCoin) - +func (s *buyDirectSuite) buyOrderExpectCalls() { s.bankKeeper.EXPECT(). - GetBalance(s.sdkCtx, s.bob, s.bidPrice.Denom). - Return(s.bobBankBalance). + GetBalance(gomock.Any(), gomock.Any(), gomock.Any()). + DoAndReturn(func(_ sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin { + return sdk.Coin{Denom: denom, Amount: s.balances[addr.String()].AmountOf(denom)} + }). AnyTimes() // not expected on failed attempt s.bankKeeper.EXPECT(). - SendCoins(s.sdkCtx, s.bob, s.alice, sendCoins). - Do(func(sdk.Context, sdk.AccAddress, sdk.AccAddress, sdk.Coins) { - s.bobBankBalance = s.bobBankBalance.Sub(sendCoin) - s.aliceBankBalance = s.aliceBankBalance.Add(sendCoin) + SendCoins(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Do(func(_ sdk.Context, from, to sdk.AccAddress, amt sdk.Coins) { + s.balances[from.String()] = s.balances[from.String()].Sub(amt...) + s.balances[to.String()] = s.balances[to.String()].Add(amt...) }). AnyTimes() // not expected on failed attempt -} - -func (s *buyDirectSuite) multipleBuyOrderExpectCalls() { - askTotal := s.calculateAskTotal(s.quantity, s.askPrice.Amount.String()) - sendCoin := sdk.NewCoin(s.askPrice.Denom, askTotal) - sendCoins := sdk.NewCoins(sendCoin) s.bankKeeper.EXPECT(). - GetBalance(s.sdkCtx, s.bob, s.bidPrice.Denom). - Return(s.bobBankBalance). - Times(1) - - s.bankKeeper.EXPECT(). - GetBalance(s.sdkCtx, s.bob, s.bidPrice.Denom). - Return(s.bobBankBalance.Sub(sendCoin)). - Times(1) + SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Do(func(_ sdk.Context, from sdk.AccAddress, mod string, amt sdk.Coins) { + s.balances[from.String()] = s.balances[from.String()].Sub(amt...) + s.moduleBalances[mod] = s.moduleBalances[mod].Add(amt...) + }). + AnyTimes() s.bankKeeper.EXPECT(). - SendCoins(s.sdkCtx, s.bob, s.alice, sendCoins). - Do(func(sdk.Context, sdk.AccAddress, sdk.AccAddress, sdk.Coins) { - s.bobBankBalance = s.bobBankBalance.Sub(sendCoin) - s.aliceBankBalance = s.aliceBankBalance.Add(sendCoin) + SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Do(func(_ sdk.Context, mod string, to sdk.AccAddress, amt sdk.Coins) { + s.moduleBalances[mod] = s.moduleBalances[mod].Sub(amt...) + s.balances[to.String()] = s.balances[to.String()].Add(amt...) }). - AnyTimes() // not expected on failed attempt -} - -func (s *buyDirectSuite) calculateAskTotal(quantity string, amount string) sdkmath.Int { - q, err := math.NewDecFromString(quantity) - require.NoError(s.t, err) - - a, err := math.NewDecFromString(amount) - require.NoError(s.t, err) - - t, err := a.Mul(q) - require.NoError(s.t, err) + AnyTimes() - return t.SdkIntTrim() + s.bankKeeper.EXPECT(). + BurnCoins(gomock.Any(), gomock.Any(), gomock.Any()). + Do(func(_ sdk.Context, mod string, amt sdk.Coins) { + s.moduleBalances[mod] = s.moduleBalances[mod].Sub(amt...) + }).AnyTimes() } diff --git a/x/ecocredit/marketplace/keeper/msg_gov_send_from_fee_pool.go b/x/ecocredit/marketplace/keeper/msg_gov_send_from_fee_pool.go new file mode 100644 index 0000000000..39ccf792cc --- /dev/null +++ b/x/ecocredit/marketplace/keeper/msg_gov_send_from_fee_pool.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + types "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" +) + +func (k Keeper) GovSendFromFeePool(ctx context.Context, msg *types.MsgGovSendFromFeePool) (*types.MsgGovSendFromFeePoolResponse, error) { + authority, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + return nil, err + } + + if !authority.Equals(k.authority) { + return nil, sdkerrors.ErrUnauthorized + } + + recipient, err := sdk.AccAddressFromBech32(msg.Recipient) + if err != nil { + return nil, err + } + + err = k.bankKeeper.SendCoinsFromModuleToAccount(sdk.UnwrapSDKContext(ctx), k.feePoolName, recipient, msg.Coins) + if err != nil { + return nil, err + } + + return &types.MsgGovSendFromFeePoolResponse{}, nil +} diff --git a/x/ecocredit/marketplace/keeper/msg_gov_send_from_fee_pool_test.go b/x/ecocredit/marketplace/keeper/msg_gov_send_from_fee_pool_test.go new file mode 100644 index 0000000000..6ca51c2733 --- /dev/null +++ b/x/ecocredit/marketplace/keeper/msg_gov_send_from_fee_pool_test.go @@ -0,0 +1,103 @@ +package keeper + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/golang/mock/gomock" + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" + + types "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" +) + +type govSendFromFeePool struct { + *baseSuite + err error + msg *types.MsgGovSendFromFeePool + moduleBalances map[string]sdk.Coins + accountBalances map[string]sdk.Coins +} + +func TestGovSendFromFeePool(t *testing.T) { + gocuke.NewRunner(t, &govSendFromFeePool{}).Path("./features/msg_gov_send_from_fee_pool.feature").Run() +} + +func (s *govSendFromFeePool) Before(t gocuke.TestingT) { + s.baseSuite = setupBase(t, 2) + s.msg = &types.MsgGovSendFromFeePool{} + s.moduleBalances = make(map[string]sdk.Coins) + s.accountBalances = make(map[string]sdk.Coins) + s.bankKeeper.EXPECT(). + SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + AnyTimes(). + DoAndReturn(func(_ sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amount sdk.Coins) error { + newModBalance, neg := s.moduleBalances[senderModule].SafeSub(amount...) + if neg { + return sdkerrors.ErrInsufficientFunds + } + + s.moduleBalances[senderModule] = newModBalance + s.accountBalances[recipientAddr.String()] = s.accountBalances[recipientAddr.String()].Add(amount...) + return nil + }) +} + +func (s *govSendFromFeePool) AuthorityIsSetToTheKeeperAuthority() { + s.msg.Authority = s.k.authority.String() +} + +func (s *govSendFromFeePool) AuthorityIsSetTo(a string) { + s.msg.Authority = a +} + +func (s *govSendFromFeePool) Recipient(a string) { + s.msg.Recipient = a +} + +func (s *govSendFromFeePool) SendAmount(a string) { + coins, err := sdk.ParseCoinsNormalized(a) + require.NoError(s.t, err) + s.msg.Coins = coins +} + +func (s *govSendFromFeePool) FeePoolBalance(a string) { + coins, err := sdk.ParseCoinsNormalized(a) + require.NoError(s.t, err) + s.moduleBalances[s.k.feePoolName] = coins +} + +func (s *govSendFromFeePool) RecipientBalance(a string) { + coins, err := sdk.ParseCoinsNormalized(a) + require.NoError(s.t, err) + s.accountBalances[s.msg.Recipient] = coins +} + +func (s *govSendFromFeePool) FundsAreSent() { + _, s.err = s.k.GovSendFromFeePool(s.ctx, s.msg) +} + +func (s *govSendFromFeePool) ExpectErrorContains(a string) { + if s.err != nil { + require.ErrorContains(s.t, s.err, a) + } else { + require.NoError(s.t, s.err) + } +} + +func (s *govSendFromFeePool) ExpectNoError() { + require.NoError(s.t, s.err) +} + +func (s *govSendFromFeePool) ExpectFeePoolBalance(a string) { + coins, err := sdk.ParseCoinsNormalized(a) + require.NoError(s.t, err) + require.True(s.t, coins.IsEqual(s.moduleBalances[s.k.feePoolName])) +} + +func (s *govSendFromFeePool) ExpectRecipientBalance(a string) { + coins, err := sdk.ParseCoinsNormalized(a) + require.NoError(s.t, err) + require.True(s.t, coins.IsEqual(s.accountBalances[s.msg.Recipient])) +} diff --git a/x/ecocredit/marketplace/keeper/msg_gov_set_fee_params.go b/x/ecocredit/marketplace/keeper/msg_gov_set_fee_params.go index 593fbb7696..6613aaf4ca 100644 --- a/x/ecocredit/marketplace/keeper/msg_gov_set_fee_params.go +++ b/x/ecocredit/marketplace/keeper/msg_gov_set_fee_params.go @@ -3,10 +3,34 @@ package keeper import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + marketplacev1 "github.com/regen-network/regen-ledger/api/v2/regen/ecocredit/marketplace/v1" types "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" ) -func (k Keeper) GovSetFeeParams(context.Context, *types.MsgGovSetFeeParams) (*types.MsgGovSetFeeParamsResponse, error) { - // TODO implement me - panic("implement me") +func (k Keeper) GovSetFeeParams(ctx context.Context, msg *types.MsgGovSetFeeParams) (*types.MsgGovSetFeeParamsResponse, error) { + authority, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + return nil, err + } + + if !authority.Equals(k.authority) { + return nil, sdkerrors.ErrUnauthorized + } + + // convert from gogo to protoreflect + var feeParams marketplacev1.FeeParams + err = gogoToProtoReflect(msg.Fees, &feeParams) + if err != nil { + return nil, err + } + + err = k.stateStore.FeeParamsTable().Save(ctx, &feeParams) + if err != nil { + return nil, err + } + + return &types.MsgGovSetFeeParamsResponse{}, nil } diff --git a/x/ecocredit/marketplace/keeper/msg_gov_set_fee_params_test.go b/x/ecocredit/marketplace/keeper/msg_gov_set_fee_params_test.go new file mode 100644 index 0000000000..4b1e4f8b8b --- /dev/null +++ b/x/ecocredit/marketplace/keeper/msg_gov_set_fee_params_test.go @@ -0,0 +1,68 @@ +package keeper + +import ( + "testing" + + "github.com/gogo/protobuf/jsonpb" + "github.com/google/go-cmp/cmp" + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/testing/protocmp" + + marketplacev1 "github.com/regen-network/regen-ledger/api/v2/regen/ecocredit/marketplace/v1" + types "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" +) + +type govSetFeeParams struct { + *baseSuite + err error + msg *types.MsgGovSetFeeParams +} + +func TestGovSetFeeParams(t *testing.T) { + gocuke.NewRunner(t, &govSetFeeParams{}).Path("./features/msg_gov_set_fee_params.feature").Run() +} + +func (s *govSetFeeParams) Before(t gocuke.TestingT) { + s.baseSuite = setupBase(t, 2) + s.msg = &types.MsgGovSetFeeParams{} +} + +func (s *govSetFeeParams) AuthorityIsSetToTheKeeperAuthority() { + s.msg.Authority = s.k.authority.String() +} + +func (s *govSetFeeParams) AuthorityIsSetTo(a string) { + s.msg.Authority = a +} + +func (s *govSetFeeParams) FeeParams(a gocuke.DocString) { + s.msg.Fees = &types.FeeParams{} + require.NoError(s.t, jsonpb.UnmarshalString(a.Content, s.msg.Fees)) +} + +func (s *govSetFeeParams) FeeParamsAreSet() { + _, s.err = s.k.GovSetFeeParams(s.ctx, s.msg) +} + +func (s *govSetFeeParams) ExpectErrorContains(a string) { + if s.err != nil { + require.ErrorContains(s.t, s.err, a) + } else { + require.NoError(s.t, s.err) + } +} + +func (s *govSetFeeParams) ExpectNoError() { + require.NoError(s.t, s.err) +} + +func (s *govSetFeeParams) ExpectFeeParams(a gocuke.DocString) { + var expected marketplacev1.FeeParams + require.NoError(s.t, jsonpb.UnmarshalString(a.Content, &expected)) + actual, err := s.k.stateStore.FeeParamsTable().Get(s.ctx) + require.NoError(s.t, err) + if diff := cmp.Diff(&expected, actual, protocmp.Transform()); diff != "" { + require.Fail(s.t, "unexpected fee params", diff) + } +} diff --git a/x/ecocredit/marketplace/keeper/utils.go b/x/ecocredit/marketplace/keeper/utils.go index dafc0733ea..36cc9b345b 100644 --- a/x/ecocredit/marketplace/keeper/utils.go +++ b/x/ecocredit/marketplace/keeper/utils.go @@ -4,6 +4,8 @@ import ( "context" sdkmath "cosmossdk.io/math" + gogoproto "github.com/gogo/protobuf/proto" + protov2 "google.golang.org/protobuf/proto" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -11,6 +13,7 @@ import ( api "github.com/regen-network/regen-ledger/api/v2/regen/ecocredit/marketplace/v1" "github.com/regen-network/regen-ledger/types/v2/math" basetypes "github.com/regen-network/regen-ledger/x/ecocredit/v3/base/types/v1" + types "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" "github.com/regen-network/regen-ledger/x/ecocredit/v3/server/utils" ) @@ -24,11 +27,15 @@ type fillOrderParams struct { sellOrder *api.SellOrder buyerAcc sdk.AccAddress buyQuantity math.Dec - totalCost sdk.Coin + buyerFee math.Dec + subTotalCost math.Dec + totalCost math.Dec autoRetire bool batchDenom string + bankDenom string jurisdiction string reason string + feeParams *api.FeeParams } // fillOrder updates seller balance, buyer balance, batch supply, and transfers calculated total cost @@ -192,25 +199,122 @@ func (k Keeper) fillOrder(ctx context.Context, params fillOrderParams) error { } } - // update buyer balance with new tradable or retired amount + // update buyer credit balance with new tradable or retired amount if err = k.baseStore.BatchBalanceTable().Save(ctx, buyerBal); err != nil { return err } - // send total cost from buyer account to seller account - return k.bankKeeper.SendCoins(sdkCtx, params.buyerAcc, params.sellOrder.Seller, sdk.NewCoins(params.totalCost)) + // calculate seller fee = subtotal * seller percentage fee + sellerFee, err := getSellerFee(params.subTotalCost, params.feeParams) + if err != nil { + return err + } + + // calculate total fee = buyer fee + seller fee + totalFee, err := params.buyerFee.Add(sellerFee) + if err != nil { + return err + } + + // if total fee > 0, then transfer total fee from buyer account to fee pool + if totalFee.IsPositive() { + feeCoins := sdk.NewCoins(sdk.NewCoin(params.bankDenom, totalFee.SdkIntTrim())) + + err = k.bankKeeper.SendCoinsFromAccountToModule( + sdkCtx, + params.buyerAcc, + k.feePoolName, + feeCoins) + if err != nil { + return err + } + + // if bank denom == uregen, then burn the total fee from the fee pool + if params.bankDenom == "uregen" { + err = k.bankKeeper.BurnCoins(sdkCtx, k.feePoolName, feeCoins) + if err != nil { + return err + } + } + } + + // calculate seller payment = subtotal - seller fee + sellerPayment, err := params.subTotalCost.Sub(sellerFee) + if err != nil { + return err + } + + seller := sdk.AccAddress(params.sellOrder.Seller) + + // send seller payment from buyer account to seller account + err = k.bankKeeper.SendCoins(sdkCtx, params.buyerAcc, seller, sdk.NewCoins(sdk.NewCoin( + params.bankDenom, + sellerPayment.SdkIntTrim(), + ))) + if err != nil { + return err + } + + return sdkCtx.EventManager().EmitTypedEvent(&types.EventBuyDirect{ + SellOrderId: params.sellOrder.Id, + Buyer: params.buyerAcc.String(), + BuyerFeePaid: &sdk.Coin{Denom: params.bankDenom, Amount: params.buyerFee.SdkIntTrim()}, + Seller: seller.String(), + SellerFeePaid: &sdk.Coin{Denom: params.bankDenom, Amount: sellerFee.SdkIntTrim()}, + }) } -// getTotalCost calculates the total cost of the buy order by multiplying the price per credit specified +// getSubTotalCost calculates the total cost of the buy order by multiplying the price per credit specified // in the sell order (i.e. the ask amount) and the quantity of credits specified in the buy order. -func getTotalCost(askAmount sdkmath.Int, buyQuantity math.Dec) (sdkmath.Int, error) { +func getSubTotalCost(askAmount sdkmath.Int, buyQuantity math.Dec) (math.Dec, error) { unitPrice, err := math.NewPositiveFixedDecFromString(askAmount.String(), buyQuantity.NumDecimalPlaces()) if err != nil { - return sdkmath.Int{}, err + return math.Dec{}, err + } + subtotal, err := buyQuantity.Mul(unitPrice) + if err != nil { + return math.Dec{}, err + } + return subtotal, nil +} + +// getTotalCostAndBuyerFee calculates the total cost of the buy order by multiplying the subtotal by the buyer percentage fee. +func getTotalCostAndBuyerFee(subtotal math.Dec, feeParams *api.FeeParams) (total math.Dec, buyerFee math.Dec, err error) { + buyerPercentageFee := math.NewDecFromInt64(0) + if feeParams != nil && feeParams.BuyerPercentageFee != "" { + buyerPercentageFee, err = math.NewPositiveDecFromString(feeParams.BuyerPercentageFee) + if err != nil { + return + } } - totalCost, err := buyQuantity.Mul(unitPrice) + + buyerFee, err = subtotal.Mul(buyerPercentageFee) if err != nil { - return sdkmath.Int{}, err + return } - return totalCost.SdkIntTrim(), nil + + total, err = subtotal.Add(buyerFee) + return +} + +func getSellerFee(subtotal math.Dec, feeParams *api.FeeParams) (math.Dec, error) { + sellerPercentageFee := math.NewDecFromInt64(0) + if feeParams != nil && feeParams.SellerPercentageFee != "" { + var err error + sellerPercentageFee, err = math.NewPositiveDecFromString(feeParams.SellerPercentageFee) + if err != nil { + return math.Dec{}, err + } + } + + return subtotal.Mul(sellerPercentageFee) +} + +func gogoToProtoReflect(from gogoproto.Message, to protov2.Message) error { + bz, err := gogoproto.Marshal(from) + if err != nil { + return err + } + + return protov2.Unmarshal(bz, to) } diff --git a/x/ecocredit/marketplace/keys.go b/x/ecocredit/marketplace/keys.go new file mode 100644 index 0000000000..7d84a4b8c6 --- /dev/null +++ b/x/ecocredit/marketplace/keys.go @@ -0,0 +1,3 @@ +package marketplace + +const FeePoolName = "marketplace-feepool" diff --git a/x/ecocredit/marketplace/types/v1/events.pb.go b/x/ecocredit/marketplace/types/v1/events.pb.go index 3e6068a1df..e39f658ce9 100644 --- a/x/ecocredit/marketplace/types/v1/events.pb.go +++ b/x/ecocredit/marketplace/types/v1/events.pb.go @@ -5,6 +5,7 @@ package v1 import ( fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -73,6 +74,16 @@ type EventBuyDirect struct { // sell_order_id is the unique identifier of the sell order that credits were // purchased from. SellOrderId uint64 `protobuf:"varint,1,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` + // seller is the address of the account that sold the credits. + Seller string `protobuf:"bytes,2,opt,name=seller,proto3" json:"seller,omitempty"` + // seller_fee_paid is the amount of coins paid by the seller + // to the marketplace as a fee for facilitating the sale. + SellerFeePaid *types.Coin `protobuf:"bytes,3,opt,name=seller_fee_paid,json=sellerFeePaid,proto3" json:"seller_fee_paid,omitempty"` + // buyer is the address of the account that purchased the credits. + Buyer string `protobuf:"bytes,4,opt,name=buyer,proto3" json:"buyer,omitempty"` + // buyer_fee_paid is the amount of coins paid by the buyer + // to the marketplace as a fee for facilitating the sale. + BuyerFeePaid *types.Coin `protobuf:"bytes,5,opt,name=buyer_fee_paid,json=buyerFeePaid,proto3" json:"buyer_fee_paid,omitempty"` } func (m *EventBuyDirect) Reset() { *m = EventBuyDirect{} } @@ -115,6 +126,34 @@ func (m *EventBuyDirect) GetSellOrderId() uint64 { return 0 } +func (m *EventBuyDirect) GetSeller() string { + if m != nil { + return m.Seller + } + return "" +} + +func (m *EventBuyDirect) GetSellerFeePaid() *types.Coin { + if m != nil { + return m.SellerFeePaid + } + return nil +} + +func (m *EventBuyDirect) GetBuyer() string { + if m != nil { + return m.Buyer + } + return "" +} + +func (m *EventBuyDirect) GetBuyerFeePaid() *types.Coin { + if m != nil { + return m.BuyerFeePaid + } + return nil +} + // EventUpdateSellOrder is an event emitted when a sell order is updated. type EventUpdateSellOrder struct { // sell_order_id is the unique identifier of the sell order that was updated. @@ -320,25 +359,32 @@ func init() { } var fileDescriptor_68b71b54d42cf1d9 = []byte{ - // 282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x3f, 0x4b, 0xc3, 0x40, - 0x1c, 0x86, 0x13, 0x50, 0xa1, 0x27, 0x2a, 0x84, 0x82, 0x4e, 0x87, 0x64, 0x51, 0x10, 0x73, 0x04, - 0x9d, 0xdc, 0xac, 0x55, 0x70, 0x12, 0x52, 0x5c, 0x5c, 0x6a, 0x7a, 0xf7, 0x12, 0x43, 0x2f, 0xb9, - 0x70, 0xb9, 0x5e, 0xed, 0xb7, 0xf0, 0x63, 0x39, 0x76, 0x74, 0x94, 0xe4, 0x8b, 0x48, 0xce, 0x3f, - 0xb8, 0x28, 0xed, 0x76, 0xef, 0x7b, 0xcf, 0xb3, 0xfc, 0x5e, 0x72, 0xa2, 0x91, 0xa1, 0x64, 0xe0, - 0x8a, 0x6b, 0x88, 0xdc, 0xb0, 0x22, 0xd5, 0x53, 0x98, 0x4a, 0xa6, 0x1c, 0xcc, 0xc6, 0x0c, 0x16, - 0xa5, 0xa9, 0xa3, 0x4a, 0x2b, 0xa3, 0x02, 0xea, 0xe0, 0xe8, 0x07, 0x8e, 0x7e, 0xc1, 0x91, 0x8d, - 0x43, 0x46, 0x7a, 0xd7, 0x1d, 0x3f, 0x82, 0x94, 0x41, 0x48, 0x76, 0x6a, 0x48, 0x39, 0x56, 0x5a, - 0x40, 0x8f, 0x73, 0x71, 0xe0, 0x1f, 0xfa, 0xc7, 0x1b, 0xc9, 0x76, 0x57, 0xde, 0x75, 0xdd, 0xad, - 0x08, 0xcf, 0xc9, 0xae, 0x13, 0x06, 0xb3, 0xc5, 0x30, 0xd7, 0xe0, 0x66, 0x25, 0xeb, 0x82, 0xf4, - 0x9d, 0x75, 0x5f, 0x89, 0xd4, 0x60, 0xf4, 0xfd, 0xb3, 0x96, 0x7b, 0x95, 0x96, 0x1c, 0x72, 0x3d, - 0xf7, 0x88, 0xec, 0x39, 0xf7, 0x52, 0x4a, 0x35, 0x1f, 0xa2, 0x54, 0x45, 0xd0, 0x27, 0x9b, 0xa2, - 0x7b, 0x38, 0xbc, 0x97, 0x7c, 0x86, 0x90, 0x91, 0x7d, 0x07, 0x26, 0x28, 0x94, 0x85, 0xc3, 0x21, - 0xfe, 0x11, 0x06, 0x8f, 0xaf, 0x0d, 0xf5, 0x97, 0x0d, 0xf5, 0xdf, 0x1b, 0xea, 0xbf, 0xb4, 0xd4, - 0x5b, 0xb6, 0xd4, 0x7b, 0x6b, 0xa9, 0xf7, 0x70, 0x93, 0xe5, 0xe6, 0x69, 0x36, 0x89, 0xb8, 0x2a, - 0x98, 0xbb, 0xfe, 0x69, 0x09, 0x33, 0x57, 0x7a, 0xfa, 0x95, 0x24, 0x44, 0x06, 0xcd, 0x9e, 0xff, - 0x58, 0xd0, 0x2c, 0x2a, 0xd4, 0xcc, 0xc6, 0x93, 0x2d, 0xb7, 0xe0, 0xd9, 0x47, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x33, 0xb9, 0xd9, 0xe6, 0xf0, 0x01, 0x00, 0x00, + // 392 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x8b, 0x13, 0x31, + 0x14, 0xc6, 0x1b, 0xdd, 0x5d, 0x68, 0xd6, 0xdd, 0x85, 0x61, 0xd1, 0xd1, 0x43, 0x28, 0x73, 0xb1, + 0x20, 0x26, 0x54, 0x6f, 0x5e, 0x64, 0xdb, 0x5a, 0xf0, 0xa4, 0x4c, 0xf1, 0xe2, 0x65, 0xcc, 0x24, + 0xcf, 0x1a, 0x9a, 0x99, 0x0c, 0x99, 0x74, 0x6a, 0xff, 0x0b, 0xff, 0x2c, 0x8f, 0x3d, 0x7a, 0x94, + 0x16, 0xfc, 0x3b, 0x24, 0x99, 0xa9, 0x7a, 0x51, 0xbb, 0xb7, 0xf7, 0x85, 0xef, 0xf7, 0xf1, 0x5e, + 0xf8, 0xf0, 0x13, 0x0b, 0x0b, 0x28, 0x19, 0x08, 0x23, 0x2c, 0x48, 0xe5, 0x58, 0xc1, 0xed, 0x12, + 0x5c, 0xa5, 0xb9, 0x00, 0xd6, 0x8c, 0x18, 0x34, 0x50, 0xba, 0x9a, 0x56, 0xd6, 0x38, 0x13, 0x91, + 0x60, 0xa6, 0xbf, 0xcc, 0xf4, 0x0f, 0x33, 0x6d, 0x46, 0x8f, 0x88, 0x30, 0x75, 0x61, 0x6a, 0x96, + 0xf3, 0xda, 0xc3, 0x39, 0x38, 0x3e, 0x62, 0xc2, 0xa8, 0xb2, 0xe5, 0x13, 0x86, 0xfb, 0xaf, 0x7c, + 0xde, 0x1c, 0xb4, 0x8e, 0x12, 0x7c, 0x51, 0x83, 0xd6, 0x99, 0xb1, 0x12, 0x6c, 0xa6, 0x64, 0x8c, + 0x06, 0x68, 0x78, 0x92, 0x9e, 0xfb, 0xc7, 0x37, 0xfe, 0xed, 0xb5, 0x4c, 0x7e, 0x20, 0x7c, 0x19, + 0x88, 0xf1, 0x6a, 0x33, 0x55, 0x16, 0x84, 0x3b, 0x06, 0x8b, 0xee, 0xe3, 0x33, 0x2f, 0xc1, 0xc6, + 0x77, 0x06, 0x68, 0xd8, 0x4f, 0x3b, 0x15, 0xdd, 0xe0, 0xab, 0x76, 0xca, 0x3e, 0x02, 0x64, 0x15, + 0x57, 0x32, 0xbe, 0x3b, 0x40, 0xc3, 0xf3, 0x67, 0x0f, 0x69, 0xbb, 0x39, 0xf5, 0x9b, 0xd3, 0x6e, + 0x73, 0x3a, 0x31, 0xaa, 0x4c, 0x2f, 0x5a, 0x62, 0x06, 0xf0, 0x96, 0x2b, 0x19, 0x5d, 0xe3, 0xd3, + 0x7c, 0xb5, 0x01, 0x1b, 0x9f, 0x84, 0xe4, 0x56, 0x44, 0x2f, 0xf1, 0x65, 0x18, 0x7e, 0xe7, 0x9e, + 0xfe, 0x2f, 0xf7, 0x5e, 0x00, 0xba, 0xd8, 0xe4, 0x05, 0xbe, 0x0e, 0x77, 0xbe, 0xab, 0x24, 0x77, + 0x30, 0x3f, 0xdc, 0x72, 0xd4, 0x27, 0x1d, 0xd8, 0x09, 0x2f, 0x05, 0xe8, 0xdb, 0xb1, 0x8f, 0xf1, + 0x55, 0x60, 0x6f, 0xb4, 0x36, 0xeb, 0x29, 0x94, 0xa6, 0xf0, 0x17, 0x4a, 0x3f, 0x04, 0x7b, 0x3f, + 0x6d, 0x45, 0xc2, 0xf0, 0x83, 0x60, 0x4c, 0xa1, 0x30, 0x0d, 0x04, 0x3b, 0xc8, 0x7f, 0x00, 0xe3, + 0x0f, 0x5f, 0x77, 0x04, 0x6d, 0x77, 0x04, 0x7d, 0xdf, 0x11, 0xf4, 0x65, 0x4f, 0x7a, 0xdb, 0x3d, + 0xe9, 0x7d, 0xdb, 0x93, 0xde, 0xfb, 0xd9, 0x42, 0xb9, 0x4f, 0xab, 0x9c, 0x0a, 0x53, 0xb0, 0x50, + 0xa8, 0xa7, 0x25, 0xb8, 0xb5, 0xb1, 0xcb, 0x4e, 0x69, 0x90, 0x0b, 0xb0, 0xec, 0xf3, 0x5f, 0x4a, + 0xe9, 0x36, 0x15, 0xd4, 0xbe, 0x5d, 0x67, 0xa1, 0x54, 0xcf, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, + 0x17, 0x0b, 0xc9, 0xdb, 0xc3, 0x02, 0x00, 0x00, } func (m *EventSell) Marshal() (dAtA []byte, err error) { @@ -389,6 +435,44 @@ func (m *EventBuyDirect) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.BuyerFeePaid != nil { + { + size, err := m.BuyerFeePaid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Buyer) > 0 { + i -= len(m.Buyer) + copy(dAtA[i:], m.Buyer) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Buyer))) + i-- + dAtA[i] = 0x22 + } + if m.SellerFeePaid != nil { + { + size, err := m.SellerFeePaid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Seller) > 0 { + i -= len(m.Seller) + copy(dAtA[i:], m.Seller) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Seller))) + i-- + dAtA[i] = 0x12 + } if m.SellOrderId != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.SellOrderId)) i-- @@ -545,6 +629,22 @@ func (m *EventBuyDirect) Size() (n int) { if m.SellOrderId != 0 { n += 1 + sovEvents(uint64(m.SellOrderId)) } + l = len(m.Seller) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.SellerFeePaid != nil { + l = m.SellerFeePaid.Size() + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Buyer) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.BuyerFeePaid != nil { + l = m.BuyerFeePaid.Size() + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -721,6 +821,142 @@ func (m *EventBuyDirect) Unmarshal(dAtA []byte) error { break } } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Seller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Seller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellerFeePaid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SellerFeePaid == nil { + m.SellerFeePaid = &types.Coin{} + } + if err := m.SellerFeePaid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Buyer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Buyer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyerFeePaid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BuyerFeePaid == nil { + m.BuyerFeePaid = &types.Coin{} + } + if err := m.BuyerFeePaid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) diff --git a/x/ecocredit/marketplace/types/v1/features/msg_buy_direct.feature b/x/ecocredit/marketplace/types/v1/features/msg_buy_direct.feature index efb6fc4474..57424bafeb 100644 --- a/x/ecocredit/marketplace/types/v1/features/msg_buy_direct.feature +++ b/x/ecocredit/marketplace/types/v1/features/msg_buy_direct.feature @@ -322,6 +322,58 @@ Feature: MsgBuyDirect When the message is validated Then expect the error "orders[0]: retirement reason: max length 512: limit exceeded" + Scenario: a valid message with max_fee_amount + Given the message + """ + { + "buyer": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "orders": [ + { + "sell_order_id": "1", + "quantity": "100", + "bid_price": { + "denom": "regen", + "amount": "100" + }, + "retirement_jurisdiction": "US-WA", + "retirement_reason": "offsetting electricity consumption", + "max_fee_amount": { + "amount": "100", + "denom": "regen" + } + } + ] + } + """ + When the message is validated + Then expect no error + + Scenario: an error is returned if max_fee_amount is negative + Given the message + """ + { + "buyer": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "orders": [ + { + "sell_order_id": "1", + "quantity": "100", + "bid_price": { + "denom": "regen", + "amount": "100" + }, + "retirement_jurisdiction": "US-WA", + "retirement_reason": "offsetting electricity consumption", + "max_fee_amount": { + "amount": "-10", + "denom": "regen" + } + } + ] + } + """ + When the message is validated + Then expect error contains "negative coin" + Scenario: a valid amino message Given the message """ diff --git a/x/ecocredit/marketplace/types/v1/features/msg_gov_send_from_fee_pool.feature b/x/ecocredit/marketplace/types/v1/features/msg_gov_send_from_fee_pool.feature new file mode 100644 index 0000000000..aa04ba1a92 --- /dev/null +++ b/x/ecocredit/marketplace/types/v1/features/msg_gov_send_from_fee_pool.feature @@ -0,0 +1,18 @@ +Feature: MsgGovSetFeeParams + + Scenario Outline: validate message + Given authority "" + * recipient "" + * amount "" + When the message is validated + Then expect error contains "" + + Examples: + | authority | recipient | amount | error | + | | | | empty address | + | foobar | | | bech32 | + | regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw | | | empty address | + | regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw | foobar | | bech32 | + | regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw | regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68 | | coins | + | regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw | regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68 | 100foo | | + diff --git a/x/ecocredit/marketplace/types/v1/features/msg_gov_set_fee_params.feature b/x/ecocredit/marketplace/types/v1/features/msg_gov_set_fee_params.feature new file mode 100644 index 0000000000..39bc040aac --- /dev/null +++ b/x/ecocredit/marketplace/types/v1/features/msg_gov_set_fee_params.feature @@ -0,0 +1,17 @@ +Feature: MsgGovSetFeeParams + + Scenario Outline: validate fee params + Given authority "" + And fee params `` + When the message is validated + Then expect error contains "" + + Examples: + | authority | fee_params | error | + | | {} | address | + | foobar | {} | bech32 | + | regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw | | fees cannot be nil | + | regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw | {} | | + | regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw | {"buyer_percentage_fee":"-0.1"} | non-negative decimal | + | regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw | {"buyer_percentage_fee":"0.1"} | | + diff --git a/x/ecocredit/marketplace/types/v1/features/state_fee_params.feature b/x/ecocredit/marketplace/types/v1/features/state_fee_params.feature new file mode 100644 index 0000000000..3f9a3cb410 --- /dev/null +++ b/x/ecocredit/marketplace/types/v1/features/state_fee_params.feature @@ -0,0 +1,24 @@ +Feature: FeeParams + + Scenario Outline: validate fee params + Given buyer percentage fee "" + And seller percentage fee "" + When I validate the fee params + Then expect error to be + + Examples: + | buyer-percentage-fee | seller-percentage-fee | error | + | 0.0 | 0.0 | false | + | 0.0 | 0.1 | false | + | 0.1 | 0.0 | false | + | 0.1 | 0.1 | false | + | -0.1 | 0.0 | true | + | 0.0 | -0.1 | true | + | | 0.1 | false | + | 0.1 | | false | + | | | false | + | abc | 0.1 | true | + + + + diff --git a/x/ecocredit/marketplace/types/v1/msg_buy_direct.go b/x/ecocredit/marketplace/types/v1/msg_buy_direct.go index 47a748f5d4..21bbaf42cd 100644 --- a/x/ecocredit/marketplace/types/v1/msg_buy_direct.go +++ b/x/ecocredit/marketplace/types/v1/msg_buy_direct.go @@ -77,6 +77,13 @@ func (m MsgBuyDirect) ValidateBasic() error { return ecocredit.ErrMaxLimit.Wrapf("%s: retirement reason: max length %d", orderIndex, base.MaxNoteLength) } } + + if order.MaxFeeAmount != nil { + err := order.MaxFeeAmount.Validate() + if err != nil { + return sdkerrors.ErrInvalidRequest.Wrapf("%s: max fee amount: %s", orderIndex, err) + } + } } return nil diff --git a/x/ecocredit/marketplace/types/v1/msg_buy_direct_test.go b/x/ecocredit/marketplace/types/v1/msg_buy_direct_test.go index b5bf2603cb..f34a55f953 100644 --- a/x/ecocredit/marketplace/types/v1/msg_buy_direct_test.go +++ b/x/ecocredit/marketplace/types/v1/msg_buy_direct_test.go @@ -52,6 +52,14 @@ func (s *msgBuyDirectSuite) ExpectNoError() { require.NoError(s.t, s.err) } +func (s *msgBuyDirectSuite) ExpectErrorContains(a string) { + if a != "" { + require.ErrorContains(s.t, s.err, a) + } else { + require.NoError(s.t, s.err) + } +} + func (s *msgBuyDirectSuite) MessageSignBytesQueried() { s.signBytes = string(s.msg.GetSignBytes()) } diff --git a/x/ecocredit/marketplace/types/v1/msg_gov_send_from_fee_pool.go b/x/ecocredit/marketplace/types/v1/msg_gov_send_from_fee_pool.go new file mode 100644 index 0000000000..320f0e0685 --- /dev/null +++ b/x/ecocredit/marketplace/types/v1/msg_gov_send_from_fee_pool.go @@ -0,0 +1,44 @@ +package v1 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" +) + +var _ legacytx.LegacyMsg = &MsgGovSendFromFeePool{} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgGovSendFromFeePool) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + return err + } + + _, err = sdk.AccAddressFromBech32(m.Recipient) + if err != nil { + return err + } + + if m.Coins == nil { + return sdkerrors.ErrInvalidRequest.Wrap("coins cannot be nil") + } + + return m.Coins.Validate() +} + +// GetSigners implements the LegacyMsg interface. +func (m *MsgGovSendFromFeePool) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.Authority)} +} + +// Route implements the LegacyMsg interface. +func (m *MsgGovSendFromFeePool) Route() string { return sdk.MsgTypeURL(m) } + +// Type implements the LegacyMsg interface. +func (m *MsgGovSendFromFeePool) Type() string { return sdk.MsgTypeURL(m) } + +// GetSignBytes implements the LegacyMsg interface. +func (m *MsgGovSendFromFeePool) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} diff --git a/x/ecocredit/marketplace/types/v1/msg_gov_send_from_fee_pool_test.go b/x/ecocredit/marketplace/types/v1/msg_gov_send_from_fee_pool_test.go new file mode 100644 index 0000000000..8faff2dd3a --- /dev/null +++ b/x/ecocredit/marketplace/types/v1/msg_gov_send_from_fee_pool_test.go @@ -0,0 +1,51 @@ +package v1 + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" +) + +type govSendFromFeePool struct { + gocuke.TestingT + msg *MsgGovSendFromFeePool + err error +} + +func TestGovSendFromFeePool(t *testing.T) { + gocuke.NewRunner(t, &govSendFromFeePool{}). + Path("./features/msg_gov_send_from_fee_pool.feature"). + Run() +} + +func (s *govSendFromFeePool) Before() { + s.msg = &MsgGovSendFromFeePool{} +} + +func (s *govSendFromFeePool) Authority(a string) { + s.msg.Authority = a +} + +func (s *govSendFromFeePool) Recipient(a string) { + s.msg.Recipient = a +} + +func (s *govSendFromFeePool) Amount(a string) { + coins, err := sdk.ParseCoinsNormalized(a) + require.NoError(s, err) + s.msg.Coins = coins +} + +func (s *govSendFromFeePool) TheMessageIsValidated() { + s.err = s.msg.ValidateBasic() +} + +func (s *govSendFromFeePool) ExpectErrorContains(a string) { + if a != "" { + require.ErrorContains(s, s.err, a) + } else { + require.NoError(s, s.err) + } +} diff --git a/x/ecocredit/marketplace/types/v1/msg_gov_set_fee_params.go b/x/ecocredit/marketplace/types/v1/msg_gov_set_fee_params.go index c8439ade2f..c6c6c488f8 100644 --- a/x/ecocredit/marketplace/types/v1/msg_gov_set_fee_params.go +++ b/x/ecocredit/marketplace/types/v1/msg_gov_set_fee_params.go @@ -2,32 +2,39 @@ package v1 import ( "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" ) var _ legacytx.LegacyMsg = &MsgGovSetFeeParams{} +// ValidateBasic does a sanity check on the provided data. func (m *MsgGovSetFeeParams) ValidateBasic() error { - // TODO implement me - panic("implement me") + if m.Fees == nil { + return sdkerrors.ErrInvalidRequest.Wrap("fees cannot be nil") + } + + err := m.Fees.Validate() + if err != nil { + return err + } + + _, err = types.AccAddressFromBech32(m.Authority) + return err } +// GetSigners implements the LegacyMsg interface. func (m *MsgGovSetFeeParams) GetSigners() []types.AccAddress { - // TODO implement me - panic("implement me") + return []types.AccAddress{types.MustAccAddressFromBech32(m.Authority)} } -func (m *MsgGovSetFeeParams) GetSignBytes() []byte { - // TODO implement me - panic("implement me") -} +// Route implements the LegacyMsg interface. +func (m *MsgGovSetFeeParams) Route() string { return types.MsgTypeURL(m) } -func (m *MsgGovSetFeeParams) Route() string { - // TODO implement me - panic("implement me") -} +// Type implements the LegacyMsg interface. +func (m *MsgGovSetFeeParams) Type() string { return types.MsgTypeURL(m) } -func (m *MsgGovSetFeeParams) Type() string { - // TODO implement me - panic("implement me") +// GetSignBytes implements the LegacyMsg interface. +func (m *MsgGovSetFeeParams) GetSignBytes() []byte { + return types.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) } diff --git a/x/ecocredit/marketplace/types/v1/msg_gov_set_fee_params_test.go b/x/ecocredit/marketplace/types/v1/msg_gov_set_fee_params_test.go new file mode 100644 index 0000000000..d5c488a300 --- /dev/null +++ b/x/ecocredit/marketplace/types/v1/msg_gov_set_fee_params_test.go @@ -0,0 +1,49 @@ +package v1 + +import ( + "testing" + + "github.com/gogo/protobuf/jsonpb" + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" +) + +type govSetFeeParams struct { + gocuke.TestingT + msg *MsgGovSetFeeParams + err error +} + +func TestGovSetFeeParams(t *testing.T) { + gocuke.NewRunner(t, &govSetFeeParams{}). + Path("./features/msg_gov_set_fee_params.feature"). + Step("^fee\\s+params\\s+`([^`]*)`$", (*govSetFeeParams).FeeParams). + Run() +} + +func (s *govSetFeeParams) Before() { + s.msg = &MsgGovSetFeeParams{} +} + +func (s *govSetFeeParams) Authority(a string) { + s.msg.Authority = a +} + +func (s *govSetFeeParams) FeeParams(a string) { + if a != "" { + s.msg.Fees = &FeeParams{} + require.NoError(s, jsonpb.UnmarshalString(a, s.msg.Fees)) + } +} + +func (s *govSetFeeParams) TheMessageIsValidated() { + s.err = s.msg.ValidateBasic() +} + +func (s *govSetFeeParams) ExpectErrorContains(a string) { + if a != "" { + require.ErrorContains(s, s.err, a) + } else { + require.NoError(s, s.err) + } +} diff --git a/x/ecocredit/marketplace/types/v1/state_fee_params.go b/x/ecocredit/marketplace/types/v1/state_fee_params.go new file mode 100644 index 0000000000..f031ba22d0 --- /dev/null +++ b/x/ecocredit/marketplace/types/v1/state_fee_params.go @@ -0,0 +1,18 @@ +package v1 + +import "github.com/regen-network/regen-ledger/types/v2/math" + +// Validate performs basic validation of the FeeParams state type. +func (m *FeeParams) Validate() error { + _, err := math.NewNonNegativeDecFromString(m.BuyerPercentageFee) + if err != nil { + return err + } + + _, err = math.NewNonNegativeDecFromString(m.SellerPercentageFee) + if err != nil { + return err + } + + return nil +} diff --git a/x/ecocredit/marketplace/types/v1/state_fee_params_test.go b/x/ecocredit/marketplace/types/v1/state_fee_params_test.go new file mode 100644 index 0000000000..26adbe4589 --- /dev/null +++ b/x/ecocredit/marketplace/types/v1/state_fee_params_test.go @@ -0,0 +1,42 @@ +package v1 + +import ( + "testing" + + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" +) + +type feeParams struct { + gocuke.TestingT + params *FeeParams + err error +} + +func TestFeeParams(t *testing.T) { + gocuke.NewRunner(t, &feeParams{}).Path("./features/state_fee_params.feature").Run() +} + +func (s *feeParams) Before() { + s.params = &FeeParams{} +} + +func (s *feeParams) BuyerPercentageFee(a string) { + s.params.BuyerPercentageFee = a +} + +func (s *feeParams) SellerPercentageFee(a string) { + s.params.SellerPercentageFee = a +} + +func (s *feeParams) IValidateTheFeeParams() { + s.err = s.params.Validate() +} + +func (s *feeParams) ExpectErrorToBeTrue() { + require.Error(s, s.err) +} + +func (s *feeParams) ExpectErrorToBeFalse() { + require.NoError(s, s.err) +} diff --git a/x/ecocredit/marketplace/types/v1/tx.pb.go b/x/ecocredit/marketplace/types/v1/tx.pb.go index 365f971e5a..21a11cfa4a 100644 --- a/x/ecocredit/marketplace/types/v1/tx.pb.go +++ b/x/ecocredit/marketplace/types/v1/tx.pb.go @@ -6,7 +6,7 @@ package v1 import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" @@ -577,13 +577,10 @@ type MsgBuyDirect_Order struct { RetirementReason string `protobuf:"bytes,7,opt,name=retirement_reason,json=retirementReason,proto3" json:"retirement_reason,omitempty"` // max_fee_amount is the maximum amount of buyer side fees being paid to the marketplace. // If the marketplace fees end up being greater than this amount, the transaction will fail. - // If this field is left empty, the marketplace fees will be calculated based on the bid price - // and quantity and automatically deducted from the buyer's account. - // Fees are always paid in the same denomination as the bid price and max fee amount should - // be an integer value of that denom. + // Fees are always paid in the same denomination as the bid price. // // Since Revision 3 - MaxFeeAmount string `protobuf:"bytes,8,opt,name=max_fee_amount,json=maxFeeAmount,proto3" json:"max_fee_amount,omitempty"` + MaxFeeAmount *types.Coin `protobuf:"bytes,8,opt,name=max_fee_amount,json=maxFeeAmount,proto3" json:"max_fee_amount,omitempty"` } func (m *MsgBuyDirect_Order) Reset() { *m = MsgBuyDirect_Order{} } @@ -661,11 +658,11 @@ func (m *MsgBuyDirect_Order) GetRetirementReason() string { return "" } -func (m *MsgBuyDirect_Order) GetMaxFeeAmount() string { +func (m *MsgBuyDirect_Order) GetMaxFeeAmount() *types.Coin { if m != nil { return m.MaxFeeAmount } - return "" + return nil } // MsgBuyDirectResponse is the Msg/BuyDirect response type. @@ -1010,6 +1007,107 @@ func (m *MsgGovSetFeeParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgGovSetFeeParamsResponse proto.InternalMessageInfo +// MsgSendFromFeePool is the Msg/SendFromFeePool request type. +type MsgGovSendFromFeePool struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // recipient is the address of the account that will receive the funds. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + // coins is the amount of coins to send from the fee pool. + Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` +} + +func (m *MsgGovSendFromFeePool) Reset() { *m = MsgGovSendFromFeePool{} } +func (m *MsgGovSendFromFeePool) String() string { return proto.CompactTextString(m) } +func (*MsgGovSendFromFeePool) ProtoMessage() {} +func (*MsgGovSendFromFeePool) Descriptor() ([]byte, []int) { + return fileDescriptor_68c9b4e4b7fcb584, []int{14} +} +func (m *MsgGovSendFromFeePool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovSendFromFeePool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovSendFromFeePool.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 *MsgGovSendFromFeePool) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovSendFromFeePool.Merge(m, src) +} +func (m *MsgGovSendFromFeePool) XXX_Size() int { + return m.Size() +} +func (m *MsgGovSendFromFeePool) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovSendFromFeePool.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovSendFromFeePool proto.InternalMessageInfo + +func (m *MsgGovSendFromFeePool) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgGovSendFromFeePool) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *MsgGovSendFromFeePool) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Coins + } + return nil +} + +// MsgSendFromFeePoolResponse is the Msg/SendFromFeePool response type. +type MsgGovSendFromFeePoolResponse struct { +} + +func (m *MsgGovSendFromFeePoolResponse) Reset() { *m = MsgGovSendFromFeePoolResponse{} } +func (m *MsgGovSendFromFeePoolResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGovSendFromFeePoolResponse) ProtoMessage() {} +func (*MsgGovSendFromFeePoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_68c9b4e4b7fcb584, []int{15} +} +func (m *MsgGovSendFromFeePoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovSendFromFeePoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovSendFromFeePoolResponse.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 *MsgGovSendFromFeePoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovSendFromFeePoolResponse.Merge(m, src) +} +func (m *MsgGovSendFromFeePoolResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGovSendFromFeePoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovSendFromFeePoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovSendFromFeePoolResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSell)(nil), "regen.ecocredit.marketplace.v1.MsgSell") proto.RegisterType((*MsgSell_Order)(nil), "regen.ecocredit.marketplace.v1.MsgSell.Order") @@ -1028,6 +1126,8 @@ func init() { proto.RegisterType((*MsgRemoveAllowedDenomResponse)(nil), "regen.ecocredit.marketplace.v1.MsgRemoveAllowedDenomResponse") proto.RegisterType((*MsgGovSetFeeParams)(nil), "regen.ecocredit.marketplace.v1.MsgGovSetFeeParams") proto.RegisterType((*MsgGovSetFeeParamsResponse)(nil), "regen.ecocredit.marketplace.v1.MsgGovSetFeeParamsResponse") + proto.RegisterType((*MsgGovSendFromFeePool)(nil), "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePool") + proto.RegisterType((*MsgGovSendFromFeePoolResponse)(nil), "regen.ecocredit.marketplace.v1.MsgGovSendFromFeePoolResponse") } func init() { @@ -1035,75 +1135,80 @@ func init() { } var fileDescriptor_68c9b4e4b7fcb584 = []byte{ - // 1078 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xae, 0x77, 0x37, 0x9b, 0xe4, 0x6d, 0x92, 0xb6, 0x6e, 0x48, 0xb7, 0xa6, 0xd9, 0x84, 0x05, - 0xa9, 0xa1, 0x10, 0x5b, 0x49, 0x0b, 0x95, 0x82, 0x22, 0x91, 0xb4, 0x4d, 0xd5, 0xa2, 0x15, 0xc5, - 0x29, 0x17, 0x24, 0xe4, 0xce, 0xda, 0x2f, 0x8e, 0x89, 0xed, 0x59, 0x3c, 0xe3, 0x64, 0x73, 0x2c, - 0x42, 0x42, 0xe2, 0xd4, 0x33, 0x47, 0xfe, 0x02, 0x0e, 0xfc, 0x11, 0x08, 0x2e, 0x15, 0x27, 0x6e, - 0xa0, 0x44, 0x82, 0x1b, 0x67, 0x8e, 0xc8, 0xe3, 0x59, 0x67, 0xe3, 0xcd, 0x36, 0xce, 0xde, 0xf2, - 0x7e, 0x7c, 0xef, 0xbd, 0xf9, 0xbe, 0x79, 0xe3, 0x0d, 0xdc, 0x8a, 0xd0, 0xc5, 0xd0, 0x40, 0x9b, - 0xda, 0x11, 0x3a, 0x1e, 0x37, 0x02, 0x12, 0xed, 0x21, 0xef, 0xf8, 0xc4, 0x46, 0x63, 0x7f, 0xc5, - 0xe0, 0x5d, 0xbd, 0x13, 0x51, 0x4e, 0xd5, 0x86, 0x48, 0xd4, 0xb3, 0x44, 0xbd, 0x2f, 0x51, 0xdf, - 0x5f, 0xd1, 0x1a, 0x36, 0x65, 0x01, 0x65, 0x46, 0x9b, 0xb0, 0x04, 0xd8, 0x46, 0x4e, 0x56, 0x0c, - 0x9b, 0x7a, 0x61, 0x8a, 0xd7, 0xae, 0xcb, 0x78, 0xc0, 0xdc, 0xa4, 0x6e, 0xc0, 0x5c, 0x19, 0xb8, - 0x91, 0x06, 0x2c, 0x61, 0x19, 0xa9, 0x21, 0x43, 0xb3, 0x2e, 0x75, 0x69, 0xea, 0x4f, 0xfe, 0x92, - 0xde, 0x05, 0x97, 0x52, 0xd7, 0x47, 0x43, 0x58, 0xed, 0x78, 0xc7, 0xe0, 0x5e, 0x80, 0x8c, 0x93, - 0xa0, 0x23, 0x13, 0x6e, 0x9f, 0x73, 0x26, 0xc6, 0x09, 0xc7, 0x34, 0xb7, 0xf9, 0x77, 0x09, 0xc6, - 0x5b, 0xcc, 0xdd, 0x46, 0xdf, 0x57, 0xe7, 0xa0, 0xca, 0xd0, 0xf7, 0x31, 0xaa, 0x2b, 0x8b, 0xca, - 0xd2, 0xa4, 0x29, 0x2d, 0xf5, 0x21, 0x54, 0x69, 0xe4, 0x60, 0xc4, 0xea, 0xa5, 0xc5, 0xf2, 0x52, - 0x6d, 0x75, 0x59, 0x7f, 0x3d, 0x17, 0xba, 0x2c, 0xa8, 0x7f, 0x9a, 0xa0, 0x4c, 0x09, 0xd6, 0xfe, - 0x55, 0x60, 0x4c, 0x78, 0xd4, 0x05, 0xa8, 0xb5, 0x09, 0xb7, 0x77, 0x2d, 0x07, 0x43, 0x1a, 0xc8, - 0x6e, 0x20, 0x5c, 0x0f, 0x12, 0x8f, 0xaa, 0xc1, 0xc4, 0xd7, 0x31, 0x09, 0xb9, 0xc7, 0x0f, 0xeb, - 0x25, 0x11, 0xcd, 0x6c, 0xf5, 0x43, 0x98, 0x24, 0x6c, 0xcf, 0xea, 0x44, 0x9e, 0x8d, 0xf5, 0xf2, - 0xa2, 0xb2, 0x54, 0x5b, 0xbd, 0xa1, 0x4b, 0xda, 0x12, 0xf2, 0x75, 0x49, 0xbe, 0x7e, 0x9f, 0x7a, - 0xa1, 0x39, 0x41, 0xd8, 0xde, 0xd3, 0x24, 0x55, 0xd5, 0xe1, 0x9a, 0xe3, 0x31, 0xd2, 0xf6, 0xd1, - 0x22, 0x31, 0xa7, 0x56, 0x84, 0xdc, 0x8b, 0xb0, 0x5e, 0x59, 0x54, 0x96, 0x26, 0xcc, 0xab, 0x32, - 0xb4, 0x11, 0x73, 0x6a, 0x8a, 0x80, 0xfa, 0x31, 0x00, 0x76, 0x3b, 0x5e, 0x44, 0xb8, 0x47, 0xc3, - 0xfa, 0x98, 0x68, 0xa4, 0xe9, 0x29, 0xf7, 0x7a, 0x8f, 0x7b, 0xfd, 0x59, 0x8f, 0xfb, 0xcd, 0xca, - 0xcb, 0x3f, 0x17, 0x14, 0xb3, 0x0f, 0xb3, 0x56, 0xfb, 0xe6, 0x9f, 0x9f, 0x6e, 0x4b, 0x12, 0x9b, - 0xf7, 0xe0, 0xb2, 0xa4, 0xc5, 0x44, 0xd6, 0xa1, 0x21, 0x43, 0xf5, 0x1d, 0x98, 0x49, 0x82, 0x96, - 0xe0, 0xc7, 0xf2, 0x1c, 0x56, 0x57, 0x16, 0xcb, 0x4b, 0x15, 0x73, 0x2a, 0xf1, 0x0a, 0xa6, 0x1e, - 0x3b, 0xac, 0xf9, 0x43, 0x19, 0xae, 0xb5, 0x98, 0xfb, 0x79, 0xc7, 0x21, 0x1c, 0xb7, 0x7b, 0x11, - 0x36, 0x54, 0xad, 0x67, 0x30, 0x1e, 0x8b, 0xdc, 0x9e, 0x5c, 0x6b, 0x05, 0xe4, 0xca, 0x57, 0xd7, - 0x53, 0x87, 0xd9, 0x2b, 0xa5, 0x7d, 0x57, 0x82, 0x6a, 0xea, 0x53, 0x9b, 0x30, 0x7d, 0x6a, 0x6c, - 0xd1, 0xbf, 0x62, 0xd6, 0xfa, 0xa6, 0x56, 0xdf, 0x82, 0xa9, 0x10, 0x0f, 0xac, 0x9c, 0x88, 0xb5, - 0x10, 0x0f, 0x3e, 0xeb, 0xe9, 0xb8, 0x0e, 0xd3, 0x49, 0xca, 0x05, 0xb4, 0x4c, 0xe0, 0x1b, 0xa3, - 0xca, 0xf9, 0x08, 0x66, 0x92, 0x76, 0x23, 0x48, 0x9a, 0x8c, 0xf9, 0x70, 0x88, 0xaa, 0xf3, 0xf0, - 0xe6, 0x19, 0xec, 0xf5, 0x14, 0x6e, 0x7e, 0x09, 0x6a, 0x8b, 0xb9, 0xf7, 0x49, 0x68, 0xa3, 0x9f, - 0x85, 0x87, 0x2a, 0x37, 0x40, 0x6c, 0x69, 0x80, 0xd8, 0xd3, 0xdd, 0x6f, 0x82, 0x36, 0x58, 0x3e, - 0x6b, 0xfe, 0x6b, 0x19, 0xa6, 0x5a, 0xcc, 0xdd, 0x8c, 0x0f, 0x1f, 0x78, 0x11, 0xda, 0x5c, 0x9d, - 0x85, 0xb1, 0x76, 0x7c, 0x98, 0xb5, 0x4d, 0x0d, 0xf5, 0x49, 0x6e, 0xbb, 0x57, 0x0b, 0x5c, 0x97, - 0xac, 0x66, 0x6e, 0xc5, 0x7f, 0x2b, 0xf5, 0x56, 0xbc, 0xc0, 0x59, 0x4e, 0x6d, 0x79, 0x79, 0x70, - 0xcb, 0xdb, 0x9e, 0x23, 0x6f, 0x46, 0xe5, 0xdc, 0x2d, 0x6f, 0x7b, 0xce, 0x6b, 0xaf, 0xc5, 0xd8, - 0xb0, 0x6b, 0x71, 0x0f, 0xae, 0xa7, 0x29, 0x01, 0x86, 0xdc, 0xfa, 0x2a, 0x8e, 0x3c, 0xe6, 0x78, - 0xb6, 0xb8, 0x1f, 0x55, 0x31, 0xd2, 0xdc, 0x49, 0xf8, 0x49, 0x5f, 0x54, 0x7d, 0x0f, 0xae, 0xf6, - 0x01, 0x23, 0x24, 0x8c, 0x86, 0xf5, 0x71, 0x01, 0xb9, 0x72, 0x12, 0x30, 0x85, 0x5f, 0xbd, 0x0b, - 0x33, 0x01, 0xe9, 0x5a, 0x3b, 0x88, 0x16, 0x09, 0x68, 0x1c, 0xf2, 0xfa, 0x44, 0x92, 0xb9, 0x39, - 0xf3, 0xfb, 0xcf, 0xcb, 0x20, 0x4f, 0xf5, 0x38, 0xe4, 0xe6, 0x54, 0x40, 0xba, 0x5b, 0x88, 0x1b, - 0x22, 0x67, 0x0d, 0x12, 0xad, 0x53, 0x95, 0x9a, 0x73, 0x30, 0xdb, 0xcf, 0x7b, 0x26, 0xf2, 0x8f, - 0x8a, 0xb8, 0x62, 0x1b, 0x8e, 0xb3, 0xe1, 0xfb, 0xf4, 0x00, 0x9d, 0xf4, 0x01, 0xbd, 0x09, 0x93, - 0x24, 0xe6, 0xbb, 0x34, 0x4a, 0xb8, 0x4d, 0xe5, 0x3e, 0x71, 0xa8, 0xf3, 0x00, 0x6d, 0x12, 0xee, - 0xc9, 0xe7, 0x37, 0xdd, 0xcd, 0xc9, 0xc4, 0x93, 0x82, 0xdf, 0x86, 0x69, 0xc7, 0x63, 0x1d, 0x9f, - 0x1c, 0xca, 0x8c, 0x54, 0x9c, 0x29, 0xe9, 0xcc, 0x9e, 0x68, 0xec, 0x76, 0x68, 0x88, 0x21, 0x17, - 0xfa, 0x4c, 0x9b, 0x99, 0xbd, 0x36, 0x93, 0x0c, 0x7e, 0xd2, 0x4f, 0xde, 0xd3, 0xdc, 0x8c, 0xd9, - 0x11, 0x3e, 0x81, 0x37, 0x5a, 0xcc, 0x35, 0x31, 0xa0, 0xfb, 0x78, 0x81, 0x43, 0xcc, 0xc2, 0x58, - 0xff, 0xfc, 0xa9, 0xd1, 0x5c, 0x80, 0xf9, 0x33, 0x8b, 0x65, 0xdd, 0x5e, 0xa4, 0x84, 0x3d, 0xa2, - 0xfb, 0xdb, 0xc8, 0xb7, 0x10, 0x9f, 0x92, 0x88, 0x04, 0xec, 0x9c, 0x5e, 0xeb, 0x50, 0xd9, 0x41, - 0xf1, 0xa0, 0x26, 0x17, 0xf1, 0xdd, 0xf3, 0x36, 0x24, 0x2b, 0x6b, 0x0a, 0xd8, 0x10, 0x3e, 0x72, - 0x23, 0xf4, 0x26, 0x5c, 0xfd, 0xaf, 0x0a, 0xe5, 0x16, 0x73, 0xd5, 0xe7, 0x50, 0x11, 0x9f, 0xe5, - 0x5b, 0x05, 0x3f, 0xb7, 0x9a, 0x51, 0x30, 0x31, 0xfb, 0x00, 0x7d, 0xab, 0xc0, 0x95, 0x81, 0xef, - 0xca, 0x9d, 0x11, 0x3e, 0x17, 0xda, 0x47, 0x23, 0x80, 0xb2, 0x31, 0x5e, 0x28, 0x70, 0x39, 0xff, - 0x46, 0x16, 0x79, 0x85, 0x72, 0x18, 0x6d, 0xed, 0xe2, 0x98, 0x6c, 0x06, 0x0a, 0x93, 0x27, 0x0f, - 0xe5, 0xfb, 0x17, 0x79, 0x02, 0xb5, 0xbb, 0x17, 0xc9, 0x3e, 0x75, 0xe8, 0xfc, 0xd6, 0x16, 0x39, - 0x74, 0x0e, 0x53, 0xe8, 0xd0, 0x43, 0x36, 0x4f, 0xfd, 0x5e, 0x01, 0xf5, 0x8c, 0xbd, 0xfb, 0xa0, - 0x40, 0xc9, 0x41, 0x98, 0xb6, 0x3e, 0x12, 0xec, 0x14, 0x21, 0xf9, 0xad, 0x2c, 0x42, 0x48, 0x0e, - 0x53, 0x88, 0x90, 0x21, 0xab, 0xb7, 0xf9, 0xfc, 0x97, 0xa3, 0x86, 0xf2, 0xea, 0xa8, 0xa1, 0xfc, - 0x75, 0xd4, 0x50, 0x5e, 0x1e, 0x37, 0x2e, 0xbd, 0x3a, 0x6e, 0x5c, 0xfa, 0xe3, 0xb8, 0x71, 0xe9, - 0x8b, 0x2d, 0xd7, 0xe3, 0xbb, 0x71, 0x5b, 0xb7, 0x69, 0x60, 0x88, 0xfa, 0xcb, 0x21, 0xf2, 0x03, - 0x1a, 0xed, 0x49, 0xcb, 0x47, 0xc7, 0xc5, 0xc8, 0xe8, 0x0e, 0xf9, 0xd5, 0xcd, 0x0f, 0x3b, 0xc8, - 0x92, 0x7f, 0x0b, 0xaa, 0xe2, 0x67, 0xc6, 0x9d, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x07, 0xda, - 0x17, 0x15, 0x78, 0x0c, 0x00, 0x00, + // 1156 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdf, 0x6f, 0xdb, 0xd4, + 0x17, 0xaf, 0xf3, 0xa3, 0x6b, 0x4e, 0xda, 0x6e, 0xf3, 0xfa, 0xed, 0xf2, 0x35, 0x6d, 0x52, 0x02, + 0xd2, 0xc2, 0xa0, 0x36, 0xed, 0x18, 0x93, 0x8a, 0x2a, 0x68, 0xb7, 0x75, 0x62, 0x28, 0x62, 0xb8, + 0xe3, 0x05, 0x09, 0x65, 0x37, 0xf6, 0xa9, 0x6b, 0x62, 0xfb, 0x06, 0xdf, 0xeb, 0x36, 0x7d, 0x1c, + 0x02, 0x21, 0xf1, 0xb4, 0x67, 0x1e, 0x79, 0xe4, 0x89, 0xbf, 0x02, 0xed, 0x71, 0x2f, 0x20, 0x9e, + 0x18, 0x6a, 0x25, 0x78, 0xe3, 0x6f, 0x40, 0xbe, 0x76, 0xdc, 0xc4, 0x69, 0x16, 0xb7, 0x4f, 0xc9, + 0x3d, 0xbf, 0xcf, 0xe7, 0x73, 0xef, 0xb9, 0xd7, 0x70, 0xc3, 0x47, 0x0b, 0x3d, 0x0d, 0x0d, 0x6a, + 0xf8, 0x68, 0xda, 0x5c, 0x73, 0x89, 0xdf, 0x41, 0xde, 0x75, 0x88, 0x81, 0xda, 0xc1, 0x9a, 0xc6, + 0x7b, 0x6a, 0xd7, 0xa7, 0x9c, 0xca, 0x55, 0x61, 0xa8, 0x26, 0x86, 0xea, 0x80, 0xa1, 0x7a, 0xb0, + 0xa6, 0x54, 0x0d, 0xca, 0x5c, 0xca, 0xb4, 0x36, 0x61, 0xa1, 0x63, 0x1b, 0x39, 0x59, 0xd3, 0x0c, + 0x6a, 0x7b, 0x91, 0xbf, 0x72, 0x3d, 0xd6, 0xbb, 0xcc, 0x0a, 0xe3, 0xba, 0xcc, 0x8a, 0x15, 0x0b, + 0x16, 0xb5, 0xa8, 0xf8, 0xab, 0x85, 0xff, 0x62, 0x69, 0xcd, 0xa2, 0xd4, 0x72, 0x50, 0x13, 0xab, + 0x76, 0xb0, 0xa7, 0x71, 0xdb, 0x45, 0xc6, 0x89, 0xdb, 0x8d, 0x0d, 0x6e, 0x4e, 0x28, 0x9c, 0x71, + 0xc2, 0x31, 0xb2, 0xad, 0xff, 0x9d, 0x83, 0x4b, 0x4d, 0x66, 0xed, 0xa2, 0xe3, 0xc8, 0x8b, 0x30, + 0xcd, 0xd0, 0x71, 0xd0, 0xaf, 0x48, 0x2b, 0x52, 0xa3, 0xa4, 0xc7, 0x2b, 0xf9, 0x3e, 0x4c, 0x53, + 0xdf, 0x44, 0x9f, 0x55, 0x72, 0x2b, 0xf9, 0x46, 0x79, 0x7d, 0x55, 0x7d, 0x75, 0xc3, 0x6a, 0x1c, + 0x50, 0xfd, 0x34, 0xf4, 0xd2, 0x63, 0x67, 0xe5, 0x5f, 0x09, 0x8a, 0x42, 0x22, 0xd7, 0xa0, 0xdc, + 0x26, 0xdc, 0xd8, 0x6f, 0x99, 0xe8, 0x51, 0x37, 0xce, 0x06, 0x42, 0x74, 0x2f, 0x94, 0xc8, 0x0a, + 0xcc, 0x7c, 0x1d, 0x10, 0x8f, 0xdb, 0xfc, 0xa8, 0x92, 0x13, 0xda, 0x64, 0x2d, 0xbf, 0x0f, 0x25, + 0xc2, 0x3a, 0xad, 0xae, 0x6f, 0x1b, 0x58, 0xc9, 0xaf, 0x48, 0x8d, 0xf2, 0xfa, 0xff, 0xd5, 0x08, + 0x41, 0x35, 0x44, 0x58, 0x8d, 0x11, 0x56, 0xef, 0x52, 0xdb, 0xd3, 0x67, 0x08, 0xeb, 0x3c, 0x0a, + 0x4d, 0x65, 0x15, 0xae, 0x99, 0x36, 0x23, 0x6d, 0x07, 0x5b, 0x24, 0xe0, 0xb4, 0xe5, 0x23, 0xb7, + 0x7d, 0xac, 0x14, 0x56, 0xa4, 0xc6, 0x8c, 0x7e, 0x35, 0x56, 0x6d, 0x05, 0x9c, 0xea, 0x42, 0x21, + 0x7f, 0x04, 0x80, 0xbd, 0xae, 0xed, 0x13, 0x6e, 0x53, 0xaf, 0x52, 0x14, 0x89, 0x14, 0x35, 0xc2, + 0x5e, 0xed, 0x63, 0xaf, 0x3e, 0xee, 0x63, 0xbf, 0x5d, 0x78, 0xf6, 0xb2, 0x26, 0xe9, 0x03, 0x3e, + 0x1b, 0xe5, 0x6f, 0xfe, 0xf9, 0xe5, 0x66, 0x0c, 0x62, 0xfd, 0x0e, 0x5c, 0x8e, 0x61, 0xd1, 0x91, + 0x75, 0xa9, 0xc7, 0x50, 0x7e, 0x13, 0xe6, 0x43, 0x65, 0x4b, 0xe0, 0xd3, 0xb2, 0x4d, 0x56, 0x91, + 0x56, 0xf2, 0x8d, 0x82, 0x3e, 0x1b, 0x4a, 0x05, 0x52, 0x1f, 0x9b, 0xac, 0xfe, 0x63, 0x1e, 0xae, + 0x35, 0x99, 0xf5, 0x79, 0xd7, 0x24, 0x1c, 0x77, 0xfb, 0x1a, 0x36, 0x96, 0xad, 0xc7, 0x70, 0x29, + 0x10, 0xb6, 0x7d, 0xba, 0x36, 0x32, 0xd0, 0x95, 0x8e, 0xae, 0x46, 0x02, 0xbd, 0x1f, 0x4a, 0xf9, + 0x3e, 0x07, 0xd3, 0x91, 0x4c, 0xae, 0xc3, 0xdc, 0x50, 0xd9, 0x22, 0x7f, 0x41, 0x2f, 0x0f, 0x54, + 0x2d, 0xbf, 0x0e, 0xb3, 0x1e, 0x1e, 0xb6, 0x52, 0x24, 0x96, 0x3d, 0x3c, 0xfc, 0xac, 0xcf, 0xe3, + 0x26, 0xcc, 0x85, 0x26, 0xe7, 0xe0, 0x32, 0x74, 0xdf, 0xba, 0x28, 0x9d, 0x0f, 0x60, 0x3e, 0x4c, + 0x77, 0x01, 0x4a, 0xc3, 0x32, 0xef, 0x8f, 0x61, 0x75, 0x19, 0x5e, 0x3b, 0x03, 0xbd, 0x3e, 0xc3, + 0xf5, 0x2f, 0x41, 0x6e, 0x32, 0xeb, 0x2e, 0xf1, 0x0c, 0x74, 0x12, 0xf5, 0x58, 0xe6, 0x46, 0x80, + 0xcd, 0x8d, 0x00, 0x3b, 0x9c, 0x7d, 0x09, 0x94, 0xd1, 0xf0, 0x49, 0xf2, 0xdf, 0xf2, 0x30, 0xdb, + 0x64, 0xd6, 0x76, 0x70, 0x74, 0xcf, 0xf6, 0xd1, 0xe0, 0xf2, 0x02, 0x14, 0xdb, 0xc1, 0x51, 0x92, + 0x36, 0x5a, 0xc8, 0x0f, 0x53, 0xa7, 0x7b, 0x3d, 0xc3, 0x76, 0x49, 0x62, 0xa6, 0x8e, 0xf8, 0xef, + 0xb9, 0xfe, 0x11, 0xcf, 0xd0, 0xcb, 0xd0, 0x29, 0xcf, 0x8f, 0x9e, 0xf2, 0xb6, 0x6d, 0xc6, 0x3b, + 0xa3, 0x30, 0xf1, 0x94, 0xb7, 0x6d, 0xf3, 0x95, 0xdb, 0xa2, 0x38, 0x6e, 0x5b, 0xdc, 0x81, 0xeb, + 0x91, 0x89, 0x8b, 0x1e, 0x6f, 0x7d, 0x15, 0xf8, 0x36, 0x33, 0x6d, 0x43, 0xec, 0x8f, 0x69, 0x51, + 0xd2, 0xe2, 0xa9, 0xfa, 0xe1, 0x80, 0x56, 0x7e, 0x1b, 0xae, 0x0e, 0x38, 0xfa, 0x48, 0x18, 0xf5, + 0x2a, 0x97, 0x84, 0xcb, 0x95, 0x53, 0x85, 0x2e, 0xe4, 0xf2, 0x87, 0x30, 0xef, 0x92, 0x5e, 0x6b, + 0x0f, 0xb1, 0x45, 0x5c, 0x1a, 0x78, 0xbc, 0x32, 0x33, 0xa9, 0xa5, 0x59, 0x97, 0xf4, 0x76, 0x10, + 0xb7, 0x84, 0xf9, 0x06, 0x84, 0xb4, 0x47, 0x84, 0xd5, 0x17, 0x61, 0x61, 0x90, 0x82, 0x84, 0xef, + 0x9f, 0x24, 0xb1, 0xdb, 0xb6, 0x4c, 0x73, 0xcb, 0x71, 0xe8, 0x21, 0x9a, 0xd1, 0x2c, 0x5d, 0x82, + 0x12, 0x09, 0xf8, 0x3e, 0xf5, 0x43, 0x98, 0x23, 0xe6, 0x4f, 0x05, 0xf2, 0x32, 0x40, 0x9b, 0x78, + 0x9d, 0x78, 0x12, 0x47, 0xc7, 0xb4, 0x14, 0x4a, 0x22, 0xe7, 0x37, 0x60, 0xce, 0xb4, 0x59, 0xd7, + 0x21, 0x47, 0xb1, 0x45, 0xc4, 0xd3, 0x6c, 0x2c, 0x4c, 0xa6, 0x35, 0xf6, 0xba, 0xd4, 0x43, 0x8f, + 0x0b, 0xaa, 0xe6, 0xf4, 0x64, 0xbd, 0x31, 0x1f, 0x16, 0x7e, 0x9a, 0x2f, 0xde, 0xb2, 0xa9, 0x1a, + 0x93, 0x16, 0x3e, 0x81, 0xff, 0x35, 0x99, 0xa5, 0xa3, 0x4b, 0x0f, 0xf0, 0x1c, 0x4d, 0x2c, 0x40, + 0x71, 0xb0, 0xfe, 0x68, 0x51, 0xaf, 0xc1, 0xf2, 0x99, 0xc1, 0x92, 0x6c, 0x4f, 0x23, 0xc0, 0x1e, + 0xd0, 0x83, 0x5d, 0xe4, 0x3b, 0x88, 0x8f, 0x88, 0x4f, 0x5c, 0x36, 0x21, 0xd7, 0x26, 0x14, 0xf6, + 0x50, 0xcc, 0xd6, 0x90, 0xc0, 0xb7, 0x26, 0x1d, 0x96, 0x24, 0xac, 0x2e, 0xdc, 0xc6, 0xe0, 0x91, + 0x2a, 0x21, 0xa9, 0xf0, 0x57, 0x49, 0x00, 0x22, 0xd4, 0x9e, 0xb9, 0xe3, 0x53, 0x37, 0xb4, 0xa1, + 0xd4, 0x99, 0x50, 0xe4, 0x12, 0x94, 0x7c, 0x34, 0xec, 0xae, 0x1d, 0x52, 0x12, 0x93, 0x9a, 0x08, + 0x64, 0x02, 0xc5, 0xf0, 0xf5, 0xc1, 0x2a, 0x79, 0x71, 0xe0, 0xc7, 0x6f, 0xc2, 0xed, 0x77, 0x9f, + 0xff, 0x59, 0x9b, 0xfa, 0xf9, 0x65, 0xad, 0x61, 0xd9, 0x7c, 0x3f, 0x68, 0xab, 0x06, 0x75, 0xb5, + 0xf8, 0xb1, 0x12, 0xfd, 0xac, 0x32, 0xb3, 0xa3, 0xf1, 0xa3, 0x2e, 0x32, 0xe1, 0xc0, 0xf4, 0x28, + 0xf2, 0x48, 0x9b, 0x11, 0x17, 0xa3, 0x7d, 0xf4, 0x3b, 0x5d, 0xff, 0x6e, 0x06, 0xf2, 0x4d, 0x66, + 0xc9, 0x4f, 0xa0, 0x20, 0xde, 0x22, 0x37, 0x32, 0xbe, 0x31, 0x14, 0x2d, 0xa3, 0x61, 0x72, 0xeb, + 0x7e, 0x2b, 0xc1, 0x95, 0x91, 0xcb, 0xf4, 0xd6, 0x05, 0xee, 0x48, 0xe5, 0x83, 0x0b, 0x38, 0x25, + 0x65, 0x3c, 0x95, 0xe0, 0x72, 0xfa, 0x62, 0xc8, 0x32, 0x7a, 0x53, 0x3e, 0xca, 0xc6, 0xf9, 0x7d, + 0x92, 0x1a, 0x28, 0x94, 0x4e, 0x6f, 0x87, 0x77, 0xce, 0x33, 0xf7, 0x95, 0xf7, 0xce, 0x63, 0x3d, + 0xd4, 0x74, 0x7a, 0x3e, 0x65, 0x69, 0x3a, 0xe5, 0x93, 0xa9, 0xe9, 0x31, 0x33, 0x46, 0xfe, 0x41, + 0x02, 0xf9, 0x8c, 0x09, 0x73, 0x3b, 0x43, 0xc8, 0x51, 0x37, 0x65, 0xf3, 0x42, 0x6e, 0x43, 0x80, + 0xa4, 0xe7, 0x4f, 0x16, 0x40, 0x52, 0x3e, 0x99, 0x00, 0x19, 0x33, 0x64, 0x04, 0x20, 0x67, 0x4c, + 0x98, 0xdb, 0x59, 0x43, 0x0e, 0xb9, 0x65, 0x02, 0x64, 0xfc, 0x1c, 0xd8, 0x7e, 0xf2, 0xfc, 0xb8, + 0x2a, 0xbd, 0x38, 0xae, 0x4a, 0x7f, 0x1d, 0x57, 0xa5, 0x67, 0x27, 0xd5, 0xa9, 0x17, 0x27, 0xd5, + 0xa9, 0x3f, 0x4e, 0xaa, 0x53, 0x5f, 0xec, 0x0c, 0xcc, 0x20, 0x91, 0x62, 0xd5, 0x43, 0x7e, 0x48, + 0xfd, 0x4e, 0xbc, 0x72, 0xd0, 0xb4, 0xd0, 0xd7, 0x7a, 0x63, 0xbe, 0x7b, 0xc4, 0x90, 0x0a, 0xbf, + 0xbe, 0xa6, 0xc5, 0x43, 0xef, 0xd6, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x55, 0x7d, 0x4e, 0x27, + 0xdf, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1139,6 +1244,11 @@ type MsgClient interface { // // Since Revision 3 GovSetFeeParams(ctx context.Context, in *MsgGovSetFeeParams, opts ...grpc.CallOption) (*MsgGovSetFeeParamsResponse, error) + // GovSendFromFeePool is a governance method that allows the sending of the + // marketplace fees. + // + // Since Revision 3 + GovSendFromFeePool(ctx context.Context, in *MsgGovSendFromFeePool, opts ...grpc.CallOption) (*MsgGovSendFromFeePoolResponse, error) } type msgClient struct { @@ -1212,6 +1322,15 @@ func (c *msgClient) GovSetFeeParams(ctx context.Context, in *MsgGovSetFeeParams, return out, nil } +func (c *msgClient) GovSendFromFeePool(ctx context.Context, in *MsgGovSendFromFeePool, opts ...grpc.CallOption) (*MsgGovSendFromFeePoolResponse, error) { + out := new(MsgGovSendFromFeePoolResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1.Msg/GovSendFromFeePool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Sell creates new sell orders. @@ -1235,6 +1354,11 @@ type MsgServer interface { // // Since Revision 3 GovSetFeeParams(context.Context, *MsgGovSetFeeParams) (*MsgGovSetFeeParamsResponse, error) + // GovSendFromFeePool is a governance method that allows the sending of the + // marketplace fees. + // + // Since Revision 3 + GovSendFromFeePool(context.Context, *MsgGovSendFromFeePool) (*MsgGovSendFromFeePoolResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1262,6 +1386,9 @@ func (*UnimplementedMsgServer) RemoveAllowedDenom(ctx context.Context, req *MsgR func (*UnimplementedMsgServer) GovSetFeeParams(ctx context.Context, req *MsgGovSetFeeParams) (*MsgGovSetFeeParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GovSetFeeParams not implemented") } +func (*UnimplementedMsgServer) GovSendFromFeePool(ctx context.Context, req *MsgGovSendFromFeePool) (*MsgGovSendFromFeePoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovSendFromFeePool not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1393,6 +1520,24 @@ func _Msg_GovSetFeeParams_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_GovSendFromFeePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGovSendFromFeePool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GovSendFromFeePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1.Msg/GovSendFromFeePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GovSendFromFeePool(ctx, req.(*MsgGovSendFromFeePool)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "regen.ecocredit.marketplace.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -1425,6 +1570,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "GovSetFeeParams", Handler: _Msg_GovSetFeeParams_Handler, }, + { + MethodName: "GovSendFromFeePool", + Handler: _Msg_GovSendFromFeePool_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "regen/ecocredit/marketplace/v1/tx.proto", @@ -1840,10 +1989,15 @@ func (m *MsgBuyDirect_Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.MaxFeeAmount) > 0 { - i -= len(m.MaxFeeAmount) - copy(dAtA[i:], m.MaxFeeAmount) - i = encodeVarintTx(dAtA, i, uint64(len(m.MaxFeeAmount))) + if m.MaxFeeAmount != nil { + { + size, err := m.MaxFeeAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x42 } @@ -2118,6 +2272,80 @@ func (m *MsgGovSetFeeParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgGovSendFromFeePool) 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 *MsgGovSendFromFeePool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovSendFromFeePool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Coins) > 0 { + for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgGovSendFromFeePoolResponse) 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 *MsgGovSendFromFeePoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovSendFromFeePoolResponse) 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 @@ -2319,8 +2547,8 @@ func (m *MsgBuyDirect_Order) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.MaxFeeAmount) - if l > 0 { + if m.MaxFeeAmount != nil { + l = m.MaxFeeAmount.Size() n += 1 + l + sovTx(uint64(l)) } return n @@ -2420,6 +2648,38 @@ func (m *MsgGovSetFeeParamsResponse) Size() (n int) { return n } +func (m *MsgGovSendFromFeePool) 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 = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Coins) > 0 { + for _, e := range m.Coins { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgGovSendFromFeePoolResponse) 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 } @@ -3704,7 +3964,7 @@ func (m *MsgBuyDirect_Order) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaxFeeAmount", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3714,23 +3974,27 @@ func (m *MsgBuyDirect_Order) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.MaxFeeAmount = string(dAtA[iNdEx:postIndex]) + if m.MaxFeeAmount == nil { + m.MaxFeeAmount = &types.Coin{} + } + if err := m.MaxFeeAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -4350,6 +4614,204 @@ func (m *MsgGovSetFeeParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgGovSendFromFeePool) 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: MsgGovSendFromFeePool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovSendFromFeePool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Coins = append(m.Coins, types.Coin{}) + if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgGovSendFromFeePoolResponse) 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: MsgGovSendFromFeePoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovSendFromFeePoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ecocredit/server/server.go b/x/ecocredit/server/server.go index 958cd0c01d..aa4567f885 100644 --- a/x/ecocredit/server/server.go +++ b/x/ecocredit/server/server.go @@ -17,6 +17,7 @@ import ( "github.com/regen-network/regen-ledger/x/ecocredit/v3/basket" basketkeeper "github.com/regen-network/regen-ledger/x/ecocredit/v3/basket/keeper" baskettypes "github.com/regen-network/regen-ledger/x/ecocredit/v3/basket/types/v1" + "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace" marketkeeper "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/keeper" markettypes "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" ) @@ -55,6 +56,12 @@ func NewServer(storeKey storetypes.StoreKey, panic(fmt.Sprintf("%s module account has not been set", basket.BasketSubModuleName)) } + // ensure marketplace fee pool account is set + marketplaceAddr := s.accountKeeper.GetModuleAddress(marketplace.FeePoolName) + if marketplaceAddr == nil { + panic(fmt.Sprintf("%s module account has not been set", marketplace.FeePoolName)) + } + var err error s.db, err = ormstore.NewStoreKeyDB(&ecocredit.ModuleSchema, storeKey, ormdb.ModuleDBOptions{}) if err != nil { diff --git a/x/ecocredit/server/server_test.go b/x/ecocredit/server/server_test.go index ac4519a36c..5027ef0b92 100644 --- a/x/ecocredit/server/server_test.go +++ b/x/ecocredit/server/server_test.go @@ -22,6 +22,7 @@ import ( "github.com/regen-network/regen-ledger/types/v2/testutil/fixture" "github.com/regen-network/regen-ledger/x/ecocredit/v3" "github.com/regen-network/regen-ledger/x/ecocredit/v3/basket" + "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace" "github.com/regen-network/regen-ledger/x/ecocredit/v3/module" "github.com/regen-network/regen-ledger/x/ecocredit/v3/server/testsuite" ) @@ -69,6 +70,7 @@ func setup(t *testing.T) (fixture.Factory, bankkeeper.BaseKeeper, authkeeper.Acc minttypes.ModuleName: {authtypes.Minter}, ecocredit.ModuleName: {authtypes.Burner}, basket.BasketSubModuleName: {authtypes.Burner, authtypes.Minter}, + marketplace.FeePoolName: {authtypes.Burner}, } accountKeeper := authkeeper.NewAccountKeeper( diff --git a/x/ecocredit/server/tests/features/market.feature b/x/ecocredit/server/tests/features/market.feature index 5fa9a5a8cd..452a656383 100644 --- a/x/ecocredit/server/tests/features/market.feature +++ b/x/ecocredit/server/tests/features/market.feature @@ -162,7 +162,11 @@ Feature: Market Integration And expect event buy """ { - "sell_order_id": "1" + "sell_order_id": "1", + "seller":"regen1q5m97jdcksj24g9enlkjqq75ygt5q6akfm0ycv", + "seller_fee_paid":{"denom":"uregen","amount":"0"}, + "buyer":"regen1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxwj8p42", + "buyer_fee_paid":{"denom":"uregen","amount":"0"} } """ And expect query balance with address "regen1q5m97jdcksj24g9enlkjqq75ygt5q6akfm0ycv" and batch denom "C01-001-20200101-20210101-001" @@ -272,7 +276,11 @@ Feature: Market Integration And expect event buy """ { - "sell_order_id": "1" + "sell_order_id": "1", + "seller":"regen1q5m97jdcksj24g9enlkjqq75ygt5q6akfm0ycv", + "seller_fee_paid":{"denom":"uregen","amount":"0"}, + "buyer":"regen1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxwj8p42", + "buyer_fee_paid":{"denom":"uregen","amount":"0"} } """ And expect query balance with address "regen1q5m97jdcksj24g9enlkjqq75ygt5q6akfm0ycv" and batch denom "C01-001-20200101-20210101-001" @@ -699,7 +707,11 @@ Feature: Market Integration And expect event buy """ { - "sell_order_id": "1" + "sell_order_id": "1", + "seller":"regen1q5m97jdcksj24g9enlkjqq75ygt5q6akfm0ycv", + "seller_fee_paid":{"denom":"uregen","amount":"0"}, + "buyer":"regen1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxwj8p42", + "buyer_fee_paid":{"denom":"uregen","amount":"0"} } """ And expect query balance with address "regen1q5m97jdcksj24g9enlkjqq75ygt5q6akfm0ycv" and batch denom "C01-001-20200101-20210101-001" @@ -842,7 +854,11 @@ Feature: Market Integration And expect event buy """ { - "sell_order_id": "2" + "sell_order_id": "2", + "seller":"regen1q5m97jdcksj24g9enlkjqq75ygt5q6akfm0ycv", + "seller_fee_paid":{"denom":"uregen","amount":"0"}, + "buyer":"regen1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxwj8p42", + "buyer_fee_paid":{"denom":"uregen","amount":"0"} } """ And expect query balance with address "regen1q5m97jdcksj24g9enlkjqq75ygt5q6akfm0ycv" and batch denom "C01-001-20200101-20210101-001" diff --git a/x/ecocredit/server/tests/utils.go b/x/ecocredit/server/tests/utils.go index 843fc1de94..66207a9cc5 100644 --- a/x/ecocredit/server/tests/utils.go +++ b/x/ecocredit/server/tests/utils.go @@ -18,6 +18,7 @@ import ( ecocredittypes "github.com/regen-network/regen-ledger/x/ecocredit/v3" basetypes "github.com/regen-network/regen-ledger/x/ecocredit/v3/base/types/v1" "github.com/regen-network/regen-ledger/x/ecocredit/v3/basket" + "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace" markettypes "github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace/types/v1" ecocredit "github.com/regen-network/regen-ledger/x/ecocredit/v3/module" ) @@ -62,6 +63,7 @@ func NewEcocreditModule(ff fixture.Factory) *ecocredit.Module { minttypes.ModuleName: {authtypes.Minter}, ecocredittypes.ModuleName: {authtypes.Burner}, basket.BasketSubModuleName: {authtypes.Burner, authtypes.Minter}, + marketplace.FeePoolName: {authtypes.Burner}, } accountKeeper := authkeeper.NewAccountKeeper(