chore: set proto/cosmos/autocli to main (#23725)

This commit is contained in:
Alex | Interchain Labs 2025-02-21 13:39:12 -05:00 committed by GitHub
parent 2a338e032c
commit 1fda5b615c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
55 changed files with 5673 additions and 197 deletions

View File

@ -3,6 +3,7 @@ package autocliv1
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
runtime "github.com/cosmos/cosmos-proto/runtime"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoiface "google.golang.org/protobuf/runtime/protoiface"
@ -669,10 +670,12 @@ func (x *_ServiceCommandDescriptor_3_map) IsValid() bool {
}
var (
md_ServiceCommandDescriptor protoreflect.MessageDescriptor
fd_ServiceCommandDescriptor_service protoreflect.FieldDescriptor
fd_ServiceCommandDescriptor_rpc_command_options protoreflect.FieldDescriptor
fd_ServiceCommandDescriptor_sub_commands protoreflect.FieldDescriptor
md_ServiceCommandDescriptor protoreflect.MessageDescriptor
fd_ServiceCommandDescriptor_service protoreflect.FieldDescriptor
fd_ServiceCommandDescriptor_rpc_command_options protoreflect.FieldDescriptor
fd_ServiceCommandDescriptor_sub_commands protoreflect.FieldDescriptor
fd_ServiceCommandDescriptor_enhance_custom_command protoreflect.FieldDescriptor
fd_ServiceCommandDescriptor_short protoreflect.FieldDescriptor
)
func init() {
@ -681,6 +684,8 @@ func init() {
fd_ServiceCommandDescriptor_service = md_ServiceCommandDescriptor.Fields().ByName("service")
fd_ServiceCommandDescriptor_rpc_command_options = md_ServiceCommandDescriptor.Fields().ByName("rpc_command_options")
fd_ServiceCommandDescriptor_sub_commands = md_ServiceCommandDescriptor.Fields().ByName("sub_commands")
fd_ServiceCommandDescriptor_enhance_custom_command = md_ServiceCommandDescriptor.Fields().ByName("enhance_custom_command")
fd_ServiceCommandDescriptor_short = md_ServiceCommandDescriptor.Fields().ByName("short")
}
var _ protoreflect.Message = (*fastReflection_ServiceCommandDescriptor)(nil)
@ -766,6 +771,18 @@ func (x *fastReflection_ServiceCommandDescriptor) Range(f func(protoreflect.Fiel
return
}
}
if x.EnhanceCustomCommand != false {
value := protoreflect.ValueOfBool(x.EnhanceCustomCommand)
if !f(fd_ServiceCommandDescriptor_enhance_custom_command, value) {
return
}
}
if x.Short != "" {
value := protoreflect.ValueOfString(x.Short)
if !f(fd_ServiceCommandDescriptor_short, value) {
return
}
}
}
// Has reports whether a field is populated.
@ -787,6 +804,10 @@ func (x *fastReflection_ServiceCommandDescriptor) Has(fd protoreflect.FieldDescr
return len(x.RpcCommandOptions) != 0
case "cosmos.autocli.v1.ServiceCommandDescriptor.sub_commands":
return len(x.SubCommands) != 0
case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command":
return x.EnhanceCustomCommand != false
case "cosmos.autocli.v1.ServiceCommandDescriptor.short":
return x.Short != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor"))
@ -809,6 +830,10 @@ func (x *fastReflection_ServiceCommandDescriptor) Clear(fd protoreflect.FieldDes
x.RpcCommandOptions = nil
case "cosmos.autocli.v1.ServiceCommandDescriptor.sub_commands":
x.SubCommands = nil
case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command":
x.EnhanceCustomCommand = false
case "cosmos.autocli.v1.ServiceCommandDescriptor.short":
x.Short = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor"))
@ -840,6 +865,12 @@ func (x *fastReflection_ServiceCommandDescriptor) Get(descriptor protoreflect.Fi
}
mapValue := &_ServiceCommandDescriptor_3_map{m: &x.SubCommands}
return protoreflect.ValueOfMap(mapValue)
case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command":
value := x.EnhanceCustomCommand
return protoreflect.ValueOfBool(value)
case "cosmos.autocli.v1.ServiceCommandDescriptor.short":
value := x.Short
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor"))
@ -870,6 +901,10 @@ func (x *fastReflection_ServiceCommandDescriptor) Set(fd protoreflect.FieldDescr
mv := value.Map()
cmv := mv.(*_ServiceCommandDescriptor_3_map)
x.SubCommands = *cmv.m
case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command":
x.EnhanceCustomCommand = value.Bool()
case "cosmos.autocli.v1.ServiceCommandDescriptor.short":
x.Short = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor"))
@ -904,6 +939,10 @@ func (x *fastReflection_ServiceCommandDescriptor) Mutable(fd protoreflect.FieldD
return protoreflect.ValueOfMap(value)
case "cosmos.autocli.v1.ServiceCommandDescriptor.service":
panic(fmt.Errorf("field service of message cosmos.autocli.v1.ServiceCommandDescriptor is not mutable"))
case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command":
panic(fmt.Errorf("field enhance_custom_command of message cosmos.autocli.v1.ServiceCommandDescriptor is not mutable"))
case "cosmos.autocli.v1.ServiceCommandDescriptor.short":
panic(fmt.Errorf("field short of message cosmos.autocli.v1.ServiceCommandDescriptor is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor"))
@ -925,6 +964,10 @@ func (x *fastReflection_ServiceCommandDescriptor) NewField(fd protoreflect.Field
case "cosmos.autocli.v1.ServiceCommandDescriptor.sub_commands":
m := make(map[string]*ServiceCommandDescriptor)
return protoreflect.ValueOfMap(&_ServiceCommandDescriptor_3_map{m: &m})
case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command":
return protoreflect.ValueOfBool(false)
case "cosmos.autocli.v1.ServiceCommandDescriptor.short":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor"))
@ -1030,6 +1073,13 @@ func (x *fastReflection_ServiceCommandDescriptor) ProtoMethods() *protoiface.Met
}
}
}
if x.EnhanceCustomCommand {
n += 2
}
l = len(x.Short)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
@ -1059,6 +1109,23 @@ func (x *fastReflection_ServiceCommandDescriptor) ProtoMethods() *protoiface.Met
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Short) > 0 {
i -= len(x.Short)
copy(dAtA[i:], x.Short)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Short)))
i--
dAtA[i] = 0x2a
}
if x.EnhanceCustomCommand {
i--
if x.EnhanceCustomCommand {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x20
}
if len(x.SubCommands) > 0 {
MaRsHaLmAp := func(k string, v *ServiceCommandDescriptor) (protoiface.MarshalOutput, error) {
baseI := i
@ -1376,6 +1443,58 @@ func (x *fastReflection_ServiceCommandDescriptor) ProtoMethods() *protoiface.Met
}
x.SubCommands[mapkey] = mapvalue
iNdEx = postIndex
case 4:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EnhanceCustomCommand", 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.EnhanceCustomCommand = bool(v != 0)
case 5:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Short", 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.Short = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
@ -1658,6 +1777,7 @@ var (
fd_RpcCommandOptions_flag_options protoreflect.FieldDescriptor
fd_RpcCommandOptions_positional_args protoreflect.FieldDescriptor
fd_RpcCommandOptions_skip protoreflect.FieldDescriptor
fd_RpcCommandOptions_gov_proposal protoreflect.FieldDescriptor
)
func init() {
@ -1675,6 +1795,7 @@ func init() {
fd_RpcCommandOptions_flag_options = md_RpcCommandOptions.Fields().ByName("flag_options")
fd_RpcCommandOptions_positional_args = md_RpcCommandOptions.Fields().ByName("positional_args")
fd_RpcCommandOptions_skip = md_RpcCommandOptions.Fields().ByName("skip")
fd_RpcCommandOptions_gov_proposal = md_RpcCommandOptions.Fields().ByName("gov_proposal")
}
var _ protoreflect.Message = (*fastReflection_RpcCommandOptions)(nil)
@ -1814,6 +1935,12 @@ func (x *fastReflection_RpcCommandOptions) Range(f func(protoreflect.FieldDescri
return
}
}
if x.GovProposal != false {
value := protoreflect.ValueOfBool(x.GovProposal)
if !f(fd_RpcCommandOptions_gov_proposal, value) {
return
}
}
}
// Has reports whether a field is populated.
@ -1853,6 +1980,8 @@ func (x *fastReflection_RpcCommandOptions) Has(fd protoreflect.FieldDescriptor)
return len(x.PositionalArgs) != 0
case "cosmos.autocli.v1.RpcCommandOptions.skip":
return x.Skip != false
case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal":
return x.GovProposal != false
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions"))
@ -1893,6 +2022,8 @@ func (x *fastReflection_RpcCommandOptions) Clear(fd protoreflect.FieldDescriptor
x.PositionalArgs = nil
case "cosmos.autocli.v1.RpcCommandOptions.skip":
x.Skip = false
case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal":
x.GovProposal = false
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions"))
@ -1957,6 +2088,9 @@ func (x *fastReflection_RpcCommandOptions) Get(descriptor protoreflect.FieldDesc
case "cosmos.autocli.v1.RpcCommandOptions.skip":
value := x.Skip
return protoreflect.ValueOfBool(value)
case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal":
value := x.GovProposal
return protoreflect.ValueOfBool(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions"))
@ -2009,6 +2143,8 @@ func (x *fastReflection_RpcCommandOptions) Set(fd protoreflect.FieldDescriptor,
x.PositionalArgs = *clv.list
case "cosmos.autocli.v1.RpcCommandOptions.skip":
x.Skip = value.Bool()
case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal":
x.GovProposal = value.Bool()
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions"))
@ -2069,6 +2205,8 @@ func (x *fastReflection_RpcCommandOptions) Mutable(fd protoreflect.FieldDescript
panic(fmt.Errorf("field version of message cosmos.autocli.v1.RpcCommandOptions is not mutable"))
case "cosmos.autocli.v1.RpcCommandOptions.skip":
panic(fmt.Errorf("field skip of message cosmos.autocli.v1.RpcCommandOptions is not mutable"))
case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal":
panic(fmt.Errorf("field gov_proposal of message cosmos.autocli.v1.RpcCommandOptions is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions"))
@ -2110,6 +2248,8 @@ func (x *fastReflection_RpcCommandOptions) NewField(fd protoreflect.FieldDescrip
return protoreflect.ValueOfList(&_RpcCommandOptions_11_list{list: &list})
case "cosmos.autocli.v1.RpcCommandOptions.skip":
return protoreflect.ValueOfBool(false)
case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal":
return protoreflect.ValueOfBool(false)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions"))
@ -2254,6 +2394,9 @@ func (x *fastReflection_RpcCommandOptions) ProtoMethods() *protoiface.Methods {
if x.Skip {
n += 2
}
if x.GovProposal {
n += 2
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
@ -2283,6 +2426,16 @@ func (x *fastReflection_RpcCommandOptions) ProtoMethods() *protoiface.Methods {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if x.GovProposal {
i--
if x.GovProposal {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x68
}
if x.Skip {
i--
if x.Skip {
@ -2946,6 +3099,26 @@ func (x *fastReflection_RpcCommandOptions) ProtoMethods() *protoiface.Methods {
}
}
x.Skip = 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 GovProposal", 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.GovProposal = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
@ -3779,6 +3952,7 @@ var (
md_PositionalArgDescriptor protoreflect.MessageDescriptor
fd_PositionalArgDescriptor_proto_field protoreflect.FieldDescriptor
fd_PositionalArgDescriptor_varargs protoreflect.FieldDescriptor
fd_PositionalArgDescriptor_optional protoreflect.FieldDescriptor
)
func init() {
@ -3786,6 +3960,7 @@ func init() {
md_PositionalArgDescriptor = File_cosmos_autocli_v1_options_proto.Messages().ByName("PositionalArgDescriptor")
fd_PositionalArgDescriptor_proto_field = md_PositionalArgDescriptor.Fields().ByName("proto_field")
fd_PositionalArgDescriptor_varargs = md_PositionalArgDescriptor.Fields().ByName("varargs")
fd_PositionalArgDescriptor_optional = md_PositionalArgDescriptor.Fields().ByName("optional")
}
var _ protoreflect.Message = (*fastReflection_PositionalArgDescriptor)(nil)
@ -3865,6 +4040,12 @@ func (x *fastReflection_PositionalArgDescriptor) Range(f func(protoreflect.Field
return
}
}
if x.Optional != false {
value := protoreflect.ValueOfBool(x.Optional)
if !f(fd_PositionalArgDescriptor_optional, value) {
return
}
}
}
// Has reports whether a field is populated.
@ -3884,6 +4065,8 @@ func (x *fastReflection_PositionalArgDescriptor) Has(fd protoreflect.FieldDescri
return x.ProtoField != ""
case "cosmos.autocli.v1.PositionalArgDescriptor.varargs":
return x.Varargs != false
case "cosmos.autocli.v1.PositionalArgDescriptor.optional":
return x.Optional != false
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor"))
@ -3904,6 +4087,8 @@ func (x *fastReflection_PositionalArgDescriptor) Clear(fd protoreflect.FieldDesc
x.ProtoField = ""
case "cosmos.autocli.v1.PositionalArgDescriptor.varargs":
x.Varargs = false
case "cosmos.autocli.v1.PositionalArgDescriptor.optional":
x.Optional = false
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor"))
@ -3926,6 +4111,9 @@ func (x *fastReflection_PositionalArgDescriptor) Get(descriptor protoreflect.Fie
case "cosmos.autocli.v1.PositionalArgDescriptor.varargs":
value := x.Varargs
return protoreflect.ValueOfBool(value)
case "cosmos.autocli.v1.PositionalArgDescriptor.optional":
value := x.Optional
return protoreflect.ValueOfBool(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor"))
@ -3950,6 +4138,8 @@ func (x *fastReflection_PositionalArgDescriptor) Set(fd protoreflect.FieldDescri
x.ProtoField = value.Interface().(string)
case "cosmos.autocli.v1.PositionalArgDescriptor.varargs":
x.Varargs = value.Bool()
case "cosmos.autocli.v1.PositionalArgDescriptor.optional":
x.Optional = value.Bool()
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor"))
@ -3974,6 +4164,8 @@ func (x *fastReflection_PositionalArgDescriptor) Mutable(fd protoreflect.FieldDe
panic(fmt.Errorf("field proto_field of message cosmos.autocli.v1.PositionalArgDescriptor is not mutable"))
case "cosmos.autocli.v1.PositionalArgDescriptor.varargs":
panic(fmt.Errorf("field varargs of message cosmos.autocli.v1.PositionalArgDescriptor is not mutable"))
case "cosmos.autocli.v1.PositionalArgDescriptor.optional":
panic(fmt.Errorf("field optional of message cosmos.autocli.v1.PositionalArgDescriptor is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor"))
@ -3991,6 +4183,8 @@ func (x *fastReflection_PositionalArgDescriptor) NewField(fd protoreflect.FieldD
return protoreflect.ValueOfString("")
case "cosmos.autocli.v1.PositionalArgDescriptor.varargs":
return protoreflect.ValueOfBool(false)
case "cosmos.autocli.v1.PositionalArgDescriptor.optional":
return protoreflect.ValueOfBool(false)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor"))
@ -4067,6 +4261,9 @@ func (x *fastReflection_PositionalArgDescriptor) ProtoMethods() *protoiface.Meth
if x.Varargs {
n += 2
}
if x.Optional {
n += 2
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
@ -4096,6 +4293,16 @@ func (x *fastReflection_PositionalArgDescriptor) ProtoMethods() *protoiface.Meth
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if x.Optional {
i--
if x.Optional {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
}
if x.Varargs {
i--
if x.Varargs {
@ -4214,6 +4421,26 @@ func (x *fastReflection_PositionalArgDescriptor) ProtoMethods() *protoiface.Meth
}
}
x.Varargs = bool(v != 0)
case 3:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Optional", 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.Optional = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
@ -4326,6 +4553,12 @@ type ServiceCommandDescriptor struct {
// different protobuf services. The map key is used as the name of the
// sub-command.
SubCommands map[string]*ServiceCommandDescriptor `protobuf:"bytes,3,rep,name=sub_commands,json=subCommands,proto3" json:"sub_commands,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// enhance_custom_commands specifies whether to skip the service when generating commands, if a custom command already
// exists, or enhance the existing command. If set to true, the custom command will be enhanced with the services from
// gRPC. otherwise when a custom command exists, no commands will be generated for the service.
EnhanceCustomCommand bool `protobuf:"varint,4,opt,name=enhance_custom_command,json=enhanceCustomCommand,proto3" json:"enhance_custom_command,omitempty"`
// short is an optional parameter used to override the short description of the auto generated command.
Short string `protobuf:"bytes,5,opt,name=short,proto3" json:"short,omitempty"`
}
func (x *ServiceCommandDescriptor) Reset() {
@ -4369,6 +4602,20 @@ func (x *ServiceCommandDescriptor) GetSubCommands() map[string]*ServiceCommandDe
return nil
}
func (x *ServiceCommandDescriptor) GetEnhanceCustomCommand() bool {
if x != nil {
return x.EnhanceCustomCommand
}
return false
}
func (x *ServiceCommandDescriptor) GetShort() string {
if x != nil {
return x.Short
}
return ""
}
// RpcCommandOptions specifies options for commands generated from protobuf
// rpc methods.
type RpcCommandOptions struct {
@ -4411,6 +4658,11 @@ type RpcCommandOptions struct {
PositionalArgs []*PositionalArgDescriptor `protobuf:"bytes,11,rep,name=positional_args,json=positionalArgs,proto3" json:"positional_args,omitempty"`
// skip specifies whether to skip this rpc method when generating commands.
Skip bool `protobuf:"varint,12,opt,name=skip,proto3" json:"skip,omitempty"`
// gov_proposal specifies whether autocli should generate a gov proposal transaction for this rpc method.
// Normally autocli generates a transaction containing the message and broadcast it.
// However, when true, autocli generates a proposal transaction containing the message and broadcast it.
// This option is ineffective for query commands.
GovProposal bool `protobuf:"varint,13,opt,name=gov_proposal,json=govProposal,proto3" json:"gov_proposal,omitempty"`
}
func (x *RpcCommandOptions) Reset() {
@ -4517,6 +4769,13 @@ func (x *RpcCommandOptions) GetSkip() bool {
return false
}
func (x *RpcCommandOptions) GetGovProposal() bool {
if x != nil {
return x.GovProposal
}
return false
}
// FlagOptions are options for flags generated from rpc request fields.
// By default, all request fields are configured as flags based on the
// kebab-case name of the field. Fields can be turned into positional arguments
@ -4622,8 +4881,11 @@ type PositionalArgDescriptor struct {
ProtoField string `protobuf:"bytes,1,opt,name=proto_field,json=protoField,proto3" json:"proto_field,omitempty"`
// varargs makes a positional parameter a varargs parameter. This can only be
// applied to last positional parameter and the proto_field must a repeated
// field.
// field. Note: It is mutually exclusive with optional.
Varargs bool `protobuf:"varint,2,opt,name=varargs,proto3" json:"varargs,omitempty"`
// optional makes the last positional parameter optional.
// Note: It is mutually exclusive with varargs.
Optional bool `protobuf:"varint,3,opt,name=optional,proto3" json:"optional,omitempty"`
}
func (x *PositionalArgDescriptor) Reset() {
@ -4660,110 +4922,129 @@ func (x *PositionalArgDescriptor) GetVarargs() bool {
return false
}
func (x *PositionalArgDescriptor) GetOptional() bool {
if x != nil {
return x.Optional
}
return false
}
var File_cosmos_autocli_v1_options_proto protoreflect.FileDescriptor
var file_cosmos_autocli_v1_options_proto_rawDesc = []byte{
0x0a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69,
0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x11, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c,
0x69, 0x2e, 0x76, 0x31, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4f,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f,
0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52,
0x02, 0x74, 0x78, 0x12, 0x41, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f,
0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52,
0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xd8, 0x02, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a,
0x13, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6f, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73,
0x69, 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, 0x22,
0x8f, 0x01, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x12, 0x3b, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e,
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76,
0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x02, 0x74, 0x78, 0x12, 0x41,
0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e,
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76,
0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72,
0x79, 0x22, 0xa4, 0x03, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x18,
0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x13, 0x72, 0x70, 0x63, 0x5f,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61,
0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x70, 0x63, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, 0x72, 0x70, 0x63,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5f,
0x0a, 0x0c, 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x03,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75,
0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
0x72, 0x2e, 0x53, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12,
0x34, 0x0a, 0x16, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f,
0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52,
0x14, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x1a, 0x6b, 0x0a, 0x10, 0x53,
0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x41, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c,
0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d,
0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdc, 0x04, 0x0a, 0x11, 0x52, 0x70, 0x63,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d,
0x0a, 0x0a, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a,
0x03, 0x75, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x73, 0x65, 0x12,
0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c,
0x6f, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x06, 0x20, 0x03,
0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x75, 0x67,
0x67, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a,
0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65,
0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x0c, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6f, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52,
0x70, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x11, 0x72, 0x70, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x12, 0x5f, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61,
0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63,
0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d,
0x61, 0x6e, 0x64, 0x73, 0x1a, 0x6b, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
0x6e, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x41, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63,
0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
0x01, 0x22, 0x9c, 0x04, 0x0a, 0x11, 0x52, 0x70, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x70, 0x63, 0x5f, 0x6d,
0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x70, 0x63,
0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x73, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x6e, 0x67,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05,
0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x6f,
0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05,
0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69,
0x61, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x6f,
0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74,
0x46, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65,
0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61,
0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a,
0x0c, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74,
0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x70, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x66, 0x6c, 0x61, 0x67,
0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x53, 0x0a, 0x0f, 0x70, 0x6f, 0x73, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c,
0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41,
0x72, 0x67, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0e, 0x70, 0x6f,
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x72, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04,
0x73, 0x6b, 0x69, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x73, 0x6b, 0x69, 0x70,
0x1a, 0x5e, 0x0a, 0x10, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61,
0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x22, 0xe5, 0x01, 0x0a, 0x0b, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61,
0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61,
0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a,
0x14, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65,
0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x68, 0x6f,
0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64,
0x12, 0x16, 0x0a, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08,
0x52, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x22, 0x54, 0x0a, 0x17, 0x50, 0x6f, 0x73, 0x69,
0x2e, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x52, 0x0b, 0x66, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x53,
0x0a, 0x0f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x72, 0x67,
0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x72, 0x67, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x65,
0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x46,
0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x61, 0x72, 0x61, 0x72, 0x67, 0x73, 0x18,
0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x61, 0x72, 0x61, 0x72, 0x67, 0x73, 0x42, 0xb9,
0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75,
0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f,
0x73, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x74,
0x6f, 0x63, 0x6c, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x11, 0x43,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x56, 0x31,
0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c,
0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75,
0x74, 0x6f, 0x63, 0x6c, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41,
0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
0x74, 0x6f, 0x72, 0x52, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41,
0x72, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28,
0x08, 0x52, 0x04, 0x73, 0x6b, 0x69, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x67, 0x6f, 0x76, 0x5f, 0x70,
0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x42, 0x1b, 0xda,
0xb4, 0x2d, 0x17, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x20, 0x76, 0x32, 0x2e,
0x30, 0x2e, 0x30, 0x2d, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x32, 0x52, 0x0b, 0x67, 0x6f, 0x76, 0x50,
0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x5e, 0x0a, 0x10, 0x46, 0x6c, 0x61, 0x67, 0x4f,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31,
0x2e, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe5, 0x01, 0x0a, 0x0b, 0x46, 0x6c, 0x61, 0x67,
0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73,
0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61,
0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12,
0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74,
0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63,
0x61, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x14, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e,
0x64, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01,
0x28, 0x09, 0x52, 0x13, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x70,
0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65,
0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x22,
0x70, 0x0a, 0x17, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x72, 0x67,
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76,
0x61, 0x72, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x61,
0x72, 0x61, 0x72, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,
0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,
0x6c, 0x42, 0xb9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x4f, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2f, 0x76, 0x31, 0x3b,
0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa,
0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69,
0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74,
0x6f, 0x63, 0x6c, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x5c, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x3a, 0x3a, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -0,0 +1,580 @@
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package modulev1
import (
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
fmt "fmt"
runtime "github.com/cosmos/cosmos-proto/runtime"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"
sync "sync"
)
var (
md_Module protoreflect.MessageDescriptor
fd_Module_authority protoreflect.FieldDescriptor
)
func init() {
file_cosmos_counter_module_v1_module_proto_init()
md_Module = File_cosmos_counter_module_v1_module_proto.Messages().ByName("Module")
fd_Module_authority = md_Module.Fields().ByName("authority")
}
var _ protoreflect.Message = (*fastReflection_Module)(nil)
type fastReflection_Module Module
func (x *Module) ProtoReflect() protoreflect.Message {
return (*fastReflection_Module)(x)
}
func (x *Module) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_counter_module_v1_module_proto_msgTypes[0]
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_Module_messageType fastReflection_Module_messageType
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
type fastReflection_Module_messageType struct{}
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
return (*fastReflection_Module)(nil)
}
func (x fastReflection_Module_messageType) New() protoreflect.Message {
return new(fastReflection_Module)
}
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Module
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
return md_Module
}
// 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_Module) Type() protoreflect.MessageType {
return _fastReflection_Module_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Module) New() protoreflect.Message {
return new(fastReflection_Module)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
return (*Module)(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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.Authority != "" {
value := protoreflect.ValueOfString(x.Authority)
if !f(fd_Module_authority, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
return x.Authority != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
x.Authority = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.counter.module.v1.Module.authority":
value := x.Authority
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
x.Authority = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
panic(fmt.Errorf("field authority of message cosmos.counter.module.v1.Module is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.counter.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Module)
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))
}
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().(*Module)
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.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().(*Module)
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: Module: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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
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: cosmos/counter/module/v1/module.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)
)
// Module is the config object of the counter module.
type Module struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// 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"`
}
func (x *Module) Reset() {
*x = Module{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_counter_module_v1_module_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Module) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Module) ProtoMessage() {}
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
func (*Module) Descriptor() ([]byte, []int) {
return file_cosmos_counter_module_v1_module_proto_rawDescGZIP(), []int{0}
}
func (x *Module) GetAuthority() string {
if x != nil {
return x.Authority
}
return ""
}
var File_cosmos_counter_module_v1_module_proto protoreflect.FileDescriptor
var file_cosmos_counter_module_v1_module_proto_rawDesc = []byte{
0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 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, 0x5f, 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, 0x37, 0xba, 0xc0, 0x96,
0xda, 0x01, 0x31, 0x0a, 0x2f, 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, 0x65, 0x73, 0x74, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x65, 0x72, 0x42, 0xe2, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 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, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e,
0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x4d, 0xaa, 0x02,
0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e,
0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f,
0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c,
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x3a, 0x4d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_cosmos_counter_module_v1_module_proto_rawDescOnce sync.Once
file_cosmos_counter_module_v1_module_proto_rawDescData = file_cosmos_counter_module_v1_module_proto_rawDesc
)
func file_cosmos_counter_module_v1_module_proto_rawDescGZIP() []byte {
file_cosmos_counter_module_v1_module_proto_rawDescOnce.Do(func() {
file_cosmos_counter_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_counter_module_v1_module_proto_rawDescData)
})
return file_cosmos_counter_module_v1_module_proto_rawDescData
}
var file_cosmos_counter_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_cosmos_counter_module_v1_module_proto_goTypes = []interface{}{
(*Module)(nil), // 0: cosmos.counter.module.v1.Module
}
var file_cosmos_counter_module_v1_module_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
}
func init() { file_cosmos_counter_module_v1_module_proto_init() }
func file_cosmos_counter_module_v1_module_proto_init() {
if File_cosmos_counter_module_v1_module_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_cosmos_counter_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Module); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_cosmos_counter_module_v1_module_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_cosmos_counter_module_v1_module_proto_goTypes,
DependencyIndexes: file_cosmos_counter_module_v1_module_proto_depIdxs,
MessageInfos: file_cosmos_counter_module_v1_module_proto_msgTypes,
}.Build()
File_cosmos_counter_module_v1_module_proto = out.File
file_cosmos_counter_module_v1_module_proto_rawDesc = nil
file_cosmos_counter_module_v1_module_proto_goTypes = nil
file_cosmos_counter_module_v1_module_proto_depIdxs = nil
}

View File

@ -0,0 +1,959 @@
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package counterv1
import (
fmt "fmt"
runtime "github.com/cosmos/cosmos-proto/runtime"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"
sync "sync"
)
var (
md_QueryGetCountRequest protoreflect.MessageDescriptor
)
func init() {
file_cosmos_counter_v1_query_proto_init()
md_QueryGetCountRequest = File_cosmos_counter_v1_query_proto.Messages().ByName("QueryGetCountRequest")
}
var _ protoreflect.Message = (*fastReflection_QueryGetCountRequest)(nil)
type fastReflection_QueryGetCountRequest QueryGetCountRequest
func (x *QueryGetCountRequest) ProtoReflect() protoreflect.Message {
return (*fastReflection_QueryGetCountRequest)(x)
}
func (x *QueryGetCountRequest) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_counter_v1_query_proto_msgTypes[0]
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_QueryGetCountRequest_messageType fastReflection_QueryGetCountRequest_messageType
var _ protoreflect.MessageType = fastReflection_QueryGetCountRequest_messageType{}
type fastReflection_QueryGetCountRequest_messageType struct{}
func (x fastReflection_QueryGetCountRequest_messageType) Zero() protoreflect.Message {
return (*fastReflection_QueryGetCountRequest)(nil)
}
func (x fastReflection_QueryGetCountRequest_messageType) New() protoreflect.Message {
return new(fastReflection_QueryGetCountRequest)
}
func (x fastReflection_QueryGetCountRequest_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_QueryGetCountRequest
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_QueryGetCountRequest) Descriptor() protoreflect.MessageDescriptor {
return md_QueryGetCountRequest
}
// 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_QueryGetCountRequest) Type() protoreflect.MessageType {
return _fastReflection_QueryGetCountRequest_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_QueryGetCountRequest) New() protoreflect.Message {
return new(fastReflection_QueryGetCountRequest)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_QueryGetCountRequest) Interface() protoreflect.ProtoMessage {
return (*QueryGetCountRequest)(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_QueryGetCountRequest) 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_QueryGetCountRequest) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.counter.v1.QueryGetCountRequest", 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_QueryGetCountRequest) 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_QueryGetCountRequest) 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_QueryGetCountRequest) 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_QueryGetCountRequest) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*QueryGetCountRequest)
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().(*QueryGetCountRequest)
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().(*QueryGetCountRequest)
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: QueryGetCountRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetCountRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_QueryGetCountResponse protoreflect.MessageDescriptor
fd_QueryGetCountResponse_total_count protoreflect.FieldDescriptor
)
func init() {
file_cosmos_counter_v1_query_proto_init()
md_QueryGetCountResponse = File_cosmos_counter_v1_query_proto.Messages().ByName("QueryGetCountResponse")
fd_QueryGetCountResponse_total_count = md_QueryGetCountResponse.Fields().ByName("total_count")
}
var _ protoreflect.Message = (*fastReflection_QueryGetCountResponse)(nil)
type fastReflection_QueryGetCountResponse QueryGetCountResponse
func (x *QueryGetCountResponse) ProtoReflect() protoreflect.Message {
return (*fastReflection_QueryGetCountResponse)(x)
}
func (x *QueryGetCountResponse) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_counter_v1_query_proto_msgTypes[1]
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_QueryGetCountResponse_messageType fastReflection_QueryGetCountResponse_messageType
var _ protoreflect.MessageType = fastReflection_QueryGetCountResponse_messageType{}
type fastReflection_QueryGetCountResponse_messageType struct{}
func (x fastReflection_QueryGetCountResponse_messageType) Zero() protoreflect.Message {
return (*fastReflection_QueryGetCountResponse)(nil)
}
func (x fastReflection_QueryGetCountResponse_messageType) New() protoreflect.Message {
return new(fastReflection_QueryGetCountResponse)
}
func (x fastReflection_QueryGetCountResponse_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_QueryGetCountResponse
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_QueryGetCountResponse) Descriptor() protoreflect.MessageDescriptor {
return md_QueryGetCountResponse
}
// 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_QueryGetCountResponse) Type() protoreflect.MessageType {
return _fastReflection_QueryGetCountResponse_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_QueryGetCountResponse) New() protoreflect.Message {
return new(fastReflection_QueryGetCountResponse)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_QueryGetCountResponse) Interface() protoreflect.ProtoMessage {
return (*QueryGetCountResponse)(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_QueryGetCountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.TotalCount != int64(0) {
value := protoreflect.ValueOfInt64(x.TotalCount)
if !f(fd_QueryGetCountResponse_total_count, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_QueryGetCountResponse) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.counter.v1.QueryGetCountResponse.total_count":
return x.TotalCount != int64(0)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.counter.v1.QueryGetCountResponse.total_count":
x.TotalCount = int64(0)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.counter.v1.QueryGetCountResponse.total_count":
value := x.TotalCount
return protoreflect.ValueOfInt64(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.counter.v1.QueryGetCountResponse.total_count":
x.TotalCount = value.Int()
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.counter.v1.QueryGetCountResponse.total_count":
panic(fmt.Errorf("field total_count of message cosmos.counter.v1.QueryGetCountResponse is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.counter.v1.QueryGetCountResponse.total_count":
return protoreflect.ValueOfInt64(int64(0))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse"))
}
panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.counter.v1.QueryGetCountResponse", 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_QueryGetCountResponse) 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_QueryGetCountResponse) 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_QueryGetCountResponse) 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_QueryGetCountResponse) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*QueryGetCountResponse)
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.TotalCount != 0 {
n += 1 + runtime.Sov(uint64(x.TotalCount))
}
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().(*QueryGetCountResponse)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if x.TotalCount != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.TotalCount))
i--
dAtA[i] = 0x8
}
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().(*QueryGetCountResponse)
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: QueryGetCountResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetCountResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalCount", wireType)
}
x.TotalCount = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.TotalCount |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: cosmos/counter/v1/query.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)
)
// QueryGetCountRequest defines the request type for querying x/mock count.
type QueryGetCountRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *QueryGetCountRequest) Reset() {
*x = QueryGetCountRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_counter_v1_query_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QueryGetCountRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QueryGetCountRequest) ProtoMessage() {}
// Deprecated: Use QueryGetCountRequest.ProtoReflect.Descriptor instead.
func (*QueryGetCountRequest) Descriptor() ([]byte, []int) {
return file_cosmos_counter_v1_query_proto_rawDescGZIP(), []int{0}
}
// QueryGetCountResponse defines the response type for querying x/mock count.
type QueryGetCountResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
}
func (x *QueryGetCountResponse) Reset() {
*x = QueryGetCountResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_counter_v1_query_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QueryGetCountResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QueryGetCountResponse) ProtoMessage() {}
// Deprecated: Use QueryGetCountResponse.ProtoReflect.Descriptor instead.
func (*QueryGetCountResponse) Descriptor() ([]byte, []int) {
return file_cosmos_counter_v1_query_proto_rawDescGZIP(), []int{1}
}
func (x *QueryGetCountResponse) GetTotalCount() int64 {
if x != nil {
return x.TotalCount
}
return 0
}
var File_cosmos_counter_v1_query_proto protoreflect.FileDescriptor
var file_cosmos_counter_v1_query_proto_rawDesc = []byte{
0x0a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x11, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e,
0x76, 0x31, 0x22, 0x16, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f,
0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x38, 0x0a, 0x15, 0x51, 0x75,
0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x32, 0x66, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5d, 0x0a,
0x08, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75,
0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xb7, 0x01, 0x0a,
0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e,
0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f,
0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x43,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x56, 0x31,
0xe2, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65,
0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x75, 0x6e, 0x74,
0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_cosmos_counter_v1_query_proto_rawDescOnce sync.Once
file_cosmos_counter_v1_query_proto_rawDescData = file_cosmos_counter_v1_query_proto_rawDesc
)
func file_cosmos_counter_v1_query_proto_rawDescGZIP() []byte {
file_cosmos_counter_v1_query_proto_rawDescOnce.Do(func() {
file_cosmos_counter_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_counter_v1_query_proto_rawDescData)
})
return file_cosmos_counter_v1_query_proto_rawDescData
}
var file_cosmos_counter_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_cosmos_counter_v1_query_proto_goTypes = []interface{}{
(*QueryGetCountRequest)(nil), // 0: cosmos.counter.v1.QueryGetCountRequest
(*QueryGetCountResponse)(nil), // 1: cosmos.counter.v1.QueryGetCountResponse
}
var file_cosmos_counter_v1_query_proto_depIdxs = []int32{
0, // 0: cosmos.counter.v1.Query.GetCount:input_type -> cosmos.counter.v1.QueryGetCountRequest
1, // 1: cosmos.counter.v1.Query.GetCount:output_type -> cosmos.counter.v1.QueryGetCountResponse
1, // [1:2] is the sub-list for method output_type
0, // [0:1] 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
}
func init() { file_cosmos_counter_v1_query_proto_init() }
func file_cosmos_counter_v1_query_proto_init() {
if File_cosmos_counter_v1_query_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_cosmos_counter_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QueryGetCountRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_counter_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QueryGetCountResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_cosmos_counter_v1_query_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_cosmos_counter_v1_query_proto_goTypes,
DependencyIndexes: file_cosmos_counter_v1_query_proto_depIdxs,
MessageInfos: file_cosmos_counter_v1_query_proto_msgTypes,
}.Build()
File_cosmos_counter_v1_query_proto = out.File
file_cosmos_counter_v1_query_proto_rawDesc = nil
file_cosmos_counter_v1_query_proto_goTypes = nil
file_cosmos_counter_v1_query_proto_depIdxs = nil
}

View File

@ -0,0 +1,127 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: cosmos/counter/v1/query.proto
package counterv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// 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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Query_GetCount_FullMethodName = "/cosmos.counter.v1.Query/GetCount"
)
// QueryClient is the client API for Query service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Query defines the gRPC querier service.
type QueryClient interface {
// GetCount queries the parameters of x/Counter module.
GetCount(ctx context.Context, in *QueryGetCountRequest, opts ...grpc.CallOption) (*QueryGetCountResponse, error)
}
type queryClient struct {
cc grpc.ClientConnInterface
}
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
return &queryClient{cc}
}
func (c *queryClient) GetCount(ctx context.Context, in *QueryGetCountRequest, opts ...grpc.CallOption) (*QueryGetCountResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(QueryGetCountResponse)
err := c.cc.Invoke(ctx, Query_GetCount_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer
// for forward compatibility.
//
// Query defines the gRPC querier service.
type QueryServer interface {
// GetCount queries the parameters of x/Counter module.
GetCount(context.Context, *QueryGetCountRequest) (*QueryGetCountResponse, error)
mustEmbedUnimplementedQueryServer()
}
// 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) GetCount(context.Context, *QueryGetCountRequest) (*QueryGetCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCount 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
// result in compilation errors.
type UnsafeQueryServer interface {
mustEmbedUnimplementedQueryServer()
}
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)
}
func _Query_GetCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetCountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetCount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetCount(ctx, req.(*QueryGetCountRequest))
}
return interceptor(ctx, in, info, handler)
}
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Query_ServiceDesc = grpc.ServiceDesc{
ServiceName: "cosmos.counter.v1.Query",
HandlerType: (*QueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetCount",
Handler: _Query_GetCount_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/counter/v1/query.proto",
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,127 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: cosmos/counter/v1/tx.proto
package counterv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// 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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Msg_IncreaseCount_FullMethodName = "/cosmos.counter.v1.Msg/IncreaseCount"
)
// MsgClient is the client API for Msg service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Msg defines the counter Msg service.
type MsgClient interface {
// IncreaseCount increments the counter by the specified amount.
IncreaseCount(ctx context.Context, in *MsgIncreaseCounter, opts ...grpc.CallOption) (*MsgIncreaseCountResponse, error)
}
type msgClient struct {
cc grpc.ClientConnInterface
}
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
return &msgClient{cc}
}
func (c *msgClient) IncreaseCount(ctx context.Context, in *MsgIncreaseCounter, opts ...grpc.CallOption) (*MsgIncreaseCountResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgIncreaseCountResponse)
err := c.cc.Invoke(ctx, Msg_IncreaseCount_FullMethodName, in, out, cOpts...)
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.
//
// Msg defines the counter Msg service.
type MsgServer interface {
// IncreaseCount increments the counter by the specified amount.
IncreaseCount(context.Context, *MsgIncreaseCounter) (*MsgIncreaseCountResponse, error)
mustEmbedUnimplementedMsgServer()
}
// 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) IncreaseCount(context.Context, *MsgIncreaseCounter) (*MsgIncreaseCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IncreaseCount 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
// result in compilation errors.
type UnsafeMsgServer interface {
mustEmbedUnimplementedMsgServer()
}
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)
}
func _Msg_IncreaseCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgIncreaseCounter)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).IncreaseCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_IncreaseCount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).IncreaseCount(ctx, req.(*MsgIncreaseCounter))
}
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)
var Msg_ServiceDesc = grpc.ServiceDesc{
ServiceName: "cosmos.counter.v1.Msg",
HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "IncreaseCount",
Handler: _Msg_IncreaseCount_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/counter/v1/tx.proto",
}

View File

@ -13,11 +13,12 @@ require (
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.29.0 // indirect

View File

@ -4,11 +4,12 @@ github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fr
github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@ -23,11 +24,12 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=

7
go.mod
View File

@ -55,7 +55,7 @@ require (
go.uber.org/mock v0.5.0
golang.org/x/crypto v0.33.0
golang.org/x/sync v0.11.0
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a
google.golang.org/grpc v1.70.0
google.golang.org/protobuf v1.36.5
gotest.tools/v3 v3.5.2
@ -161,12 +161,12 @@ require (
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
@ -177,6 +177,7 @@ require (
// replace (
// <temporary replace>
// )
replace cosmossdk.io/api => ./api
// Below are the long-lived replace of the Cosmos SDK
replace (

14
go.sum
View File

@ -1,7 +1,5 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY=
cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
@ -841,8 +839,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -984,10 +982,10 @@ google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0=
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=

View File

@ -4,15 +4,15 @@ deps:
- remote: buf.build
owner: cosmos
repository: cosmos-proto
commit: 1935555c206d4afb9e94615dfd0fad31
digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377
commit: 04467658e59e44bbb22fe568206e1f70
digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466
- remote: buf.build
owner: cosmos
repository: gogo-proto
commit: 5e5b9fdd01804356895f8f79a6f1ddc1
digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952
commit: 88ef6483f90f478fb938c37dde52ece3
digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba
- remote: buf.build
owner: googleapis
repository: googleapis
commit: cc916c31859748a68fd229a3c8d7a2e8
digest: shake256:469b049d0eb04203d5272062636c078decefc96fec69739159c25d85349c50c34c7706918a8b216c5c27f76939df48452148cff8c5c3ae77fa6ba5c25c1b8bf8
commit: 546238c53f7340c6a2a6099fb863bc1b
digest: shake256:8d75c12f391e392b24c076d05117b47aeddb090add99c70247a8f4389b906a65f61a933c68e54ed8b73a050b967b6b712ba194348b67c3ab3ee26cc2cb25852c

View File

@ -2,6 +2,8 @@ syntax = "proto3";
package cosmos.autocli.v1;
import "cosmos_proto/cosmos.proto";
option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1";
// ModuleOptions describes the CLI options for a Cosmos SDK module.
@ -15,7 +17,6 @@ message ModuleOptions {
// ServiceCommandDescriptor describes a CLI command based on a protobuf service.
message ServiceCommandDescriptor {
// service is the fully qualified name of the protobuf service to build
// the command from. It can be left empty if sub_commands are used instead
// which may be the case if a module provides multiple tx and/or query services.
@ -30,6 +31,14 @@ message ServiceCommandDescriptor {
// different protobuf services. The map key is used as the name of the
// sub-command.
map<string, ServiceCommandDescriptor> sub_commands = 3;
// enhance_custom_commands specifies whether to skip the service when generating commands, if a custom command already
// exists, or enhance the existing command. If set to true, the custom command will be enhanced with the services from
// gRPC. otherwise when a custom command exists, no commands will be generated for the service.
bool enhance_custom_command = 4;
// short is an optional parameter used to override the short description of the auto generated command.
string short = 5;
}
// RpcCommandOptions specifies options for commands generated from protobuf
@ -81,6 +90,12 @@ message RpcCommandOptions {
// skip specifies whether to skip this rpc method when generating commands.
bool skip = 12;
// gov_proposal specifies whether autocli should generate a gov proposal transaction for this rpc method.
// Normally autocli generates a transaction containing the message and broadcast it.
// However, when true, autocli generates a proposal transaction containing the message and broadcast it.
// This option is ineffective for query commands.
bool gov_proposal = 13 [(cosmos_proto.field_added_in) = "client/v2 v2.0.0-beta.2"];
}
// FlagOptions are options for flags generated from rpc request fields.
@ -88,7 +103,6 @@ message RpcCommandOptions {
// kebab-case name of the field. Fields can be turned into positional arguments
// instead by using RpcCommandOptions.positional_args.
message FlagOptions {
// name is an alternate name to use for the field flag.
string name = 1;
@ -119,6 +133,10 @@ message PositionalArgDescriptor {
// varargs makes a positional parameter a varargs parameter. This can only be
// applied to last positional parameter and the proto_field must a repeated
// field.
// field. Note: It is mutually exclusive with optional.
bool varargs = 2;
// optional makes the last positional parameter optional.
// Note: It is mutually exclusive with varargs.
bool optional = 3;
}

View File

@ -0,0 +1,17 @@
syntax = "proto3";
package cosmos.counter.module.v1;
import "cosmos/app/v1alpha1/module.proto";
option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types";
// Module is the config object of the counter module.
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "github.com/cosmos/cosmos-sdk/testutil/x/counter"
};
// authority defines the custom module authority. If not set, defaults to the governance module.
string authority = 1;
}

View File

@ -0,0 +1,18 @@
syntax = "proto3";
package cosmos.counter.v1;
option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types";
// Query defines the gRPC querier service.
service Query {
// GetCount queries the parameters of x/Counter module.
rpc GetCount(QueryGetCountRequest) returns (QueryGetCountResponse);
}
// QueryGetCountRequest defines the request type for querying x/mock count.
message QueryGetCountRequest {}
// QueryGetCountResponse defines the response type for querying x/mock count.
message QueryGetCountResponse {
int64 total_count = 1;
}

View File

@ -0,0 +1,35 @@
syntax = "proto3";
package cosmos.counter.v1;
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types";
// Msg defines the counter Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;
// IncreaseCount increments the counter by the specified amount.
rpc IncreaseCount(MsgIncreaseCounter) returns (MsgIncreaseCountResponse);
}
// MsgIncreaseCounter defines a count Msg service counter.
message MsgIncreaseCounter {
option (amino.name) = "cosmos-sdk/increase_counter"; // TODO: remove amino
option (cosmos.msg.v1.signer) = "signer";
// signer is the address that controls the module (defaults to x/gov unless overwritten).
string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// count is the number of times to increment the counter.
int64 count = 2;
}
// MsgIncreaseCountResponse is the Msg/Counter response type.
message MsgIncreaseCountResponse {
// new_count is the number of times the counter was incremented.
int64 new_count = 1;
}

View File

@ -185,7 +185,7 @@ require (
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
@ -194,8 +194,8 @@ require (
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.171.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect
google.golang.org/grpc v1.70.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

View File

@ -1202,8 +1202,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -1622,10 +1622,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz
google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0=
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=

View File

@ -314,7 +314,7 @@ func initTestnetFiles(
return err
}
addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo)
addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo, sdk.GetConfig().GetFullBIP44Path())
if err != nil {
_ = os.RemoveAll(args.outputDir)
return err

View File

@ -5,7 +5,6 @@ go 1.23
require (
cosmossdk.io/math v1.5.0
github.com/cometbft/cometbft v0.38.17
github.com/cometbft/cometbft/api v1.0.0-rc.1
github.com/cosmos/cosmos-sdk v0.50.11
github.com/creachadair/tomledit v0.0.27
github.com/stretchr/testify v1.10.0

View File

@ -139,8 +139,6 @@ github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHr
github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4=
github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ=
github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ=
github.com/cometbft/cometbft/api v1.0.0-rc.1 h1:GtdXwDGlqwHYs16A4egjwylfYOMYyEacLBrs3Zvpt7g=
github.com/cometbft/cometbft/api v1.0.0-rc.1/go.mod h1:NDFKiBBD8HJC6QQLAoUI99YhsiRZtg2+FJWfk6A6m6o=
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=

View File

@ -7,7 +7,7 @@ import (
"strconv"
"testing"
abci "github.com/cometbft/cometbft/api/cometbft/abci/v1"
abci "github.com/cometbft/cometbft/abci/types"
rpcclient "github.com/cometbft/cometbft/rpc/client"
client "github.com/cometbft/cometbft/rpc/client/http"
cmtypes "github.com/cometbft/cometbft/types"
@ -70,7 +70,7 @@ func (r RPCClient) Invoke(ctx context.Context, method string, req, reply interfa
}
}
abciReq := abci.QueryRequest{
abciReq := abci.RequestQuery{
Path: method,
Data: reqBz,
Height: height,

View File

@ -189,7 +189,7 @@ require (
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
@ -198,8 +198,8 @@ require (
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.171.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect

View File

@ -1203,8 +1203,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -1623,10 +1623,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz
google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0=
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=

View File

@ -63,7 +63,6 @@ require (
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft v0.38.17 // indirect
github.com/cometbft/cometbft-db v0.14.1 // indirect
github.com/cometbft/cometbft/api v1.0.0-rc.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.1.1 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect

View File

@ -139,8 +139,6 @@ github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHr
github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4=
github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ=
github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ=
github.com/cometbft/cometbft/api v1.0.0-rc.1 h1:GtdXwDGlqwHYs16A4egjwylfYOMYyEacLBrs3Zvpt7g=
github.com/cometbft/cometbft/api v1.0.0-rc.1/go.mod h1:NDFKiBBD8HJC6QQLAoUI99YhsiRZtg2+FJWfk6A6m6o=
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=

View File

@ -17,6 +17,7 @@ type TestAccount struct {
}
func CreateKeyringAccounts(t *testing.T, kr keyring.Keyring, num int) []TestAccount {
t.Helper()
accounts := make([]TestAccount, num)
for i := range accounts {
record, _, err := kr.NewMnemonic(

75
testutil/collections.go Normal file
View File

@ -0,0 +1,75 @@
package testutil
import (
"crypto/sha256"
"encoding/hex"
"fmt"
storetypes "cosmossdk.io/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// DiffCollectionsMigration is meant to aid in the migration from the previous store
// solution to collections. It takes a few steps to use it:
// 1. Write a test function that writes elements using the old store solution.
// 2. Run the test function and copy the hash that it outputs (run it a couple
// of times to make sure no non-deterministic data is being used).
// 3. Change the code to use collections and run the test function again to make
// sure the hash didn't change.
//
// First we write it as such:
//
// func TestMigrateStore(t *testing.T) {
// DiffCollectionsMigration(
// ctx,
// storeKey,
// 100,
// func(i int64) {
// err := SetPreviousProposerConsAddr(ctx, addrs[i])
// require.NoError(t, err)
// },
// "abcdef0123456789",
// )
// }
//
// Then after we change the code to use collections, we modify the writeElem function:
//
// func TestMigrateStore(t *testing.T) {
// DiffCollectionsMigration(
// ctx,
// storeKey,
// 100,
// func(i int64) {
// err := keeper.PreviousProposer.Set(ctx, addrs[i])
// require.NoError(t, err)
// },
// "abcdef0123456789",
// )
// }
func DiffCollectionsMigration(
ctx sdk.Context,
storeKey *storetypes.KVStoreKey,
iterations int,
writeElem func(int64),
targetHash string,
) error {
for i := int64(0); i < int64(iterations); i++ {
writeElem(i)
}
h := sha256.New()
it := ctx.KVStore(storeKey).Iterator(nil, nil)
defer it.Close()
for ; it.Valid(); it.Next() {
h.Write(it.Key())
h.Write(it.Value())
}
hash := h.Sum(nil)
if hex.EncodeToString(hash) != targetHash {
return fmt.Errorf("hashes don't match: %s != %s", hex.EncodeToString(hash), targetHash)
}
return nil
}

View File

@ -0,0 +1,54 @@
package testutil_test
import (
"testing"
"github.com/stretchr/testify/require"
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/testutil"
)
func TestDiffCollectionsMigration(t *testing.T) {
key := storetypes.NewKVStoreKey("test")
ctx := testutil.DefaultContext(key, storetypes.NewTransientStoreKey("transient"))
// First try with some invalid hash
err := testutil.DiffCollectionsMigration(
ctx,
key,
5,
func(i int64) {
ctx.KVStore(key).Set([]byte{byte(i)}, []byte{byte(i)})
},
"abcdef0123456789",
)
require.Error(t, err)
// Now reset and try with the correct hash
ctx = testutil.DefaultContext(key, storetypes.NewTransientStoreKey("transient"))
err = testutil.DiffCollectionsMigration(
ctx,
key,
5,
func(i int64) {
ctx.KVStore(key).Set([]byte{byte(i)}, []byte{byte(i)})
},
"79541ed9da9c16cb7a1d43d5a3d5f6ee31a873c85a6cb4334fb99e021ee0e556",
)
require.NoError(t, err)
// Change the data a little and it will result in an error
ctx = testutil.DefaultContext(key, storetypes.NewTransientStoreKey("transient"))
err = testutil.DiffCollectionsMigration(
ctx,
key,
5,
func(i int64) {
ctx.KVStore(key).Set([]byte{byte(i)}, []byte{byte(i + 1)})
},
"79541ed9da9c16cb7a1d43d5a3d5f6ee31a873c85a6cb4334fb99e021ee0e556",
)
require.Error(t, err)
}

View File

@ -63,17 +63,18 @@ func DefaultContextWithKeys(
type TestContext struct {
Ctx sdk.Context
DB *dbm.MemDB
DB dbm.DB
CMS store.CommitMultiStore
}
func DefaultContextWithDB(t testing.TB, key, tkey storetypes.StoreKey) TestContext {
func DefaultContextWithDB(tb testing.TB, key, tkey storetypes.StoreKey) TestContext {
tb.Helper()
db := dbm.NewMemDB()
cms := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics())
cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db)
cms.MountStoreWithDB(tkey, storetypes.StoreTypeTransient, db)
err := cms.LoadLatestVersion()
assert.NoError(t, err)
assert.NoError(tb, err)
ctx := sdk.NewContext(cms, cmtproto.Header{Time: time.Now()}, false, log.NewNopLogger())

View File

@ -38,7 +38,7 @@ func ApplyMockIO(c *cobra.Command) (BufferReader, BufferWriter) {
return mockIn, mockOut
}
// ApplyMockIODiscardOutputs replaces a cobra.Command output and error streams with a dummy io.Writer.
// ApplyMockIODiscardOutErr replaces a cobra.Command output and error streams with a dummy io.Writer.
// Replaces and returns the io.Reader associated to the cobra.Command input stream.
func ApplyMockIODiscardOutErr(c *cobra.Command) BufferReader {
mockIn := strings.NewReader("")
@ -52,36 +52,36 @@ func ApplyMockIODiscardOutErr(c *cobra.Command) BufferReader {
// Write the given string to a new temporary file.
// Returns an open file for the test to use.
func WriteToNewTempFile(t testing.TB, s string) *os.File {
t.Helper()
func WriteToNewTempFile(tb testing.TB, s string) *os.File {
tb.Helper()
fp := TempFile(t)
fp := TempFile(tb)
_, err := fp.WriteString(s)
require.Nil(t, err)
require.Nil(tb, err)
return fp
}
// TempFile returns a writable temporary file for the test to use.
func TempFile(t testing.TB) *os.File {
t.Helper()
func TempFile(tb testing.TB) *os.File {
tb.Helper()
fp, err := os.CreateTemp(GetTempDir(t), "")
require.NoError(t, err)
fp, err := os.CreateTemp(GetTempDir(tb), "")
require.NoError(tb, err)
return fp
}
// GetTempDir returns a writable temporary director for the test to use.
func GetTempDir(t testing.TB) string {
t.Helper()
func GetTempDir(tb testing.TB) string {
tb.Helper()
// os.MkDir() is used instead of testing.T.TempDir()
// see https://github.com/cosmos/cosmos-sdk/pull/8475 and
// https://github.com/cosmos/cosmos-sdk/pull/10341 for
// this change's rationale.
tempdir, err := os.MkdirTemp("", "")
require.NoError(t, err)
t.Cleanup(func() { _ = os.RemoveAll(tempdir) })
require.NoError(tb, err)
tb.Cleanup(func() { _ = os.RemoveAll(tempdir) })
return tempdir
}

View File

@ -1,14 +1,14 @@
package testutil
import (
"fmt"
"errors"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// GenerateCoinKey generates a new key mnemonic along with its addrress.
// GenerateCoinKey generates a new key mnemonic along with its address.
func GenerateCoinKey(algo keyring.SignatureAlgo, cdc codec.Codec) (sdk.AccAddress, string, error) {
// generate a private key, with mnemonic
info, secret, err := keyring.NewInMemory(cdc).NewMnemonic(
@ -28,7 +28,7 @@ func GenerateCoinKey(algo keyring.SignatureAlgo, cdc codec.Codec) (sdk.AccAddres
return addr, secret, nil
}
// GenerateSaveCoinKey generates a new key mnemonic with its addrress.
// GenerateSaveCoinKey generates a new key mnemonic with its address.
// If mnemonic is provided then it's used for key generation.
// The key is saved in the keyring. The function returns error if overwrite=true and the key
// already exists.
@ -37,6 +37,7 @@ func GenerateSaveCoinKey(
keyName, mnemonic string,
overwrite bool,
algo keyring.SignatureAlgo,
hdPath string,
) (sdk.AccAddress, string, error) {
exists := false
_, err := keybase.Key(keyName)
@ -46,12 +47,12 @@ func GenerateSaveCoinKey(
// ensure no overwrite
if !overwrite && exists {
return sdk.AccAddress{}, "", fmt.Errorf("key already exists, overwrite is disabled")
return sdk.AccAddress{}, "", errors.New("key already exists, overwrite is disabled")
}
if exists {
if err := keybase.Delete(keyName); err != nil {
return sdk.AccAddress{}, "", fmt.Errorf("failed to overwrite key")
return sdk.AccAddress{}, "", errors.New("failed to overwrite key")
}
}
@ -63,9 +64,9 @@ func GenerateSaveCoinKey(
// generate or recover a new account
if mnemonic != "" {
secret = mnemonic
record, err = keybase.NewAccount(keyName, mnemonic, keyring.DefaultBIP39Passphrase, sdk.GetConfig().GetFullBIP44Path(), algo)
record, err = keybase.NewAccount(keyName, mnemonic, keyring.DefaultBIP39Passphrase, hdPath, algo)
} else {
record, secret, err = keybase.NewMnemonic(keyName, keyring.English, sdk.GetConfig().GetFullBIP44Path(), keyring.DefaultBIP39Passphrase, algo)
record, secret, err = keybase.NewMnemonic(keyName, keyring.English, hdPath, keyring.DefaultBIP39Passphrase, algo)
}
if err != nil {
return sdk.AccAddress{}, "", err

View File

@ -18,7 +18,7 @@ func TestGenerateCoinKey(t *testing.T) {
require.NoError(t, err)
// Test creation
k, err := keyring.NewInMemory(cdc).NewAccount("xxx", mnemonic, "", hd.NewFundraiserParams(0, types.GetConfig().GetCoinType(), 0).String(), hd.Secp256k1)
k, err := keyring.NewInMemory(cdc).NewAccount("xxx", mnemonic, "", hd.NewFundraiserParams(0, types.CoinType, 0).String(), hd.Secp256k1)
require.NoError(t, err)
addr1, err := k.GetAddress()
require.NoError(t, err)
@ -32,7 +32,7 @@ func TestGenerateSaveCoinKey(t *testing.T) {
kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, encCfg.Codec)
require.NoError(t, err)
addr, mnemonic, err := GenerateSaveCoinKey(kb, "keyname", "", false, hd.Secp256k1)
addr, mnemonic, err := GenerateSaveCoinKey(kb, "keyname", "", false, hd.Secp256k1, types.GetConfig().GetFullBIP44Path())
require.NoError(t, err)
// Test key was actually saved
@ -43,7 +43,7 @@ func TestGenerateSaveCoinKey(t *testing.T) {
require.Equal(t, addr, addr1)
// Test in-memory recovery
k, err = keyring.NewInMemory(encCfg.Codec).NewAccount("xxx", mnemonic, "", hd.NewFundraiserParams(0, types.GetConfig().GetCoinType(), 0).String(), hd.Secp256k1)
k, err = keyring.NewInMemory(encCfg.Codec).NewAccount("xxx", mnemonic, "", hd.NewFundraiserParams(0, types.CoinType, 0).String(), hd.Secp256k1)
require.NoError(t, err)
addr1, err = k.GetAddress()
require.NoError(t, err)
@ -58,15 +58,15 @@ func TestGenerateSaveCoinKeyOverwriteFlag(t *testing.T) {
require.NoError(t, err)
keyname := "justakey"
addr1, _, err := GenerateSaveCoinKey(kb, keyname, "", false, hd.Secp256k1)
addr1, _, err := GenerateSaveCoinKey(kb, keyname, "", false, hd.Secp256k1, types.GetConfig().GetFullBIP44Path())
require.NoError(t, err)
// Test overwrite with overwrite=false
_, _, err = GenerateSaveCoinKey(kb, keyname, "", false, hd.Secp256k1)
_, _, err = GenerateSaveCoinKey(kb, keyname, "", false, hd.Secp256k1, types.GetConfig().GetFullBIP44Path())
require.Error(t, err)
// Test overwrite with overwrite=true
addr2, _, err := GenerateSaveCoinKey(kb, keyname, "", true, hd.Secp256k1)
addr2, _, err := GenerateSaveCoinKey(kb, keyname, "", true, hd.Secp256k1, types.GetConfig().GetFullBIP44Path())
require.NoError(t, err)
require.NotEqual(t, addr1, addr2)

View File

@ -1,6 +1,8 @@
package testutil
import "math/rand"
import (
"math/rand"
)
func RandSliceElem[E any](r *rand.Rand, elems []E) (E, bool) {
if len(elems) == 0 {

View File

@ -48,3 +48,7 @@ func (pv PV) SignProposal(chainID string, proposal *cmtproto.Proposal) error {
proposal.Signature = sig
return nil
}
func (pv PV) SignBytes(bytes []byte) ([]byte, error) {
return pv.PrivKey.Sign(bytes)
}

View File

@ -8,11 +8,11 @@
package mock
import (
reflect "reflect"
"reflect"
gomock "go.uber.org/mock/gomock"
"go.uber.org/mock/gomock"
types "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types"
)
// MockAnteDecorator is a mock of AnteDecorator interface.

View File

@ -484,7 +484,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
mnemonic = cfg.Mnemonics[i]
}
addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, mnemonic, true, algo)
addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, mnemonic, true, algo, sdk.GetConfig().GetFullBIP44Path())
if err != nil {
return nil, err
}

View File

@ -42,15 +42,15 @@ func GetRequestWithHeaders(url string, headers map[string]string) ([]byte, error
// GetRequest defines a wrapper around an HTTP GET request with a provided URL.
// An error is returned if the request or reading the body fails.
func GetRequest(url string) ([]byte, error) {
res, err := http.Get(url) //nolint:gosec // only used for testing
resp, err := http.Get(url)
if err != nil {
return nil, err
}
defer func() {
_ = res.Body.Close()
_ = resp.Body.Close()
}()
body, err := io.ReadAll(res.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
@ -61,15 +61,15 @@ func GetRequest(url string) ([]byte, error) {
// PostRequest defines a wrapper around an HTTP POST request with a provided URL and data.
// An error is returned if the request or reading the body fails.
func PostRequest(url, contentType string, data []byte) ([]byte, error) {
res, err := http.Post(url, contentType, bytes.NewBuffer(data)) //nolint:gosec // only used for testing
resp, err := http.Post(url, contentType, bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("error while sending post request: %w", err)
}
defer func() {
_ = res.Body.Close()
_ = resp.Body.Close()
}()
bz, err := io.ReadAll(res.Body)
bz, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("error reading response body: %w", err)
}

View File

@ -0,0 +1,19 @@
package sims
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
)
type BankKeeper interface {
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
}
// StakingKeeper is a subset of the staking keeper's public interface that
// provides the staking bond denom. It is used in arguments in this package's
// functions so that a mock staking keeper can be passed instead of the real one.
type StakingKeeper interface {
BondDenom(ctx context.Context) (string, error)
}

6
testutil/testdata/buf.gen.gogo.yaml vendored Normal file
View File

@ -0,0 +1,6 @@
version: v1
plugins:
- name: gocosmos
out: ../..
opt:
- plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any

25
testutil/types.go Normal file
View File

@ -0,0 +1,25 @@
package testutil
// This file contains the list of module names are that maintained by the SDK team.
// Those constants are defined here to be used in the SDK without importing those modules.
const (
AuthModuleName = "auth"
AuthzModuleName = "authz"
BankModuleName = "bank"
CircuitModuleName = "circuit"
DistributionModuleName = "distribution"
EvidenceModuleName = "evidence"
FeegrantModuleName = "feegrant"
GovModuleName = "gov"
GroupModuleName = "group"
MintModuleName = "mint"
NFTModuleName = "nft"
ParamsModuleName = "params"
ProtocolPoolModuleName = "protocolpool"
SlashingModuleName = "slashing"
StakingModuleName = "staking"
AuthTxConfigDepinjectModuleName = "tx"
UpgradeModuleName = "upgrade"
EpochsModuleName = "epochs"
)

View File

@ -0,0 +1,7 @@
---
sidebar_position: 1
---
# `x/counter`
Counter is a module used for testing purposes within the Cosmos SDK.

View File

@ -0,0 +1,34 @@
package counter
import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
counterv1 "cosmossdk.io/api/cosmos/counter/v1"
)
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: counterv1.Query_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "GetCount",
Use: "count",
Short: "Query the current counter value",
},
},
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: counterv1.Msg_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "IncreaseCount",
Use: "increase-count <count>",
Alias: []string{"increase-counter", "increase", "inc", "bump"},
Short: "Increase the counter by the specified amount",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "count"}},
},
},
},
}
}

View File

@ -0,0 +1,76 @@
package counter
import (
"fmt"
"maps"
"slices"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appconfig"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
)
var _ depinject.OnePerModuleType = AppModule{}
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}
func init() {
appconfig.RegisterModule(
&types.Module{},
appconfig.Provide(ProvideModule),
appconfig.Invoke(InvokeSetHooks),
)
}
type ModuleInputs struct {
depinject.In
Config *types.Module
StoreService store.KVStoreService
}
type ModuleOutputs struct {
depinject.Out
Keeper *keeper.Keeper
Module appmodule.AppModule
}
func ProvideModule(in ModuleInputs) ModuleOutputs {
k := keeper.NewKeeper(in.StoreService)
m := NewAppModule(k)
return ModuleOutputs{
Keeper: k,
Module: m,
}
}
func InvokeSetHooks(keeper *keeper.Keeper, counterHooks map[string]types.CounterHooksWrapper) error {
if keeper == nil {
return fmt.Errorf("keeper is nil")
}
if counterHooks == nil {
return fmt.Errorf("counterHooks is nil")
}
// Default ordering is lexical by module name.
// Explicit ordering can be added to the module config if required.
modNames := slices.Sorted(maps.Keys(counterHooks))
var multiHooks types.MultiCounterHooks
for _, modName := range modNames {
hook, ok := counterHooks[modName]
if !ok {
return fmt.Errorf("can't find hooks for module %s", modName)
}
multiHooks = append(multiHooks, hook)
}
keeper.SetHooks(multiHooks)
return nil
}

View File

@ -0,0 +1,14 @@
package keeper
import (
"context"
)
type Hooks struct {
AfterCounterIncreased bool
}
func (h *Hooks) AfterIncreaseCount(ctx context.Context, n int64) error {
h.AfterCounterIncreased = true
return nil
}

View File

@ -0,0 +1,106 @@
package keeper
import (
"context"
"errors"
"fmt"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"cosmossdk.io/collections"
"cosmossdk.io/core/store"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
type Keeper struct {
storeService store.KVStoreService
CountStore collections.Item[int64]
hooks types.CounterHooks
}
func NewKeeper(storeService store.KVStoreService) *Keeper {
sb := collections.NewSchemaBuilder(storeService)
return &Keeper{
storeService: storeService,
CountStore: collections.NewItem(sb, collections.NewPrefix(0), "count", collections.Int64Value),
}
}
// Querier
var _ types.QueryServer = Keeper{}
// GetCount queries the x/counter count
func (k Keeper) GetCount(ctx context.Context, _ *types.QueryGetCountRequest) (*types.QueryGetCountResponse, error) {
count, err := k.CountStore.Get(ctx)
if err != nil {
if errors.Is(err, collections.ErrNotFound) {
return &types.QueryGetCountResponse{TotalCount: 0}, nil
} else {
return nil, status.Error(codes.Internal, err.Error())
}
}
return &types.QueryGetCountResponse{TotalCount: count}, nil
}
// MsgServer
var _ types.MsgServer = Keeper{}
func (k Keeper) IncreaseCount(ctx context.Context, msg *types.MsgIncreaseCounter) (*types.MsgIncreaseCountResponse, error) {
var num int64
num, err := k.CountStore.Get(ctx)
if err != nil {
if errors.Is(err, collections.ErrNotFound) {
num = 0
} else {
return nil, err
}
}
sdkCtx := sdk.UnwrapSDKContext(ctx)
if err := k.CountStore.Set(sdkCtx, num+msg.Count); err != nil {
return nil, err
}
if err := k.Hooks().AfterIncreaseCount(sdkCtx, num+msg.Count); err != nil {
return nil, err
}
sdkCtx.EventManager().EmitEvent(sdk.NewEvent(
"increase_counter",
sdk.NewAttribute("signer", msg.Signer),
sdk.NewAttribute("new count", fmt.Sprint(num+msg.Count))),
)
return &types.MsgIncreaseCountResponse{
NewCount: num + msg.Count,
}, nil
}
// Hooks gets the hooks for counter Keeper
func (k *Keeper) Hooks() types.CounterHooks {
if k.hooks == nil {
// return a no-op implementation if no hooks are set
return types.MultiCounterHooks{}
}
return k.hooks
}
// SetHooks sets the hooks for counter
func (k *Keeper) SetHooks(gh types.CounterHooks) *Keeper {
if k.hooks != nil {
panic("cannot set governance hooks twice")
}
k.hooks = gh
return k
}

View File

@ -0,0 +1,47 @@
package counter
import (
"google.golang.org/grpc"
"cosmossdk.io/core/appmodule"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
)
var _ appmodule.AppModule = AppModule{}
// AppModule implements an application module
type AppModule struct {
keeper *keeper.Keeper
}
// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}
// RegisterServices registers module services.
func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error {
types.RegisterMsgServer(registrar, am.keeper)
types.RegisterQueryServer(registrar, am.keeper)
return nil
}
// NewAppModule creates a new AppModule object
func NewAppModule(keeper *keeper.Keeper) AppModule {
return AppModule{
keeper: keeper,
}
}
// ConsensusVersion implements HasConsensusVersion
func (AppModule) ConsensusVersion() uint64 { return 1 }
// Name returns the module's name.
// Deprecated: kept for legacy reasons.
func (AppModule) Name() string { return types.ModuleName }
// RegisterInterfaces registers interfaces and implementations of the bank module.
func (AppModule) RegisterInterfaces(registrar codectypes.InterfaceRegistry) {
types.RegisterInterfaces(registrar)
}

View File

@ -0,0 +1,229 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: x/bank/types/expected_keepers.go
// Package testutil is a generated GoMock package.
package testutil
import (
reflect "reflect"
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
types "github.com/cosmos/cosmos-sdk/types"
gomock "go.uber.org/mock/gomock"
)
// MockAccountKeeper is a mock of AccountKeeper interface.
type MockAccountKeeper struct {
ctrl *gomock.Controller
recorder *MockAccountKeeperMockRecorder
}
// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper.
type MockAccountKeeperMockRecorder struct {
mock *MockAccountKeeper
}
// NewMockAccountKeeper creates a new mock instance.
func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper {
mock := &MockAccountKeeper{ctrl: ctrl}
mock.recorder = &MockAccountKeeperMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
return m.recorder
}
// GetAccount mocks base method.
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
ret0, _ := ret[0].(types.AccountI)
return ret0
}
// GetAccount indicates an expected call of GetAccount.
func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr)
}
// GetAllAccounts mocks base method.
func (m *MockAccountKeeper) GetAllAccounts(ctx types.Context) []types.AccountI {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAllAccounts", ctx)
ret0, _ := ret[0].([]types.AccountI)
return ret0
}
// GetAllAccounts indicates an expected call of GetAllAccounts.
func (mr *MockAccountKeeperMockRecorder) GetAllAccounts(ctx interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).GetAllAccounts), ctx)
}
// GetModuleAccount mocks base method.
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types0.ModuleAccountI {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName)
ret0, _ := ret[0].(types0.ModuleAccountI)
return ret0
}
// GetModuleAccount indicates an expected call of GetModuleAccount.
func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName)
}
// GetModuleAccountAndPermissions mocks base method.
func (m *MockAccountKeeper) GetModuleAccountAndPermissions(ctx types.Context, moduleName string) (types0.ModuleAccountI, []string) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModuleAccountAndPermissions", ctx, moduleName)
ret0, _ := ret[0].(types0.ModuleAccountI)
ret1, _ := ret[1].([]string)
return ret0, ret1
}
// GetModuleAccountAndPermissions indicates an expected call of GetModuleAccountAndPermissions.
func (mr *MockAccountKeeperMockRecorder) GetModuleAccountAndPermissions(ctx, moduleName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccountAndPermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccountAndPermissions), ctx, moduleName)
}
// GetModuleAddress mocks base method.
func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModuleAddress", moduleName)
ret0, _ := ret[0].(types.AccAddress)
return ret0
}
// GetModuleAddress indicates an expected call of GetModuleAddress.
func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName)
}
// GetModuleAddressAndPermissions mocks base method.
func (m *MockAccountKeeper) GetModuleAddressAndPermissions(moduleName string) (types.AccAddress, []string) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModuleAddressAndPermissions", moduleName)
ret0, _ := ret[0].(types.AccAddress)
ret1, _ := ret[1].([]string)
return ret0, ret1
}
// GetModuleAddressAndPermissions indicates an expected call of GetModuleAddressAndPermissions.
func (mr *MockAccountKeeperMockRecorder) GetModuleAddressAndPermissions(moduleName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddressAndPermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddressAndPermissions), moduleName)
}
// GetModulePermissions mocks base method.
func (m *MockAccountKeeper) GetModulePermissions() map[string]types0.PermissionsForAddress {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModulePermissions")
ret0, _ := ret[0].(map[string]types0.PermissionsForAddress)
return ret0
}
// GetModulePermissions indicates an expected call of GetModulePermissions.
func (mr *MockAccountKeeperMockRecorder) GetModulePermissions() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModulePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModulePermissions))
}
// HasAccount mocks base method.
func (m *MockAccountKeeper) HasAccount(ctx types.Context, addr types.AccAddress) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "HasAccount", ctx, addr)
ret0, _ := ret[0].(bool)
return ret0
}
// HasAccount indicates an expected call of HasAccount.
func (mr *MockAccountKeeperMockRecorder) HasAccount(ctx, addr interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasAccount", reflect.TypeOf((*MockAccountKeeper)(nil).HasAccount), ctx, addr)
}
// IterateAccounts mocks base method.
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types.AccountI) bool) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "IterateAccounts", ctx, process)
}
// IterateAccounts indicates an expected call of IterateAccounts.
func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process)
}
// NewAccount mocks base method.
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types.AccountI) types.AccountI {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NewAccount", arg0, arg1)
ret0, _ := ret[0].(types.AccountI)
return ret0
}
// NewAccount indicates an expected call of NewAccount.
func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccount", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccount), arg0, arg1)
}
// NewAccountWithAddress mocks base method.
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types.AccountI {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr)
ret0, _ := ret[0].(types.AccountI)
return ret0
}
// NewAccountWithAddress indicates an expected call of NewAccountWithAddress.
func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccountWithAddress", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccountWithAddress), ctx, addr)
}
// SetAccount mocks base method.
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types.AccountI) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetAccount", ctx, acc)
}
// SetAccount indicates an expected call of SetAccount.
func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc)
}
// SetModuleAccount mocks base method.
func (m *MockAccountKeeper) SetModuleAccount(ctx types.Context, macc types0.ModuleAccountI) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetModuleAccount", ctx, macc)
}
// SetModuleAccount indicates an expected call of SetModuleAccount.
func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(ctx, macc interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), ctx, macc)
}
// ValidatePermissions mocks base method.
func (m *MockAccountKeeper) ValidatePermissions(macc types0.ModuleAccountI) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ValidatePermissions", macc)
ret0, _ := ret[0].(error)
return ret0
}
// ValidatePermissions indicates an expected call of ValidatePermissions.
func (mr *MockAccountKeeperMockRecorder) ValidatePermissions(macc interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).ValidatePermissions), macc)
}

View File

@ -0,0 +1,16 @@
package types
import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)
func RegisterInterfaces(registrar codectypes.InterfaceRegistry) {
registrar.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgIncreaseCounter{},
)
msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc)
}

View File

@ -0,0 +1,12 @@
package types
import "context"
type CounterHooks interface {
AfterIncreaseCount(ctx context.Context, newCount int64) error
}
type CounterHooksWrapper struct{ CounterHooks }
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (CounterHooksWrapper) IsOnePerModuleType() {}

View File

@ -0,0 +1,26 @@
package types
import (
"context"
"errors"
)
var _ CounterHooks = MultiCounterHooks{}
// MultiCounterHooks is a slice of hooks to be called in sequence.
type MultiCounterHooks []CounterHooks
// NewMultiCounterHooks returns a MultiCounterHooks from a list of CounterHooks
func NewMultiCounterHooks(hooks ...CounterHooks) MultiCounterHooks {
return hooks
}
// AfterIncreaseCount calls AfterIncreaseCount on all hooks and collects the errors if any.
func (ch MultiCounterHooks) AfterIncreaseCount(ctx context.Context, newCount int64) error {
var errs error
for i := range ch {
errs = errors.Join(errs, ch[i].AfterIncreaseCount(ctx, newCount))
}
return errs
}

View File

@ -0,0 +1,9 @@
package types
const (
// ModuleName defines the name of the x/consensus module.
ModuleName = "counter"
// StoreKey defines the module's store key.
StoreKey = ModuleName
)

View File

@ -0,0 +1,322 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/counter/module/v1/module.proto
package types
import (
_ "cosmossdk.io/depinject/appconfig/v1alpha1"
fmt "fmt"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Module is the config object of the counter module.
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"`
}
func (m *Module) Reset() { *m = Module{} }
func (m *Module) String() string { return proto.CompactTextString(m) }
func (*Module) ProtoMessage() {}
func (*Module) Descriptor() ([]byte, []int) {
return fileDescriptor_917f5b05718fd5a3, []int{0}
}
func (m *Module) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Module.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 *Module) XXX_Merge(src proto.Message) {
xxx_messageInfo_Module.Merge(m, src)
}
func (m *Module) XXX_Size() int {
return m.Size()
}
func (m *Module) XXX_DiscardUnknown() {
xxx_messageInfo_Module.DiscardUnknown(m)
}
var xxx_messageInfo_Module proto.InternalMessageInfo
func (m *Module) GetAuthority() string {
if m != nil {
return m.Authority
}
return ""
}
func init() {
proto.RegisterType((*Module)(nil), "cosmos.counter.module.v1.Module")
}
func init() {
proto.RegisterFile("cosmos/counter/module/v1/module.proto", fileDescriptor_917f5b05718fd5a3)
}
var fileDescriptor_917f5b05718fd5a3 = []byte{
// 201 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce,
0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0xcf, 0xcd, 0x4f, 0x29, 0xcd,
0x49, 0xd5, 0x2f, 0x33, 0x84, 0xb2, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x24, 0x20, 0xca,
0xf4, 0xa0, 0xca, 0xf4, 0xa0, 0x92, 0x65, 0x86, 0x52, 0x0a, 0x50, 0x03, 0x12, 0x0b, 0x0a, 0xf4,
0xcb, 0x0c, 0x13, 0x73, 0x0a, 0x32, 0x12, 0x51, 0xf5, 0x2a, 0xc5, 0x73, 0xb1, 0xf9, 0x82, 0xf9,
0x42, 0x32, 0x5c, 0x9c, 0x89, 0xa5, 0x25, 0x19, 0xf9, 0x45, 0x99, 0x25, 0x95, 0x12, 0x8c, 0x0a,
0x8c, 0x1a, 0x9c, 0x41, 0x08, 0x01, 0x2b, 0xf3, 0x5d, 0x07, 0xa6, 0xdd, 0x62, 0x34, 0xe4, 0xd2,
0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0xbb, 0x0e, 0x44, 0xe9,
0x16, 0xa7, 0x64, 0xeb, 0x97, 0xa4, 0x16, 0x97, 0x94, 0x96, 0x64, 0xe6, 0xe8, 0x57, 0xc0, 0xdc,
0xec, 0xe4, 0x7f, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e,
0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xa6, 0x24, 0x1a,
0xa5, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xb8, 0x31, 0x20, 0x00, 0x00, 0xff,
0xff, 0x76, 0xab, 0xc7, 0x18, 0x1d, 0x01, 0x00, 0x00,
}
func (m *Module) 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 *Module) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Module) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Authority) > 0 {
i -= len(m.Authority)
copy(dAtA[i:], m.Authority)
i = encodeVarintModule(dAtA, i, uint64(len(m.Authority)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintModule(dAtA []byte, offset int, v uint64) int {
offset -= sovModule(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Module) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Authority)
if l > 0 {
n += 1 + l + sovModule(uint64(l))
}
return n
}
func sovModule(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozModule(x uint64) (n int) {
return sovModule(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Module) 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 ErrIntOverflowModule
}
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: Module: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Module: 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 ErrIntOverflowModule
}
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 ErrInvalidLengthModule
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthModule
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Authority = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipModule(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthModule
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipModule(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowModule
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowModule
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowModule
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthModule
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupModule
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthModule
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthModule = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowModule = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupModule = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,511 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/counter/v1/query.proto
package types
import (
context "context"
fmt "fmt"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// QueryGetCountRequest defines the request type for querying x/mock count.
type QueryGetCountRequest struct {
}
func (m *QueryGetCountRequest) Reset() { *m = QueryGetCountRequest{} }
func (m *QueryGetCountRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetCountRequest) ProtoMessage() {}
func (*QueryGetCountRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_bd21727562626c9f, []int{0}
}
func (m *QueryGetCountRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryGetCountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryGetCountRequest.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 *QueryGetCountRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryGetCountRequest.Merge(m, src)
}
func (m *QueryGetCountRequest) XXX_Size() int {
return m.Size()
}
func (m *QueryGetCountRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryGetCountRequest.DiscardUnknown(m)
}
var xxx_messageInfo_QueryGetCountRequest proto.InternalMessageInfo
// QueryGetCountResponse defines the response type for querying x/mock count.
type QueryGetCountResponse struct {
TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
}
func (m *QueryGetCountResponse) Reset() { *m = QueryGetCountResponse{} }
func (m *QueryGetCountResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetCountResponse) ProtoMessage() {}
func (*QueryGetCountResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_bd21727562626c9f, []int{1}
}
func (m *QueryGetCountResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryGetCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryGetCountResponse.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 *QueryGetCountResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryGetCountResponse.Merge(m, src)
}
func (m *QueryGetCountResponse) XXX_Size() int {
return m.Size()
}
func (m *QueryGetCountResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryGetCountResponse.DiscardUnknown(m)
}
var xxx_messageInfo_QueryGetCountResponse proto.InternalMessageInfo
func (m *QueryGetCountResponse) GetTotalCount() int64 {
if m != nil {
return m.TotalCount
}
return 0
}
func init() {
proto.RegisterType((*QueryGetCountRequest)(nil), "cosmos.counter.v1.QueryGetCountRequest")
proto.RegisterType((*QueryGetCountResponse)(nil), "cosmos.counter.v1.QueryGetCountResponse")
}
func init() { proto.RegisterFile("cosmos/counter/v1/query.proto", fileDescriptor_bd21727562626c9f) }
var fileDescriptor_bd21727562626c9f = []byte{
// 220 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0x2f, 0xce,
0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0x2c,
0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x48, 0xeb, 0x41, 0xa5,
0xf5, 0xca, 0x0c, 0x95, 0xc4, 0xb8, 0x44, 0x02, 0x41, 0x2a, 0xdc, 0x53, 0x4b, 0x9c, 0x41, 0xa2,
0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0x16, 0x5c, 0xa2, 0x68, 0xe2, 0xc5, 0x05, 0xf9,
0x79, 0xc5, 0xa9, 0x42, 0xf2, 0x5c, 0xdc, 0x25, 0xf9, 0x25, 0x89, 0x39, 0xf1, 0x60, 0x43, 0x24,
0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0xb8, 0xc0, 0x42, 0x60, 0x85, 0x46, 0x69, 0x5c, 0xac, 0x60,
0x9d, 0x42, 0xb1, 0x5c, 0x1c, 0x30, 0xdd, 0x42, 0xea, 0x7a, 0x18, 0x56, 0xeb, 0x61, 0xb3, 0x57,
0x4a, 0x83, 0xb0, 0x42, 0x88, 0x43, 0x9c, 0xfc, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e,
0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58,
0x8e, 0x21, 0xca, 0x34, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x1e,
0x20, 0x20, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x24, 0xb5, 0xb8, 0xa4, 0xb4, 0x24, 0x33, 0x47,
0xbf, 0x02, 0x1e, 0x4c, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x40, 0x32, 0x06, 0x04,
0x00, 0x00, 0xff, 0xff, 0x26, 0xa6, 0xde, 0x58, 0x45, 0x01, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// QueryClient is the client API for Query service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QueryClient interface {
// GetCount queries the parameters of x/Counter module.
GetCount(ctx context.Context, in *QueryGetCountRequest, opts ...grpc.CallOption) (*QueryGetCountResponse, error)
}
type queryClient struct {
cc grpc1.ClientConn
}
func NewQueryClient(cc grpc1.ClientConn) QueryClient {
return &queryClient{cc}
}
func (c *queryClient) GetCount(ctx context.Context, in *QueryGetCountRequest, opts ...grpc.CallOption) (*QueryGetCountResponse, error) {
out := new(QueryGetCountResponse)
err := c.cc.Invoke(ctx, "/cosmos.counter.v1.Query/GetCount", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
type QueryServer interface {
// GetCount queries the parameters of x/Counter module.
GetCount(context.Context, *QueryGetCountRequest) (*QueryGetCountResponse, error)
}
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
type UnimplementedQueryServer struct {
}
func (*UnimplementedQueryServer) GetCount(ctx context.Context, req *QueryGetCountRequest) (*QueryGetCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCount not implemented")
}
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
s.RegisterService(&_Query_serviceDesc, srv)
}
func _Query_GetCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetCountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/cosmos.counter.v1.Query/GetCount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetCount(ctx, req.(*QueryGetCountRequest))
}
return interceptor(ctx, in, info, handler)
}
var Query_serviceDesc = _Query_serviceDesc
var _Query_serviceDesc = grpc.ServiceDesc{
ServiceName: "cosmos.counter.v1.Query",
HandlerType: (*QueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetCount",
Handler: _Query_GetCount_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/counter/v1/query.proto",
}
func (m *QueryGetCountRequest) 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 *QueryGetCountRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryGetCountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
return len(dAtA) - i, nil
}
func (m *QueryGetCountResponse) 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 *QueryGetCountResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryGetCountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.TotalCount != 0 {
i = encodeVarintQuery(dAtA, i, uint64(m.TotalCount))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
offset -= sovQuery(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *QueryGetCountRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func (m *QueryGetCountResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.TotalCount != 0 {
n += 1 + sovQuery(uint64(m.TotalCount))
}
return n
}
func sovQuery(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozQuery(x uint64) (n int) {
return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *QueryGetCountRequest) 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 ErrIntOverflowQuery
}
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: QueryGetCountRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryGetCountRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *QueryGetCountResponse) 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 ErrIntOverflowQuery
}
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: QueryGetCountResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryGetCountResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field TotalCount", wireType)
}
m.TotalCount = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.TotalCount |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipQuery(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowQuery
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowQuery
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowQuery
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthQuery
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupQuery
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthQuery
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,611 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/counter/v1/tx.proto
package types
import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// MsgIncreaseCounter defines a count Msg service counter.
type MsgIncreaseCounter struct {
// signer is the address that controls the module (defaults to x/gov unless overwritten).
Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"`
// count is the number of times to increment the counter.
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
}
func (m *MsgIncreaseCounter) Reset() { *m = MsgIncreaseCounter{} }
func (m *MsgIncreaseCounter) String() string { return proto.CompactTextString(m) }
func (*MsgIncreaseCounter) ProtoMessage() {}
func (*MsgIncreaseCounter) Descriptor() ([]byte, []int) {
return fileDescriptor_16b86a09a73a7eb5, []int{0}
}
func (m *MsgIncreaseCounter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *MsgIncreaseCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgIncreaseCounter.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 *MsgIncreaseCounter) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgIncreaseCounter.Merge(m, src)
}
func (m *MsgIncreaseCounter) XXX_Size() int {
return m.Size()
}
func (m *MsgIncreaseCounter) XXX_DiscardUnknown() {
xxx_messageInfo_MsgIncreaseCounter.DiscardUnknown(m)
}
var xxx_messageInfo_MsgIncreaseCounter proto.InternalMessageInfo
func (m *MsgIncreaseCounter) GetSigner() string {
if m != nil {
return m.Signer
}
return ""
}
func (m *MsgIncreaseCounter) GetCount() int64 {
if m != nil {
return m.Count
}
return 0
}
// MsgIncreaseCountResponse is the Msg/Counter response type.
type MsgIncreaseCountResponse struct {
// new_count is the number of times the counter was incremented.
NewCount int64 `protobuf:"varint,1,opt,name=new_count,json=newCount,proto3" json:"new_count,omitempty"`
}
func (m *MsgIncreaseCountResponse) Reset() { *m = MsgIncreaseCountResponse{} }
func (m *MsgIncreaseCountResponse) String() string { return proto.CompactTextString(m) }
func (*MsgIncreaseCountResponse) ProtoMessage() {}
func (*MsgIncreaseCountResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_16b86a09a73a7eb5, []int{1}
}
func (m *MsgIncreaseCountResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *MsgIncreaseCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgIncreaseCountResponse.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 *MsgIncreaseCountResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgIncreaseCountResponse.Merge(m, src)
}
func (m *MsgIncreaseCountResponse) XXX_Size() int {
return m.Size()
}
func (m *MsgIncreaseCountResponse) XXX_DiscardUnknown() {
xxx_messageInfo_MsgIncreaseCountResponse.DiscardUnknown(m)
}
var xxx_messageInfo_MsgIncreaseCountResponse proto.InternalMessageInfo
func (m *MsgIncreaseCountResponse) GetNewCount() int64 {
if m != nil {
return m.NewCount
}
return 0
}
func init() {
proto.RegisterType((*MsgIncreaseCounter)(nil), "cosmos.counter.v1.MsgIncreaseCounter")
proto.RegisterType((*MsgIncreaseCountResponse)(nil), "cosmos.counter.v1.MsgIncreaseCountResponse")
}
func init() { proto.RegisterFile("cosmos/counter/v1/tx.proto", fileDescriptor_16b86a09a73a7eb5) }
var fileDescriptor_16b86a09a73a7eb5 = []byte{
// 337 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xce, 0x2f, 0xce,
0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0xa9,
0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0xc8, 0xe9, 0x41, 0xe5, 0xf4, 0xca, 0x0c,
0xa5, 0x24, 0x21, 0x42, 0xf1, 0x60, 0x05, 0xfa, 0x50, 0x79, 0x30, 0x47, 0x4a, 0x1c, 0x6a, 0x52,
0x6e, 0x71, 0x3a, 0xc8, 0x94, 0xdc, 0xe2, 0x74, 0xa8, 0x84, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe,
0x3e, 0x98, 0x84, 0x08, 0x29, 0x75, 0x32, 0x72, 0x09, 0xf9, 0x16, 0xa7, 0x7b, 0xe6, 0x25, 0x17,
0xa5, 0x26, 0x16, 0xa7, 0x3a, 0x43, 0x2c, 0x10, 0x32, 0xe0, 0x62, 0x2b, 0xce, 0x4c, 0xcf, 0x4b,
0x2d, 0x92, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x92, 0xb8, 0xb4, 0x45, 0x57, 0x04, 0x6a, 0x89,
0x63, 0x4a, 0x4a, 0x51, 0x6a, 0x71, 0x71, 0x70, 0x49, 0x51, 0x66, 0x5e, 0x7a, 0x10, 0x54, 0x9d,
0x90, 0x08, 0x17, 0x2b, 0xd8, 0x75, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x10, 0x8e, 0x95,
0x76, 0xd3, 0xf3, 0x0d, 0x5a, 0x50, 0x25, 0x5d, 0xcf, 0x37, 0x68, 0x49, 0x43, 0xcc, 0xd0, 0x2d,
0x4e, 0xc9, 0xd6, 0xcf, 0x84, 0xda, 0x19, 0x0f, 0xf5, 0x95, 0x92, 0x39, 0x97, 0x04, 0xba, 0x53,
0x82, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0xa4, 0xb9, 0x38, 0xf3, 0x52, 0xcb, 0x21,
0x4a, 0xc1, 0x6e, 0x62, 0x0e, 0xe2, 0xc8, 0x4b, 0x2d, 0x07, 0x2b, 0x32, 0x2a, 0xe4, 0x62, 0xf6,
0x2d, 0x4e, 0x17, 0x4a, 0xe6, 0xe2, 0x45, 0xd1, 0x2c, 0xa4, 0xaa, 0x87, 0x11, 0x6e, 0x7a, 0x98,
0x9e, 0x95, 0xd2, 0x26, 0x42, 0x19, 0xcc, 0x21, 0x52, 0xac, 0x0d, 0xcf, 0x37, 0x68, 0x31, 0x3a,
0xf9, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e,
0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x69, 0x7a, 0x66, 0x49,
0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x3c, 0x4a, 0xe1, 0x9e, 0x2e, 0x49, 0x2d, 0x2e,
0x29, 0x2d, 0xc9, 0xcc, 0xd1, 0xaf, 0x80, 0x47, 0x74, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b,
0x38, 0x3e, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x95, 0x33, 0x6d, 0xbf, 0x07, 0x02, 0x00,
0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// MsgClient is the client API for Msg service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MsgClient interface {
// IncreaseCount increments the counter by the specified amount.
IncreaseCount(ctx context.Context, in *MsgIncreaseCounter, opts ...grpc.CallOption) (*MsgIncreaseCountResponse, error)
}
type msgClient struct {
cc grpc1.ClientConn
}
func NewMsgClient(cc grpc1.ClientConn) MsgClient {
return &msgClient{cc}
}
func (c *msgClient) IncreaseCount(ctx context.Context, in *MsgIncreaseCounter, opts ...grpc.CallOption) (*MsgIncreaseCountResponse, error) {
out := new(MsgIncreaseCountResponse)
err := c.cc.Invoke(ctx, "/cosmos.counter.v1.Msg/IncreaseCount", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MsgServer is the server API for Msg service.
type MsgServer interface {
// IncreaseCount increments the counter by the specified amount.
IncreaseCount(context.Context, *MsgIncreaseCounter) (*MsgIncreaseCountResponse, error)
}
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
type UnimplementedMsgServer struct {
}
func (*UnimplementedMsgServer) IncreaseCount(ctx context.Context, req *MsgIncreaseCounter) (*MsgIncreaseCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IncreaseCount not implemented")
}
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
s.RegisterService(&_Msg_serviceDesc, srv)
}
func _Msg_IncreaseCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgIncreaseCounter)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).IncreaseCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/cosmos.counter.v1.Msg/IncreaseCount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).IncreaseCount(ctx, req.(*MsgIncreaseCounter))
}
return interceptor(ctx, in, info, handler)
}
var Msg_serviceDesc = _Msg_serviceDesc
var _Msg_serviceDesc = grpc.ServiceDesc{
ServiceName: "cosmos.counter.v1.Msg",
HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "IncreaseCount",
Handler: _Msg_IncreaseCount_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/counter/v1/tx.proto",
}
func (m *MsgIncreaseCounter) 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 *MsgIncreaseCounter) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *MsgIncreaseCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Count != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.Count))
i--
dAtA[i] = 0x10
}
if len(m.Signer) > 0 {
i -= len(m.Signer)
copy(dAtA[i:], m.Signer)
i = encodeVarintTx(dAtA, i, uint64(len(m.Signer)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *MsgIncreaseCountResponse) 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 *MsgIncreaseCountResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *MsgIncreaseCountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.NewCount != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.NewCount))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
offset -= sovTx(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *MsgIncreaseCounter) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Signer)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
if m.Count != 0 {
n += 1 + sovTx(uint64(m.Count))
}
return n
}
func (m *MsgIncreaseCountResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.NewCount != 0 {
n += 1 + sovTx(uint64(m.NewCount))
}
return n
}
func sovTx(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozTx(x uint64) (n int) {
return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *MsgIncreaseCounter) 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: MsgIncreaseCounter: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: MsgIncreaseCounter: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType)
}
m.Count = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Count |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *MsgIncreaseCountResponse) 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: MsgIncreaseCountResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: MsgIncreaseCountResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field NewCount", wireType)
}
m.NewCount = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.NewCount |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipTx(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTx
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTx
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTx
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthTx
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupTx
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthTx
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowTx = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -129,7 +129,11 @@ func createTestSuite(t *testing.T) suite {
depinject.Supply(sdklog.NewNopLogger()),
),
simtestutil.DefaultStartUpConfig(),
&res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.DistributionKeeper, &res.StakingKeeper,
&res.AccountKeeper,
&res.BankKeeper,
&res.GovKeeper,
&res.DistributionKeeper,
&res.StakingKeeper,
)
require.NoError(t, err)