diff --git a/api/feemarket/feemarket/module/v1/module.pulsar.go b/api/feemarket/feemarket/module/v1/module.pulsar.go index 0f2df295..577c0ae7 100644 --- a/api/feemarket/feemarket/module/v1/module.pulsar.go +++ b/api/feemarket/feemarket/module/v1/module.pulsar.go @@ -14,14 +14,16 @@ import ( ) var ( - md_Module protoreflect.MessageDescriptor - fd_Module_authority protoreflect.FieldDescriptor + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor + fd_Module_fee_recipient_module protoreflect.FieldDescriptor ) func init() { file_feemarket_feemarket_module_v1_module_proto_init() md_Module = File_feemarket_feemarket_module_v1_module_proto.Messages().ByName("Module") fd_Module_authority = md_Module.Fields().ByName("authority") + fd_Module_fee_recipient_module = md_Module.Fields().ByName("fee_recipient_module") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -95,6 +97,12 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.FeeRecipientModule != "" { + value := protoreflect.ValueOfString(x.FeeRecipientModule) + if !f(fd_Module_fee_recipient_module, value) { + return + } + } } // Has reports whether a field is populated. @@ -112,6 +120,8 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": return x.Authority != "" + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + return x.FeeRecipientModule != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -130,6 +140,8 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": x.Authority = "" + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + x.FeeRecipientModule = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -149,6 +161,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro case "feemarket.feemarket.module.v1.Module.authority": value := x.Authority return protoreflect.ValueOfString(value) + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + value := x.FeeRecipientModule + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -171,6 +186,8 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": x.Authority = value.Interface().(string) + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + x.FeeRecipientModule = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -193,6 +210,8 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": panic(fmt.Errorf("field authority of message feemarket.feemarket.module.v1.Module is not mutable")) + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + panic(fmt.Errorf("field fee_recipient_module of message feemarket.feemarket.module.v1.Module is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -208,6 +227,8 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": return protoreflect.ValueOfString("") + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -281,6 +302,10 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.FeeRecipientModule) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -310,6 +335,13 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.FeeRecipientModule) > 0 { + i -= len(x.FeeRecipientModule) + copy(dAtA[i:], x.FeeRecipientModule) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeeRecipientModule))) + i-- + dAtA[i] = 0x12 + } if len(x.Authority) > 0 { i -= len(x.Authority) copy(dAtA[i:], x.Authority) @@ -398,6 +430,38 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { } 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 FeeRecipientModule", 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.FeeRecipientModule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -455,6 +519,8 @@ type Module struct { // Authority defines the custom module authority. If not set, defaults to the // governance module. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // FeeRecipientModule defines the custom module account that the fee will be sent to. + FeeRecipientModule string `protobuf:"bytes,2,opt,name=fee_recipient_module,json=feeRecipientModule,proto3" json:"fee_recipient_module,omitempty"` } func (x *Module) Reset() { @@ -484,6 +550,13 @@ func (x *Module) GetAuthority() string { return "" } +func (x *Module) GetFeeRecipientModule() string { + if x != nil { + return x.FeeRecipientModule + } + return "" +} + var File_feemarket_feemarket_module_v1_module_proto protoreflect.FileDescriptor var file_feemarket_feemarket_module_v1_module_proto_rawDesc = []byte{ @@ -493,30 +566,33 @@ var file_feemarket_feemarket_module_v1_module_proto_rawDesc = []byte{ 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, - 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 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, 0x3a, 0x31, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2b, 0x0a, 0x29, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6b, 0x69, 0x70, 0x2d, 0x6d, - 0x65, 0x76, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x78, 0x2f, 0x66, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x42, 0x80, 0x02, 0x0a, 0x21, 0x63, 0x6f, 0x6d, - 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x4d, 0xaa, 0x02, 0x1d, 0x46, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1d, 0x46, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x29, 0x46, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x20, 0x46, 0x65, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, - 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x01, + 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 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, 0x30, 0x0a, 0x14, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x31, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2b, + 0x0a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6b, 0x69, + 0x70, 0x2d, 0x6d, 0x65, 0x76, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, + 0x78, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x42, 0x80, 0x02, 0x0a, 0x21, + 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x66, 0x65, 0x65, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x4d, 0xaa, + 0x02, 0x1d, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x1d, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x29, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x20, 0x46, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/feemarket/feemarket/v1/params.pulsar.go b/api/feemarket/feemarket/v1/params.pulsar.go index c288cb50..72a23c04 100644 --- a/api/feemarket/feemarket/v1/params.pulsar.go +++ b/api/feemarket/feemarket/v1/params.pulsar.go @@ -28,6 +28,7 @@ var ( fd_Params_fee_denom protoreflect.FieldDescriptor fd_Params_enabled protoreflect.FieldDescriptor fd_Params_distribute_fees protoreflect.FieldDescriptor + fd_Params_send_tip_to_proposer protoreflect.FieldDescriptor ) func init() { @@ -45,6 +46,7 @@ func init() { fd_Params_fee_denom = md_Params.Fields().ByName("fee_denom") fd_Params_enabled = md_Params.Fields().ByName("enabled") fd_Params_distribute_fees = md_Params.Fields().ByName("distribute_fees") + fd_Params_send_tip_to_proposer = md_Params.Fields().ByName("send_tip_to_proposer") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -184,6 +186,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.SendTipToProposer != false { + value := protoreflect.ValueOfBool(x.SendTipToProposer) + if !f(fd_Params_send_tip_to_proposer, value) { + return + } + } } // Has reports whether a field is populated. @@ -223,6 +231,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.Enabled != false case "feemarket.feemarket.v1.Params.distribute_fees": return x.DistributeFees != false + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + return x.SendTipToProposer != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -263,6 +273,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.Enabled = false case "feemarket.feemarket.v1.Params.distribute_fees": x.DistributeFees = false + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + x.SendTipToProposer = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -315,6 +327,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "feemarket.feemarket.v1.Params.distribute_fees": value := x.DistributeFees return protoreflect.ValueOfBool(value) + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + value := x.SendTipToProposer + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -359,6 +374,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.Enabled = value.Bool() case "feemarket.feemarket.v1.Params.distribute_fees": x.DistributeFees = value.Bool() + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + x.SendTipToProposer = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -403,6 +420,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field enabled of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.distribute_fees": panic(fmt.Errorf("field distribute_fees of message feemarket.feemarket.v1.Params is not mutable")) + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + panic(fmt.Errorf("field send_tip_to_proposer of message feemarket.feemarket.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -440,6 +459,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfBool(false) case "feemarket.feemarket.v1.Params.distribute_fees": return protoreflect.ValueOfBool(false) + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -553,6 +574,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.DistributeFees { n += 2 } + if x.SendTipToProposer { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -582,6 +606,16 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.SendTipToProposer { + i-- + if x.SendTipToProposer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } if x.DistributeFees { i-- if x.DistributeFees { @@ -1051,6 +1085,26 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } x.DistributeFees = bool(v != 0) + case 13: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SendTipToProposer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.SendTipToProposer = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1147,6 +1201,9 @@ type Params struct { // DistributeFees is a boolean that determines whether the fees are burned or // distributed to all stakers. DistributeFees bool `protobuf:"varint,12,opt,name=distribute_fees,json=distributeFees,proto3" json:"distribute_fees,omitempty"` + // SendTipToProposer is a boolean that determines whether the tip is sent to a + // proposer or to a module account. + SendTipToProposer bool `protobuf:"varint,13,opt,name=send_tip_to_proposer,json=sendTipToProposer,proto3" json:"send_tip_to_proposer,omitempty"` } func (x *Params) Reset() { @@ -1253,6 +1310,13 @@ func (x *Params) GetDistributeFees() bool { return false } +func (x *Params) GetSendTipToProposer() bool { + if x != nil { + return x.SendTipToProposer + } + return false +} + var File_feemarket_feemarket_v1_params_proto protoreflect.FileDescriptor var file_feemarket_feemarket_v1_params_proto_rawDesc = []byte{ @@ -1262,8 +1326,8 @@ var file_feemarket_feemarket_v1_params_proto_rawDesc = []byte{ 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 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, 0x22, 0xf4, - 0x05, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x61, 0x6c, 0x70, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, + 0x06, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, @@ -1310,21 +1374,24 @@ var file_feemarket_feemarket_v1_params_proto_rawDesc = []byte{ 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x46, 0x65, 0x65, 0x73, 0x42, 0xd8, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x65, - 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, - 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, - 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x22, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x46, 0x65, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, + 0x70, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x70, 0x54, 0x6f, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x42, 0xd8, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x66, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, + 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x22, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/feemarket/feemarket/v1/query_grpc.pb.go b/api/feemarket/feemarket/v1/query_grpc.pb.go index 804edad3..54713f3d 100644 --- a/api/feemarket/feemarket/v1/query_grpc.pb.go +++ b/api/feemarket/feemarket/v1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: feemarket/feemarket/v1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/feemarket.feemarket.v1.Query/Params" @@ -93,7 +93,7 @@ func (c *queryClient) GasPrices(ctx context.Context, in *GasPricesRequest, opts // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. // // Query Service for the feemarket module. type QueryServer interface { @@ -110,9 +110,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *ParamsRequest) (*ParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -127,6 +130,7 @@ func (UnimplementedQueryServer) GasPrices(context.Context, *GasPricesRequest) (* return nil, status.Errorf(codes.Unimplemented, "method GasPrices not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -136,6 +140,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/feemarket/feemarket/v1/tx_grpc.pb.go b/api/feemarket/feemarket/v1/tx_grpc.pb.go index f21094db..b8b5822c 100644 --- a/api/feemarket/feemarket/v1/tx_grpc.pb.go +++ b/api/feemarket/feemarket/v1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: feemarket/feemarket/v1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_Params_FullMethodName = "/feemarket.feemarket.v1.Msg/Params" @@ -53,7 +53,7 @@ func (c *msgClient) Params(ctx context.Context, in *MsgParams, opts ...grpc.Call // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. // // Message service defines the types of messages supported by the feemarket // module. @@ -63,14 +63,18 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) Params(context.Context, *MsgParams) (*MsgParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -80,6 +84,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/proto/feemarket/feemarket/module/v1/module.proto b/proto/feemarket/feemarket/module/v1/module.proto index 9bddd032..48f92c0e 100644 --- a/proto/feemarket/feemarket/module/v1/module.proto +++ b/proto/feemarket/feemarket/module/v1/module.proto @@ -13,4 +13,7 @@ message Module { // Authority defines the custom module authority. If not set, defaults to the // governance module. string authority = 1; + + // FeeRecipientModule defines the custom module account that the fee will be sent to. + string fee_recipient_module = 2; } diff --git a/proto/feemarket/feemarket/v1/params.proto b/proto/feemarket/feemarket/v1/params.proto index 5acafb93..864aa738 100644 --- a/proto/feemarket/feemarket/v1/params.proto +++ b/proto/feemarket/feemarket/v1/params.proto @@ -90,10 +90,7 @@ message Params { // distributed to all stakers. bool distribute_fees = 12; - // FeeRecipientModule is a module account that the fee will be sent to. - string fee_recipient_module = 13; - // SendTipToProposer is a boolean that determines whether the tip is sent to a // proposer or to a module account. - bool send_tip_to_proposer = 14; + bool send_tip_to_proposer = 13; } diff --git a/tests/app/app.go b/tests/app/app.go index f5aab81f..b7bd46b4 100644 --- a/tests/app/app.go +++ b/tests/app/app.go @@ -370,7 +370,7 @@ func NewSimApp( ), ) - app.FeeMarketKeeper = feemarketkeeper.NewKeeper(appCodec, keys[feemarkettypes.StoreKey], app.AccountKeeper, &feemarkettypes.TestDenomResolver{}, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.FeeMarketKeeper = feemarketkeeper.NewKeeper(appCodec, keys[feemarkettypes.StoreKey], app.AccountKeeper, &feemarkettypes.TestDenomResolver{}, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authtypes.FeeCollectorName) /**** Module Options ****/ diff --git a/testutils/keeper/keeper.go b/testutils/keeper/keeper.go index 6f15b494..5e3fbc15 100644 --- a/testutils/keeper/keeper.go +++ b/testutils/keeper/keeper.go @@ -85,5 +85,6 @@ func FeeMarket( authKeeper, &feemarkettypes.TestDenomResolver{}, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + authtypes.FeeCollectorName, ) } diff --git a/x/feemarket/keeper/keeper.go b/x/feemarket/keeper/keeper.go index f5bcb515..193117ec 100644 --- a/x/feemarket/keeper/keeper.go +++ b/x/feemarket/keeper/keeper.go @@ -22,7 +22,8 @@ type Keeper struct { // The address that is capable of executing a MsgParams message. // Typically, this will be the governance module's address. - authority string + authority string + feeRecipientModule string } // NewKeeper constructs a new feemarket keeper. @@ -32,20 +33,24 @@ func NewKeeper( authKeeper types.AccountKeeper, resolver types.DenomResolver, authority string, + feeRecipientModule string, ) *Keeper { if _, err := sdk.AccAddressFromBech32(authority); err != nil { panic(fmt.Sprintf("invalid authority address: %s", authority)) } - k := &Keeper{ - cdc: cdc, - storeKey: storeKey, - ak: authKeeper, - resolver: resolver, - authority: authority, + if recipientAddr := authKeeper.GetModuleAddress(feeRecipientModule); recipientAddr == nil { + panic(fmt.Sprintf("%s module account has not been set", feeRecipientModule)) } - return k + return &Keeper{ + cdc: cdc, + storeKey: storeKey, + ak: authKeeper, + resolver: resolver, + authority: authority, + feeRecipientModule: feeRecipientModule, + } } // Logger returns a feemarket module-specific logger. @@ -58,6 +63,11 @@ func (k *Keeper) GetAuthority() string { return k.authority } +// GetFeeRecipientModule returns the module account that the fee will be sent to. +func (k *Keeper) GetFeeRecipientModule() string { + return k.feeRecipientModule +} + // GetEnabledHeight returns the height at which the feemarket was enabled. func (k *Keeper) GetEnabledHeight(ctx sdk.Context) (int64, error) { store := ctx.KVStore(k.storeKey) diff --git a/x/feemarket/module.go b/x/feemarket/module.go index 4f01b64d..83a1297d 100644 --- a/x/feemarket/module.go +++ b/x/feemarket/module.go @@ -177,8 +177,9 @@ type Outputs struct { func ProvideModule(in Inputs) Outputs { var ( - authority sdk.AccAddress - err error + authority sdk.AccAddress + feeRecipientModule string + err error ) if in.Config.Authority != "" { authority, err = sdk.AccAddressFromBech32(in.Config.Authority) @@ -189,12 +190,19 @@ func ProvideModule(in Inputs) Outputs { authority = authtypes.NewModuleAddress(govtypes.ModuleName) } + if in.Config.FeeRecipientModule != "" { + feeRecipientModule = in.Config.FeeRecipientModule + } else { + feeRecipientModule = authtypes.FeeCollectorName + } + Keeper := keeper.NewKeeper( in.Cdc, in.Key, in.AccountKeeper, nil, authority.String(), + feeRecipientModule, ) m := NewAppModule(in.Cdc, *Keeper) diff --git a/x/feemarket/post/expected_keeper.go b/x/feemarket/post/expected_keeper.go index a7596565..64d7f1d1 100644 --- a/x/feemarket/post/expected_keeper.go +++ b/x/feemarket/post/expected_keeper.go @@ -44,4 +44,5 @@ type FeeMarketKeeper interface { ResolveToDenom(ctx sdk.Context, coin sdk.DecCoin, denom string) (sdk.DecCoin, error) GetMinGasPrice(ctx sdk.Context, denom string) (sdk.DecCoin, error) GetEnabledHeight(ctx sdk.Context) (int64, error) + GetFeeRecipientModule() string } diff --git a/x/feemarket/post/fee.go b/x/feemarket/post/fee.go index e9c25e0e..9c81f87a 100644 --- a/x/feemarket/post/fee.go +++ b/x/feemarket/post/fee.go @@ -9,7 +9,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/skip-mev/feemarket/x/feemarket/ante" feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" @@ -158,9 +157,11 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sd var events sdk.Events + feeRecipientModule := dfd.feemarketKeeper.GetFeeRecipientModule() + // deduct the fees and tip if !fee.IsNil() { - err := DeductCoins(dfd.bankKeeper, ctx, sdk.NewCoins(fee), params.FeeRecipientModule, params.DistributeFees) + err := DeductCoins(dfd.bankKeeper, ctx, sdk.NewCoins(fee), feeRecipientModule, params.DistributeFees) if err != nil { return err } @@ -173,7 +174,7 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sd proposer := sdk.AccAddress(ctx.BlockHeader().ProposerAddress) if !tip.IsNil() { - tipPayee, err := SendTip(dfd.bankKeeper, ctx, params.SendTipToProposer, params.FeeRecipientModule, proposer, sdk.NewCoins(tip)) + tipPayee, err := SendTip(dfd.bankKeeper, ctx, params.SendTipToProposer, feeRecipientModule, proposer, sdk.NewCoins(tip)) if err != nil { return err } @@ -190,20 +191,15 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sd } // DeductCoins deducts coins from the given account. -// Coins can be sent to the default fee collector (causes coins to be distributed to stakers), -// to the module account or kept in the fee collector account (soft burn). -func DeductCoins(bankKeeper BankKeeper, ctx sdk.Context, coins sdk.Coins, recipientModule string, distributeFees bool) error { +// Coins can be sent to the module account (causes coins to be distributed to stakers), +// or kept in the fee collector account (soft burn). +func DeductCoins(bankKeeper BankKeeper, ctx sdk.Context, coins sdk.Coins, feeRecipientModule string, distributeFees bool) error { if distributeFees { - recipientModule = authtypes.FeeCollectorName - } - - if recipientModule != "" { - err := bankKeeper.SendCoinsFromModuleToModule(ctx, feemarkettypes.FeeCollectorName, recipientModule, coins) + err := bankKeeper.SendCoinsFromModuleToModule(ctx, feemarkettypes.FeeCollectorName, feeRecipientModule, coins) if err != nil { return err } } - return nil } @@ -212,19 +208,19 @@ func SendTip( bankKeeper BankKeeper, ctx sdk.Context, sendToProposer bool, - recipientModule string, + feeRecipientModule string, proposer sdk.AccAddress, coins sdk.Coins, ) (string, error) { var err error - tipPayee := recipientModule + tipPayee := feeRecipientModule if sendToProposer { err = bankKeeper.SendCoinsFromModuleToAccount(ctx, feemarkettypes.FeeCollectorName, proposer, coins) tipPayee = proposer.String() } else { - err = bankKeeper.SendCoinsFromModuleToModule(ctx, feemarkettypes.FeeCollectorName, recipientModule, coins) + err = bankKeeper.SendCoinsFromModuleToModule(ctx, feemarkettypes.FeeCollectorName, feeRecipientModule, coins) } if err != nil { diff --git a/x/feemarket/post/fee_test.go b/x/feemarket/post/fee_test.go index e5db0fe3..96b2bcc1 100644 --- a/x/feemarket/post/fee_test.go +++ b/x/feemarket/post/fee_test.go @@ -35,7 +35,7 @@ func TestDeductCoins(t *testing.T) { { name: "valid no coins", coins: sdk.NewCoins(), - recipientModule: "", + recipientModule: "test_fee_collector", distributeFees: false, wantErr: false, }, @@ -49,21 +49,21 @@ func TestDeductCoins(t *testing.T) { { name: "valid - distribute", coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), - recipientModule: "", + recipientModule: "test_fee_collector", distributeFees: true, wantErr: false, }, { name: "valid no coins - distribute", coins: sdk.NewCoins(), - recipientModule: "", + recipientModule: "test_fee_collector", distributeFees: true, wantErr: false, }, { name: "valid zero coin - distribute", coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), - recipientModule: "", + recipientModule: "test_fee_collector", distributeFees: true, wantErr: false, }, @@ -72,10 +72,6 @@ func TestDeductCoins(t *testing.T) { t.Run(fmt.Sprintf("Case %s", tc.name), func(t *testing.T) { s := antesuite.SetupTestSuite(t, true) if tc.distributeFees { - s.MockBankKeeper.On("SendCoinsFromModuleToModule", s.Ctx, types.FeeCollectorName, - authtypes.FeeCollectorName, - tc.coins).Return(nil).Once() - } else if tc.recipientModule != "" { s.MockBankKeeper.On("SendCoinsFromModuleToModule", s.Ctx, types.FeeCollectorName, tc.recipientModule, tc.coins).Return(nil).Once() @@ -90,33 +86,38 @@ func TestDeductCoins(t *testing.T) { func TestDeductCoinsAndDistribute(t *testing.T) { tests := []struct { - name string - coins sdk.Coins - wantErr bool + name string + coins sdk.Coins + recipientModule string + wantErr bool }{ { - name: "valid", - coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), - wantErr: false, + name: "valid", + coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), + recipientModule: "test_fee_collector", + wantErr: false, }, { - name: "valid no coins", - coins: sdk.NewCoins(), - wantErr: false, + name: "valid no coins", + coins: sdk.NewCoins(), + recipientModule: "test_fee_collector", + wantErr: false, }, { - name: "valid zero coin", - coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), - wantErr: false, + name: "valid zero coin", + coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), + recipientModule: "test_fee_collector", + wantErr: false, }, } for _, tc := range tests { t.Run(fmt.Sprintf("Case %s", tc.name), func(t *testing.T) { s := antesuite.SetupTestSuite(t, true) - s.MockBankKeeper.On("SendCoinsFromModuleToModule", s.Ctx, types.FeeCollectorName, authtypes.FeeCollectorName, + s.MockBankKeeper.On("SendCoinsFromModuleToModule", s.Ctx, types.FeeCollectorName, + tc.recipientModule, tc.coins).Return(nil).Once() - if err := post.DeductCoins(s.MockBankKeeper, s.Ctx, tc.coins, "", true); (err != nil) != tc.wantErr { + if err := post.DeductCoins(s.MockBankKeeper, s.Ctx, tc.coins, tc.recipientModule, true); (err != nil) != tc.wantErr { s.Errorf(err, "DeductCoins() error = %v, wantErr %v", err, tc.wantErr) } }) diff --git a/x/feemarket/post/mocks/mock_feemarket_keeper.go b/x/feemarket/post/mocks/mock_feemarket_keeper.go index 0d69365b..bd3cf820 100644 --- a/x/feemarket/post/mocks/mock_feemarket_keeper.go +++ b/x/feemarket/post/mocks/mock_feemarket_keeper.go @@ -43,6 +43,24 @@ func (_m *FeeMarketKeeper) GetEnabledHeight(ctx types.Context) (int64, error) { return r0, r1 } +// GetFeeRecipientModule provides a mock function with given fields: +func (_m *FeeMarketKeeper) GetFeeRecipientModule() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetFeeRecipientModule") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + // GetMinGasPrice provides a mock function with given fields: ctx, denom func (_m *FeeMarketKeeper) GetMinGasPrice(ctx types.Context, denom string) (types.DecCoin, error) { ret := _m.Called(ctx, denom) diff --git a/x/feemarket/types/eip1559.go b/x/feemarket/types/eip1559.go index f466fad2..d381cd85 100644 --- a/x/feemarket/types/eip1559.go +++ b/x/feemarket/types/eip1559.go @@ -61,7 +61,6 @@ func DefaultParams() Params { DefaultFeeDenom, true, false, - "", true, ) } diff --git a/x/feemarket/types/eip1559_aimd.go b/x/feemarket/types/eip1559_aimd.go index b7c09ac2..c173b0ea 100644 --- a/x/feemarket/types/eip1559_aimd.go +++ b/x/feemarket/types/eip1559_aimd.go @@ -69,7 +69,6 @@ func DefaultAIMDParams() Params { DefaultAIMDFeeDenom, true, false, - "", true, ) } diff --git a/x/feemarket/types/params.go b/x/feemarket/types/params.go index 79da4b8d..252d9da0 100644 --- a/x/feemarket/types/params.go +++ b/x/feemarket/types/params.go @@ -21,7 +21,6 @@ func NewParams( feeDenom string, enabled bool, distributeFees bool, - feeRecipientModule string, sendTipToProposer bool, ) Params { return Params{ @@ -37,7 +36,6 @@ func NewParams( FeeDenom: feeDenom, Enabled: enabled, DistributeFees: distributeFees, - FeeRecipientModule: feeRecipientModule, SendTipToProposer: sendTipToProposer, } } @@ -88,10 +86,6 @@ func (p *Params) ValidateBasic() error { return fmt.Errorf("fee denom must be set") } - if !p.SendTipToProposer && p.FeeRecipientModule == "" { - return fmt.Errorf("fee recipient module must be set in order to send tip") - } - return nil } diff --git a/x/feemarket/types/params.pb.go b/x/feemarket/types/params.pb.go index 0e603809..5388598c 100644 --- a/x/feemarket/types/params.pb.go +++ b/x/feemarket/types/params.pb.go @@ -69,11 +69,9 @@ type Params struct { // DistributeFees is a boolean that determines whether the fees are burned or // distributed to all stakers. DistributeFees bool `protobuf:"varint,12,opt,name=distribute_fees,json=distributeFees,proto3" json:"distribute_fees,omitempty"` - // FeeRecipientModule is a module account that the fee will be sent to. - FeeRecipientModule string `protobuf:"bytes,13,opt,name=fee_recipient_module,json=feeRecipientModule,proto3" json:"fee_recipient_module,omitempty"` // SendTipToProposer is a boolean that determines whether the tip is sent to a // proposer or to a module account. - SendTipToProposer bool `protobuf:"varint,14,opt,name=send_tip_to_proposer,json=sendTipToProposer,proto3" json:"send_tip_to_proposer,omitempty"` + SendTipToProposer bool `protobuf:"varint,13,opt,name=send_tip_to_proposer,json=sendTipToProposer,proto3" json:"send_tip_to_proposer,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -144,13 +142,6 @@ func (m *Params) GetDistributeFees() bool { return false } -func (m *Params) GetFeeRecipientModule() string { - if m != nil { - return m.FeeRecipientModule - } - return "" -} - func (m *Params) GetSendTipToProposer() bool { if m != nil { return m.SendTipToProposer @@ -167,39 +158,37 @@ func init() { } var fileDescriptor_3907de4df2e1c66e = []byte{ - // 501 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0x63, 0x48, 0xd3, 0x64, 0x81, 0x56, 0x5d, 0x42, 0xb5, 0xb4, 0x92, 0x1b, 0xc1, 0x81, - 0x5c, 0x1a, 0x13, 0x78, 0x83, 0x28, 0x50, 0x21, 0x15, 0x29, 0xb2, 0xca, 0x05, 0x09, 0xac, 0xb1, - 0x3d, 0x71, 0x56, 0xf1, 0x7a, 0x2d, 0xef, 0x26, 0x4d, 0x79, 0x0a, 0x1e, 0x86, 0x87, 0xe8, 0xb1, - 0xe2, 0x02, 0xe2, 0x50, 0xa1, 0xe4, 0x45, 0xd0, 0xae, 0x53, 0x52, 0x38, 0xba, 0xb7, 0xf9, 0xe7, - 0x9f, 0xff, 0xdb, 0xd1, 0x4a, 0x43, 0x9e, 0x8f, 0x11, 0x05, 0x14, 0x53, 0xd4, 0xde, 0xa6, 0x9a, - 0xf7, 0xbd, 0x1c, 0x0a, 0x10, 0xaa, 0x97, 0x17, 0x52, 0x4b, 0xba, 0xff, 0xd7, 0xea, 0x6d, 0xaa, - 0x79, 0xff, 0xe0, 0x69, 0x24, 0x95, 0x90, 0x2a, 0xb0, 0x53, 0x5e, 0x29, 0xca, 0xc8, 0x41, 0x3b, - 0x91, 0x89, 0x2c, 0xfb, 0xa6, 0x2a, 0xbb, 0xcf, 0x7e, 0x34, 0x48, 0x63, 0x64, 0xc9, 0xf4, 0x84, - 0x6c, 0x41, 0x9a, 0x4f, 0x80, 0x39, 0x1d, 0xa7, 0xdb, 0x1a, 0xf4, 0x2f, 0xaf, 0x8f, 0x6a, 0xbf, - 0xae, 0x8f, 0x0e, 0x4b, 0x8a, 0x8a, 0xa7, 0x3d, 0x2e, 0x3d, 0x01, 0x7a, 0xd2, 0x3b, 0xc5, 0x04, - 0xa2, 0x8b, 0x21, 0x46, 0xdf, 0xbf, 0x1d, 0x93, 0xf5, 0x23, 0x43, 0x8c, 0xfc, 0x32, 0x4f, 0xdf, - 0x90, 0x7a, 0x88, 0x1a, 0xd8, 0xbd, 0xaa, 0x1c, 0x1b, 0x37, 0xfb, 0x24, 0x20, 0x04, 0xb0, 0xfb, - 0x95, 0xf7, 0xb1, 0x79, 0x03, 0x8a, 0x31, 0xd5, 0xc0, 0xea, 0x95, 0x41, 0x36, 0x4f, 0x3f, 0x13, - 0x2a, 0x78, 0x16, 0x84, 0xa0, 0x30, 0x48, 0xc0, 0xfc, 0x32, 0x8f, 0x90, 0x6d, 0x55, 0xa5, 0xee, - 0x0a, 0x9e, 0x0d, 0x40, 0xe1, 0x09, 0xa8, 0x91, 0x21, 0xd1, 0x4f, 0x64, 0xcf, 0xf0, 0x53, 0x84, - 0x22, 0xe3, 0x59, 0x12, 0x14, 0xa0, 0x91, 0x35, 0xee, 0x82, 0x3f, 0x5d, 0xa3, 0x7c, 0xd0, 0x25, - 0x1e, 0x16, 0xff, 0xe1, 0xb7, 0xab, 0xe3, 0x61, 0xf1, 0x0f, 0xfe, 0x15, 0x79, 0x62, 0xf0, 0x61, - 0x2a, 0xa3, 0x69, 0x30, 0xd3, 0x3c, 0xe5, 0x5f, 0x40, 0x73, 0x99, 0xb1, 0x66, 0xc7, 0xe9, 0xd6, - 0xfd, 0xc7, 0x02, 0x16, 0x03, 0xe3, 0x7d, 0xd8, 0x58, 0x74, 0x9f, 0x34, 0xce, 0x79, 0x16, 0xcb, - 0x73, 0xd6, 0xb2, 0x43, 0x6b, 0x45, 0x0f, 0x49, 0x6b, 0x8c, 0x18, 0xc4, 0x98, 0x49, 0xc1, 0x88, - 0x59, 0xd1, 0x6f, 0x8e, 0x11, 0x87, 0x46, 0x53, 0x46, 0xb6, 0x31, 0x83, 0x30, 0xc5, 0x98, 0x3d, - 0xe8, 0x38, 0xdd, 0xa6, 0x7f, 0x23, 0xe9, 0x0b, 0xb2, 0x1b, 0x73, 0xa5, 0x0b, 0x1e, 0xce, 0x34, - 0x06, 0x63, 0x44, 0xc5, 0x1e, 0xda, 0x89, 0x9d, 0x4d, 0xfb, 0x2d, 0xa2, 0xa2, 0x2f, 0x49, 0xdb, - 0xf0, 0x0b, 0x8c, 0x78, 0xce, 0x31, 0xd3, 0x81, 0x90, 0xf1, 0x2c, 0x45, 0xf6, 0xc8, 0x3e, 0x45, - 0xc7, 0x88, 0xfe, 0x8d, 0xf5, 0xde, 0x3a, 0xd4, 0x23, 0x6d, 0x85, 0x59, 0x1c, 0x68, 0x9e, 0x07, - 0x5a, 0x9a, 0x03, 0xcb, 0xa5, 0xc2, 0x82, 0xed, 0x58, 0xfe, 0x9e, 0xf1, 0xce, 0x78, 0x7e, 0x26, - 0x47, 0x6b, 0x63, 0xf0, 0xee, 0x72, 0xe9, 0x3a, 0x57, 0x4b, 0xd7, 0xf9, 0xbd, 0x74, 0x9d, 0xaf, - 0x2b, 0xb7, 0x76, 0xb5, 0x72, 0x6b, 0x3f, 0x57, 0x6e, 0xed, 0xa3, 0x97, 0x70, 0x3d, 0x99, 0x85, - 0xbd, 0x48, 0x0a, 0x4f, 0x4d, 0x79, 0x7e, 0x2c, 0x70, 0x7e, 0xeb, 0xd6, 0x17, 0xb7, 0x6a, 0x7d, - 0x91, 0xa3, 0x0a, 0x1b, 0xf6, 0x56, 0x5f, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x47, 0xa4, - 0x14, 0x1b, 0x04, 0x00, 0x00, + // 478 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xcf, 0x6e, 0xd3, 0x4c, + 0x14, 0xc5, 0xe3, 0xef, 0x4b, 0xdd, 0x64, 0xf8, 0x53, 0x75, 0x28, 0xd5, 0xd0, 0x4a, 0x6e, 0x04, + 0x0b, 0xb2, 0xa9, 0xad, 0xc0, 0x1b, 0x44, 0x81, 0x0a, 0xa9, 0x8b, 0xc8, 0x2a, 0x1b, 0x24, 0xb0, + 0xae, 0xed, 0x1b, 0x67, 0x14, 0x8f, 0xc7, 0xf2, 0x4c, 0xd2, 0x94, 0xa7, 0xe0, 0x25, 0x78, 0x03, + 0x1e, 0xa2, 0xcb, 0x8a, 0x15, 0x62, 0x51, 0xa1, 0xe4, 0x45, 0xd0, 0x8c, 0x03, 0x29, 0x2c, 0xcd, + 0xee, 0xde, 0x7b, 0xce, 0xf9, 0xcd, 0xd5, 0x48, 0x97, 0x3c, 0x9b, 0x20, 0x0a, 0xa8, 0x66, 0xa8, + 0x83, 0x6d, 0xb5, 0x18, 0x04, 0x25, 0x54, 0x20, 0x94, 0x5f, 0x56, 0x52, 0x4b, 0x7a, 0xf8, 0x5b, + 0xf2, 0xb7, 0xd5, 0x62, 0x70, 0xf4, 0x24, 0x91, 0x4a, 0x48, 0x15, 0x59, 0x57, 0x50, 0x37, 0x75, + 0xe4, 0xe8, 0x20, 0x93, 0x99, 0xac, 0xe7, 0xa6, 0xaa, 0xa7, 0x4f, 0x3f, 0xbb, 0xc4, 0x1d, 0x5b, + 0x32, 0x3d, 0x23, 0x3b, 0x90, 0x97, 0x53, 0x60, 0x4e, 0xcf, 0xe9, 0x77, 0x87, 0x83, 0xeb, 0xdb, + 0x93, 0xd6, 0xf7, 0xdb, 0x93, 0xe3, 0x9a, 0xa2, 0xd2, 0x99, 0xcf, 0x65, 0x20, 0x40, 0x4f, 0xfd, + 0x73, 0xcc, 0x20, 0xb9, 0x1a, 0x61, 0xf2, 0xf5, 0xcb, 0x29, 0xd9, 0x3c, 0x32, 0xc2, 0x24, 0xac, + 0xf3, 0xf4, 0x15, 0x69, 0xc7, 0xa8, 0x81, 0xfd, 0xd7, 0x94, 0x63, 0xe3, 0x66, 0x9f, 0x0c, 0x84, + 0x00, 0xf6, 0x7f, 0xe3, 0x7d, 0x6c, 0xde, 0x80, 0x52, 0xcc, 0x35, 0xb0, 0x76, 0x63, 0x90, 0xcd, + 0xd3, 0x0f, 0x84, 0x0a, 0x5e, 0x44, 0x31, 0x28, 0x8c, 0x32, 0x30, 0xbf, 0xcc, 0x13, 0x64, 0x3b, + 0x4d, 0xa9, 0x7b, 0x82, 0x17, 0x43, 0x50, 0x78, 0x06, 0x6a, 0x6c, 0x48, 0xf4, 0x3d, 0xd9, 0x37, + 0xfc, 0x1c, 0xa1, 0x2a, 0x78, 0x91, 0x45, 0x15, 0x68, 0x64, 0xee, 0xbf, 0xe0, 0xcf, 0x37, 0xa8, + 0x10, 0x74, 0x8d, 0x87, 0xe5, 0x5f, 0xf8, 0xdd, 0xe6, 0x78, 0x58, 0xfe, 0x81, 0x7f, 0x41, 0x1e, + 0x1b, 0x7c, 0x9c, 0xcb, 0x64, 0x16, 0xcd, 0x35, 0xcf, 0xf9, 0x47, 0xd0, 0x5c, 0x16, 0xac, 0xd3, + 0x73, 0xfa, 0xed, 0xf0, 0x91, 0x80, 0xe5, 0xd0, 0x68, 0x6f, 0xb7, 0x12, 0x3d, 0x24, 0xee, 0x25, + 0x2f, 0x52, 0x79, 0xc9, 0xba, 0xd6, 0xb4, 0xe9, 0xe8, 0x31, 0xe9, 0x4e, 0x10, 0xa3, 0x14, 0x0b, + 0x29, 0x18, 0x31, 0x2b, 0x86, 0x9d, 0x09, 0xe2, 0xc8, 0xf4, 0x94, 0x91, 0x5d, 0x2c, 0x20, 0xce, + 0x31, 0x65, 0xf7, 0x7a, 0x4e, 0xbf, 0x13, 0xfe, 0x6a, 0xe9, 0x73, 0xb2, 0x97, 0x72, 0xa5, 0x2b, + 0x1e, 0xcf, 0x35, 0x46, 0x13, 0x44, 0xc5, 0xee, 0x5b, 0xc7, 0xc3, 0xed, 0xf8, 0x35, 0xa2, 0xa2, + 0x01, 0x39, 0x50, 0x58, 0xa4, 0x91, 0xe6, 0x65, 0xa4, 0xa5, 0x39, 0x97, 0x52, 0x2a, 0xac, 0xd8, + 0x03, 0xeb, 0xde, 0x37, 0xda, 0x05, 0x2f, 0x2f, 0xe4, 0x78, 0x23, 0x0c, 0xdf, 0x5c, 0xaf, 0x3c, + 0xe7, 0x66, 0xe5, 0x39, 0x3f, 0x56, 0x9e, 0xf3, 0x69, 0xed, 0xb5, 0x6e, 0xd6, 0x5e, 0xeb, 0xdb, + 0xda, 0x6b, 0xbd, 0x0b, 0x32, 0xae, 0xa7, 0xf3, 0xd8, 0x4f, 0xa4, 0x08, 0xd4, 0x8c, 0x97, 0xa7, + 0x02, 0x17, 0x77, 0x2e, 0x77, 0x79, 0xa7, 0xd6, 0x57, 0x25, 0xaa, 0xd8, 0xb5, 0x97, 0xf7, 0xf2, + 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xb2, 0x79, 0x06, 0xe9, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -230,14 +219,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x70 - } - if len(m.FeeRecipientModule) > 0 { - i -= len(m.FeeRecipientModule) - copy(dAtA[i:], m.FeeRecipientModule) - i = encodeVarintParams(dAtA, i, uint64(len(m.FeeRecipientModule))) - i-- - dAtA[i] = 0x6a + dAtA[i] = 0x68 } if m.DistributeFees { i-- @@ -396,10 +378,6 @@ func (m *Params) Size() (n int) { if m.DistributeFees { n += 2 } - l = len(m.FeeRecipientModule) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } if m.SendTipToProposer { n += 2 } @@ -790,38 +768,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.DistributeFees = bool(v != 0) case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipientModule", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FeeRecipientModule = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SendTipToProposer", wireType) } diff --git a/x/feemarket/types/params_test.go b/x/feemarket/types/params_test.go index 296f4faa..721bfa8b 100644 --- a/x/feemarket/types/params_test.go +++ b/x/feemarket/types/params_test.go @@ -273,22 +273,6 @@ func TestParams(t *testing.T) { }, expectedErr: true, }, - { - name: "fee recipient module is empty for sending tip", - p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Gamma: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - MaxBlockUtilization: 3, - MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), - MinLearningRate: math.LegacyMustNewDecFromStr("0.01"), - MaxLearningRate: math.LegacyMustNewDecFromStr("0.05"), - FeeDenom: types.DefaultFeeDenom, - }, - expectedErr: true, - }, } for _, tc := range testCases {