From ee458eb6c4362305fa08fad6dff5c32b6c9c6252 Mon Sep 17 00:00:00 2001 From: Jeancarlo Barrios Date: Thu, 2 Mar 2023 16:43:09 -0500 Subject: [PATCH] feat(autocli): add simple msg support (#14832) Co-authored-by: Aaron Craelius Co-authored-by: Aaron Craelius --- client/v2/autocli/app.go | 60 +- client/v2/autocli/common.go | 110 + client/v2/autocli/common_test.go | 56 + client/v2/autocli/msg.go | 116 + client/v2/autocli/msg_test.go | 359 ++ client/v2/autocli/query.go | 132 +- client/v2/autocli/query_test.go | 84 +- .../testdata/help-deprecated-msg.golden | 38 + .../v2/autocli/testdata/help-echo-msg.golden | 40 + client/v2/autocli/testdata/help-echo.golden | 2 +- .../autocli/testdata/help-toplevel-msg.golden | 17 + client/v2/autocli/util.go | 19 + client/v2/internal/testpb/msg.proto | 53 + client/v2/internal/testpb/msg.pulsar.go | 3553 +++++++++++++++++ client/v2/internal/testpb/msg_grpc.pb.go | 107 + 15 files changed, 4570 insertions(+), 176 deletions(-) create mode 100644 client/v2/autocli/common.go create mode 100644 client/v2/autocli/common_test.go create mode 100644 client/v2/autocli/msg.go create mode 100644 client/v2/autocli/msg_test.go create mode 100644 client/v2/autocli/testdata/help-deprecated-msg.golden create mode 100644 client/v2/autocli/testdata/help-echo-msg.golden create mode 100644 client/v2/autocli/testdata/help-toplevel-msg.golden create mode 100644 client/v2/internal/testpb/msg.proto create mode 100644 client/v2/internal/testpb/msg.pulsar.go create mode 100644 client/v2/internal/testpb/msg_grpc.pb.go diff --git a/client/v2/autocli/app.go b/client/v2/autocli/app.go index 4eb18cf3fb..e99763d93f 100644 --- a/client/v2/autocli/app.go +++ b/client/v2/autocli/app.go @@ -4,6 +4,7 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/core/appmodule" "cosmossdk.io/depinject" + "fmt" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" @@ -79,19 +80,41 @@ func (appOptions AppOptions) EnhanceRootCommandWithBuilder(rootCmd *cobra.Comman } customQueryCmds := map[string]*cobra.Command{} + customMsgCmds := map[string]*cobra.Command{} for name, module := range appOptions.Modules { - if module, ok := module.(HasCustomQueryCommand); ok { - cmd := module.GetQueryCmd() + if queryModule, ok := module.(HasCustomQueryCommand); ok { + queryCmd := queryModule.GetQueryCmd() // filter any nil commands - if cmd != nil { - customQueryCmds[name] = cmd + if queryCmd != nil { + customQueryCmds[name] = queryCmd + } + } + if msgModule, ok := module.(HasCustomTxCommand); ok { + msgCmd := msgModule.GetTxCmd() + // filter any nil commands + if msgCmd != nil { + customMsgCmds[name] = msgCmd } } } // if we have an existing query command, enhance it or build a custom one + enhanceQuery := func(cmd *cobra.Command, modOpts *autocliv1.ModuleOptions, moduleName string) error { + queryCmdDesc := modOpts.Query + if queryCmdDesc != nil { + subCmd := topLevelCmd(moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) + err := builder.AddQueryServiceCommands(cmd, queryCmdDesc) + if err != nil { + return err + } + + cmd.AddCommand(subCmd) + } + return nil + } + if queryCmd := findSubCommand(rootCmd, "query"); queryCmd != nil { - if err := builder.EnhanceQueryCommand(queryCmd, moduleOptions, customQueryCmds); err != nil { + if err := builder.enhanceCommandCommon(queryCmd, moduleOptions, customQueryCmds, enhanceQuery); err != nil { return err } } else { @@ -103,5 +126,32 @@ func (appOptions AppOptions) EnhanceRootCommandWithBuilder(rootCmd *cobra.Comman rootCmd.AddCommand(queryCmd) } + enhanceMsg := func(cmd *cobra.Command, modOpts *autocliv1.ModuleOptions, moduleName string) error { + txCmdDesc := modOpts.Tx + if txCmdDesc != nil { + subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + err := builder.AddQueryServiceCommands(cmd, txCmdDesc) + if err != nil { + return err + } + + cmd.AddCommand(subCmd) + } + return nil + } + + if msgCmd := findSubCommand(rootCmd, "tx"); msgCmd != nil { + if err := builder.enhanceCommandCommon(msgCmd, moduleOptions, customQueryCmds, enhanceMsg); err != nil { + return err + } + } else { + subCmd, err := builder.BuildMsgCommand(moduleOptions, customQueryCmds) + if err != nil { + return err + } + + rootCmd.AddCommand(subCmd) + } + return nil } diff --git a/client/v2/autocli/common.go b/client/v2/autocli/common.go new file mode 100644 index 0000000000..b7df4ed36f --- /dev/null +++ b/client/v2/autocli/common.go @@ -0,0 +1,110 @@ +package autocli + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "github.com/spf13/cobra" + "google.golang.org/protobuf/reflect/protoreflect" + + "cosmossdk.io/client/v2/internal/util" +) + +func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescriptor, options *autocliv1.RpcCommandOptions, exec func(cmd *cobra.Command, input protoreflect.Message) error) (*cobra.Command, error) { + if options == nil { + // use the defaults + options = &autocliv1.RpcCommandOptions{} + } + + if options.Skip { + return nil, nil + } + + long := options.Long + if long == "" { + long = util.DescriptorDocs(descriptor) + } + + inputDesc := descriptor.Input() + inputType := util.ResolveMessageType(b.TypeResolver, inputDesc) + + use := options.Use + if use == "" { + use = protoNameToCliName(descriptor.Name()) + } + + cmd := &cobra.Command{ + Use: use, + Long: long, + Short: options.Short, + Example: options.Example, + Aliases: options.Alias, + SuggestFor: options.SuggestFor, + Deprecated: options.Deprecated, + Version: options.Version, + } + + binder, err := b.AddMessageFlags(cmd.Context(), cmd.Flags(), inputType, options) + if err != nil { + return nil, err + } + + cmd.Args = binder.CobraArgs + + cmd.RunE = func(cmd *cobra.Command, args []string) error { + input, err := binder.BuildMessage(args) + if err != nil { + return err + } + + return exec(cmd, input) + } + + if b.AddQueryConnFlags != nil { + b.AddQueryConnFlags(cmd) + } + + return cmd, nil +} + +// enhanceCommandCommon enhances the provided query or msg command with either generated commands based on the provided module +// options or the provided custom commands for each module. If the provided query command already contains a command +// for a module, that command is not over-written by this method. This allows a graceful addition of autocli to +// automatically fill in missing commands. +func (b *Builder) enhanceCommandCommon(cmd *cobra.Command, moduleOptions map[string]*autocliv1.ModuleOptions, customCmds map[string]*cobra.Command, buildModuleCommand func(*cobra.Command, *autocliv1.ModuleOptions, string) error) error { + allModuleNames := map[string]bool{} + for moduleName := range moduleOptions { + allModuleNames[moduleName] = true + } + for moduleName := range customCmds { + allModuleNames[moduleName] = true + } + + for moduleName := range allModuleNames { + // if we have an existing command skip adding one here + if cmd.HasSubCommands() { + if _, _, err := cmd.Find([]string{moduleName}); err == nil { + // command already exists, skip + continue + } + } + + // if we have a custom command use that instead of generating one + if custom := customCmds[moduleName]; custom != nil { + // custom commands get added lower down + cmd.AddCommand(custom) + continue + } + + // check for autocli options + modOpts := moduleOptions[moduleName] + if modOpts == nil { + continue + } + + err := buildModuleCommand(cmd, modOpts, moduleName) + if err != nil { + return err + } + } + + return nil +} diff --git a/client/v2/autocli/common_test.go b/client/v2/autocli/common_test.go new file mode 100644 index 0000000000..d865c92de0 --- /dev/null +++ b/client/v2/autocli/common_test.go @@ -0,0 +1,56 @@ +package autocli + +import ( + "bytes" + "cosmossdk.io/client/v2/internal/testpb" + "github.com/spf13/cobra" + "google.golang.org/grpc" + "gotest.tools/v3/assert" + + "google.golang.org/grpc/credentials/insecure" + "net" + "testing" +) + +func testExecCommon(t *testing.T, buildModuleCommand func(string, *Builder) (*cobra.Command, error), args ...string) *testClientConn { + server := grpc.NewServer() + testpb.RegisterQueryServer(server, &testEchoServer{}) + listener, err := net.Listen("tcp", "127.0.0.1:0") + assert.NilError(t, err) + go func() { + err := server.Serve(listener) + if err != nil { + panic(err) + } + }() + + clientConn, err := grpc.Dial(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())) + assert.NilError(t, err) + defer func() { + err := clientConn.Close() + if err != nil { + panic(err) + } + }() + + conn := &testClientConn{ + ClientConn: clientConn, + t: t, + out: &bytes.Buffer{}, + errorOut: &bytes.Buffer{}, + } + b := &Builder{ + GetClientConn: func(*cobra.Command) (grpc.ClientConnInterface, error) { + return conn, nil + }, + } + + cmd, err := buildModuleCommand("test", b) + assert.NilError(t, err) + assert.NilError(t, err) + cmd.SetArgs(args) + cmd.SetOut(conn.out) + cmd.SetErr(conn.errorOut) + cmd.Execute() + return conn +} diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go new file mode 100644 index 0000000000..6586cf5fe0 --- /dev/null +++ b/client/v2/autocli/msg.go @@ -0,0 +1,116 @@ +package autocli + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "github.com/cockroachdb/errors" + "github.com/spf13/cobra" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" +) + +// BuildMsgCommand builds the msg commands for all the provided modules. If a custom command is provided for a +// module, this is used instead of any automatically generated CLI commands. This allows apps to a fully dynamic client +// with a more customized experience if a binary with custom commands is downloaded. +func (b *Builder) BuildMsgCommand(moduleOptions map[string]*autocliv1.ModuleOptions, customCmds map[string]*cobra.Command) (*cobra.Command, error) { + msgCmd := topLevelCmd("tx", "Transaction subcommands") + enhanceMsg := func(cmd *cobra.Command, modOpts *autocliv1.ModuleOptions, moduleName string) error { + txCmdDesc := modOpts.Tx + if txCmdDesc != nil { + subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + err := b.AddMsgServiceCommands(cmd, txCmdDesc) + if err != nil { + return err + } + + cmd.AddCommand(subCmd) + } + return nil + } + if err := b.enhanceCommandCommon(msgCmd, moduleOptions, customCmds, enhanceMsg); err != nil { + return nil, err + } + + return msgCmd, nil +} + +// AddMsgServiceCommands adds a sub-command to the provided command for each +// method in the specified service and returns the command. This can be used in +// order to add auto-generated commands to an existing command. +func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autocliv1.ServiceCommandDescriptor) error { + for cmdName, subCmdDescriptor := range cmdDescriptor.SubCommands { + subCmd := topLevelCmd(cmdName, fmt.Sprintf("Tx commands for the %s service", subCmdDescriptor.Service)) + // Add recursive sub-commands if there are any. This is used for nested services. + err := b.AddMsgServiceCommands(subCmd, subCmdDescriptor) + if err != nil { + return err + } + cmd.AddCommand(subCmd) + } + + if cmdDescriptor.Service == "" { + // skip empty command descriptor + return nil + } + + resolver := b.FileResolver + if b.FileResolver == nil { + resolver = protoregistry.GlobalFiles + } + + descriptor, err := resolver.FindDescriptorByName(protoreflect.FullName(cmdDescriptor.Service)) + if err != nil { + return errors.Errorf("can't find service %s: %v", cmdDescriptor.Service, err) + } + service := descriptor.(protoreflect.ServiceDescriptor) + methods := service.Methods() + + rpcOptMap := map[protoreflect.Name]*autocliv1.RpcCommandOptions{} + for _, option := range cmdDescriptor.RpcCommandOptions { + methodName := protoreflect.Name(option.RpcMethod) + // validate that methods exist + if m := methods.ByName(methodName); m == nil { + return fmt.Errorf("rpc method %q not found for service %q", methodName, service.FullName()) + + } + rpcOptMap[methodName] = option + + } + + methodsLength := methods.Len() + for i := 0; i < methodsLength; i++ { + methodDescriptor := methods.Get(i) + methodOpts := rpcOptMap[methodDescriptor.Name()] + methodCmd, err := b.BuildMsgMethodCommand(methodDescriptor, methodOpts) + if err != nil { + return err + } + if methodCmd != nil { + cmd.AddCommand(methodCmd) + } + } + + return nil +} + +func (b *Builder) BuildMsgMethodCommand(descriptor protoreflect.MethodDescriptor, options *autocliv1.RpcCommandOptions) (*cobra.Command, error) { + jsonMarshalOptions := protojson.MarshalOptions{ + Indent: " ", + UseProtoNames: true, + UseEnumNumbers: false, + EmitUnpopulated: true, + Resolver: b.TypeResolver, + } + + return b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error { + bz, err := jsonMarshalOptions.Marshal(input.Interface()) + if err != nil { + return err + } + + _, err = fmt.Fprintln(cmd.OutOrStdout(), string(bz)) + return err + }) +} diff --git a/client/v2/autocli/msg_test.go b/client/v2/autocli/msg_test.go new file mode 100644 index 0000000000..fd8e2a041e --- /dev/null +++ b/client/v2/autocli/msg_test.go @@ -0,0 +1,359 @@ +package autocli + +import ( + "fmt" + "google.golang.org/protobuf/encoding/protojson" + "strings" + "testing" + + "gotest.tools/v3/golden" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "github.com/spf13/cobra" + "gotest.tools/v3/assert" + + "cosmossdk.io/client/v2/internal/testpb" +) + +var buildModuleMsgCommand = func(moduleName string, b *Builder) (*cobra.Command, error) { + cmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + + err := b.AddMsgServiceCommands(cmd, testCmdMsgDesc) + return cmd, err +} + +var testCmdMsgDesc = &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + Use: "send [pos1] [pos2] [pos3...]", + Version: "1.0", + Alias: []string{"s"}, + SuggestFor: []string{"send"}, + Example: "send 1 abc {}", + Short: "send msg the value provided by the user", + Long: "send msg the value provided by the user as a proto JSON object with populated with the provided fields and positional arguments", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + { + ProtoField: "positional1", + }, + { + ProtoField: "positional2", + }, + { + ProtoField: "positional3_varargs", + Varargs: true, + }, + }, + FlagOptions: map[string]*autocliv1.FlagOptions{ + "u32": { + Name: "uint32", + Shorthand: "u", + Usage: "some random uint32", + }, + "i32": { + Usage: "some random int32", + DefaultValue: "3", + }, + "u64": { + Usage: "some random uint64", + DefaultValue: "5", + }, + "deprecated_field": { + Deprecated: "don't use this", + }, + "shorthand_deprecated_field": { + Shorthand: "d", + Deprecated: "bad idea", + }, + "hidden_bool": { + Hidden: true, + }, + }, + }, + }, + SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ + // we test the sub-command functionality using the same service with different options + "deprecatedmsg": { + Service: testpb.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + Deprecated: "dont use this", + Short: "deprecated subcommand", + }, + }, + }, + "skipmsg": { + Service: testpb.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + Skip: true, + Short: "skip subcommand", + }, + }, + }, + }, +} + +func TestMsgOptions(t *testing.T) { + conn := testExecCommon(t, + buildModuleMsgCommand, + "send", "5", "6", `{"denom":"foo","amount":"1"}`, + "--uint32", "7", + "--u64", "8", + ) + response := conn.out.String() + var output testpb.MsgRequest + err := protojson.Unmarshal([]byte(response), &output) + assert.NilError(t, err) + assert.Equal(t, output.GetU32(), uint32(7)) + assert.Equal(t, output.GetPositional1(), int32(5)) + assert.Equal(t, output.GetPositional2(), "6") +} + +func TestMsgOptionsError(t *testing.T) { + conn := testExecCommon(t, buildModuleMsgCommand, + "send", "5", + "--uint32", "7", + "--u64", "8", + ) + + assert.Assert(t, strings.Contains(conn.errorOut.String(), "requires at least 3 arg")) + + conn = testExecCommon(t, buildModuleMsgCommand, + "send", "5", "6", `{"denom":"foo","amount":"1"}`, + "--uint32", "7", + "--u64", "abc", + ) + assert.Assert(t, strings.Contains(conn.errorOut.String(), "invalid argument ")) + +} + +func TestDeprecatedMsg(t *testing.T) { + conn := testExecCommon(t, buildModuleMsgCommand, "send", + "1", "abc", `{"denom":"foo","amount":"1"}`, + "--deprecated-field", "foo") + assert.Assert(t, strings.Contains(conn.out.String(), "--deprecated-field has been deprecated")) + + conn = testExecCommon(t, buildModuleMsgCommand, "send", + "1", "abc", `{"denom":"foo","amount":"1"}`, + "-d", "foo") + assert.Assert(t, strings.Contains(conn.out.String(), "--shorthand-deprecated-field has been deprecated")) +} + +func TestEverythingMsg(t *testing.T) { + conn := testExecCommon(t, buildModuleMsgCommand, + "send", + "1", + "abc", + `{"denom":"foo","amount":"1234"}`, + `{"denom":"bar","amount":"4321"}`, + "--a-bool", + "--an-enum", "two", + "--a-message", `{"bar":"abc", "baz":-3}`, + "--duration", "4h3s", + "--uint32", "27", + "--u64", "3267246890", + "--i32", "-253", + "--i64", "-234602347", + "--str", "def", + "--timestamp", "2019-01-02T00:01:02Z", + "--a-coin", `{"denom":"foo","amount":"100000"}`, + "--an-address", "cosmossdghdsfoi2134sdgh", + "--bz", "c2RncXdlZndkZ3NkZw==", + "--page-count-total", + "--page-key", "MTIzNTQ4N3NnaGRhcw==", + "--page-limit", "1000", + "--page-offset", "10", + "--page-reverse", + "--bools", "true", + "--bools", "false,false,true", + "--enums", "one", + "--enums", "five", + "--enums", "two", + "--strings", "abc", + "--strings", "xyz", + "--strings", "xyz,qrs", + "--durations", "3s", + "--durations", "5s", + "--durations", "10h", + "--some-messages", "{}", + "--some-messages", `{"bar":"baz"}`, + "--some-messages", `{"baz":-1}`, + "--uints", "1,2,3", + "--uints", "4", + ) + response := conn.out.String() + var output testpb.MsgRequest + err := protojson.Unmarshal([]byte(response), &output) + assert.NilError(t, err) + assert.Equal(t, output.GetU32(), uint32(27)) + assert.Equal(t, output.GetU64(), uint64(3267246890)) + assert.Equal(t, output.GetPositional1(), int32(1)) + assert.Equal(t, output.GetPositional2(), "abc") + assert.Equal(t, output.GetABool(), true) + assert.Equal(t, output.GetAnEnum(), testpb.Enum_ENUM_TWO) +} + +func TestHelpMsg(t *testing.T) { + conn := testExecCommon(t, buildModuleMsgCommand, "-h") + golden.Assert(t, conn.out.String(), "help-toplevel-msg.golden") + + conn = testExecCommon(t, buildModuleMsgCommand, "send", "-h") + golden.Assert(t, conn.out.String(), "help-echo-msg.golden") + + conn = testExecCommon(t, buildModuleMsgCommand, "deprecatedmsg", "send", "-h") + golden.Assert(t, conn.out.String(), "help-deprecated-msg.golden") +} + +func TestBuildCustomMsgCommand(t *testing.T) { + b := &Builder{} + customCommandCalled := false + cmd, err := b.BuildMsgCommand(map[string]*autocliv1.ModuleOptions{ + "test": { + Tx: testCmdMsgDesc, + }, + }, map[string]*cobra.Command{ + "test": {Use: "test", Run: func(cmd *cobra.Command, args []string) { + customCommandCalled = true + }}, + }) + assert.NilError(t, err) + cmd.SetArgs([]string{"test", "tx"}) + assert.NilError(t, cmd.Execute()) + assert.Assert(t, customCommandCalled) +} + +func TestErrorBuildMsgCommand(t *testing.T) { + b := &Builder{} + + commandDescriptor := &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + { + ProtoField: "un-existent-proto-field", + }, + }, + }, + }, + } + + opts := map[string]*autocliv1.ModuleOptions{ + "test": { + Tx: commandDescriptor, + }, + } + _, err := b.BuildMsgCommand(opts, nil) + assert.ErrorContains(t, err, "can't find field un-existent-proto-field") + + nonExistentService := &autocliv1.ServiceCommandDescriptor{Service: "un-existent-service"} + opts = map[string]*autocliv1.ModuleOptions{ + "test": { + Tx: nonExistentService, + }, + } + _, err = b.BuildMsgCommand(opts, nil) + assert.ErrorContains(t, err, "can't find service un-existent-service") +} + +func TestNotFoundErrorsMsg(t *testing.T) { + b := &Builder{} + buildModuleMsgCommand := func(moduleName string, cmdDescriptor *autocliv1.ServiceCommandDescriptor) (*cobra.Command, error) { + cmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + + err := b.AddMsgServiceCommands(cmd, cmdDescriptor) + return cmd, err + } + + // Query non existent service + _, err := buildModuleMsgCommand("test", &autocliv1.ServiceCommandDescriptor{Service: "un-existent-service"}) + assert.ErrorContains(t, err, "can't find service un-existent-service") + + _, err = buildModuleMsgCommand("test", &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{{RpcMethod: "un-existent-method"}}, + }) + assert.ErrorContains(t, err, "rpc method \"un-existent-method\" not found") + + _, err = buildModuleMsgCommand("test", &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + { + ProtoField: "un-existent-proto-field", + }, + }, + }, + }, + }) + assert.ErrorContains(t, err, "can't find field un-existent-proto-field") + + _, err = buildModuleMsgCommand("test", &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + FlagOptions: map[string]*autocliv1.FlagOptions{ + "un-existent-flag": {}, + }, + }, + }, + }) + assert.ErrorContains(t, err, "can't find field un-existent-flag") + +} + +func TestEnhanceMessageCommand(t *testing.T) { + b := &Builder{} + enhanceMsg := func(cmd *cobra.Command, modOpts *autocliv1.ModuleOptions, moduleName string) error { + txCmdDesc := modOpts.Tx + if txCmdDesc != nil { + subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + err := b.AddMsgServiceCommands(cmd, txCmdDesc) + if err != nil { + return err + } + + cmd.AddCommand(subCmd) + } + return nil + } + + // Test that the command has a subcommand + cmd := &cobra.Command{Use: "test"} + cmd.AddCommand(&cobra.Command{Use: "test"}) + options := map[string]*autocliv1.ModuleOptions{ + "test": {}, + } + err := b.enhanceCommandCommon(cmd, options, map[string]*cobra.Command{}, enhanceMsg) + assert.NilError(t, err) + + cmd = &cobra.Command{Use: "test"} + options = map[string]*autocliv1.ModuleOptions{} + customCommands := map[string]*cobra.Command{ + "test2": {Use: "test"}, + } + err = b.enhanceCommandCommon(cmd, options, customCommands, enhanceMsg) + assert.NilError(t, err) + + cmd = &cobra.Command{Use: "test"} + options = map[string]*autocliv1.ModuleOptions{ + "test": {Tx: nil}, + } + customCommands = map[string]*cobra.Command{} + err = b.enhanceCommandCommon(cmd, options, customCommands, enhanceMsg) + assert.NilError(t, err) + +} + +type testMessageServer struct { + testpb.UnimplementedMsgServer +} diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 2831b36aa4..d939f0d648 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -10,7 +10,6 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" - "cosmossdk.io/client/v2/internal/strcase" "cosmossdk.io/client/v2/internal/util" ) @@ -20,66 +19,25 @@ import ( func (b *Builder) BuildQueryCommand(moduleOptions map[string]*autocliv1.ModuleOptions, customCmds map[string]*cobra.Command) (*cobra.Command, error) { queryCmd := topLevelCmd("query", "Querying subcommands") queryCmd.Aliases = []string{"q"} - if err := b.EnhanceQueryCommand(queryCmd, moduleOptions, customCmds); err != nil { - return nil, err - } - return queryCmd, nil -} - -// EnhanceQueryCommand enhances the provided query command with either generated commands based on the provided module -// options or the provided custom commands for each module. If the provided query command already contains a command -// for a module, that command is not over-written by this method. This allows a graceful addition of autocli to -// automatically fill in missing commands. -func (b *Builder) EnhanceQueryCommand(queryCmd *cobra.Command, moduleOptions map[string]*autocliv1.ModuleOptions, customCmds map[string]*cobra.Command) error { - allModuleNames := map[string]bool{} - for moduleName := range moduleOptions { - allModuleNames[moduleName] = true - } - for moduleName := range customCmds { - allModuleNames[moduleName] = true - } - - for moduleName := range allModuleNames { - // if we have an existing command skip adding one here - if existing := findSubCommand(queryCmd, moduleName); existing != nil { - continue - } - - // if we have a custom command use that instead of generating one - if custom := customCmds[moduleName]; custom != nil { - // custom commands get added lower down - queryCmd.AddCommand(custom) - continue - } - - // check for autocli options - modOpts := moduleOptions[moduleName] - if modOpts == nil { - continue - } - - queryCmdDesc := modOpts.Query - if queryCmdDesc != nil { - cmd, err := b.BuildModuleQueryCommand(moduleName, queryCmdDesc) + enhanceMsg := func(cmd *cobra.Command, modOpts *autocliv1.ModuleOptions, moduleName string) error { + txQueryDesc := modOpts.Query + if txQueryDesc != nil { + subCmd := topLevelCmd(moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) + err := b.AddQueryServiceCommands(subCmd, txQueryDesc) if err != nil { return err } - queryCmd.AddCommand(cmd) + cmd.AddCommand(subCmd) } + return nil + } + if err := b.enhanceCommandCommon(queryCmd, moduleOptions, customCmds, enhanceMsg); err != nil { + return nil, err } - return nil -} - -// BuildModuleQueryCommand builds the query command for a single module. -func (b *Builder) BuildModuleQueryCommand(moduleName string, cmdDescriptor *autocliv1.ServiceCommandDescriptor) (*cobra.Command, error) { - cmd := topLevelCmd(moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) - - err := b.AddQueryServiceCommands(cmd, cmdDescriptor) - - return cmd, err + return queryCmd, nil } // AddQueryServiceCommands adds a sub-command to the provided command for each @@ -143,52 +101,10 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut // BuildQueryMethodCommand creates a gRPC query command for the given service method. This can be used to auto-generate // just a single command for a single service rpc method. func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescriptor, options *autocliv1.RpcCommandOptions) (*cobra.Command, error) { - if options == nil { - // use the defaults - options = &autocliv1.RpcCommandOptions{} - } - - if options.Skip { - return nil, nil - } - - serviceDescriptor := descriptor.Parent().(protoreflect.ServiceDescriptor) - - long := options.Long - if long == "" { - long = util.DescriptorDocs(descriptor) - } - getClientConn := b.GetClientConn + serviceDescriptor := descriptor.Parent().(protoreflect.ServiceDescriptor) methodName := fmt.Sprintf("/%s/%s", serviceDescriptor.FullName(), descriptor.Name()) - - inputDesc := descriptor.Input() - inputType := util.ResolveMessageType(b.TypeResolver, inputDesc) outputType := util.ResolveMessageType(b.TypeResolver, descriptor.Output()) - - use := options.Use - if use == "" { - use = protoNameToCliName(descriptor.Name()) - } - - cmd := &cobra.Command{ - Use: use, - Long: long, - Short: options.Short, - Example: options.Example, - Aliases: options.Alias, - SuggestFor: options.SuggestFor, - Deprecated: options.Deprecated, - Version: options.Version, - } - - binder, err := b.AddMessageFlags(cmd.Context(), cmd.Flags(), inputType, options) - if err != nil { - return nil, err - } - - cmd.Args = binder.CobraArgs - jsonMarshalOptions := protojson.MarshalOptions{ Indent: " ", UseProtoNames: true, @@ -197,17 +113,12 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript Resolver: b.TypeResolver, } - cmd.RunE = func(cmd *cobra.Command, args []string) error { + cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error { clientConn, err := getClientConn(cmd) if err != nil { return err } - input, err := binder.BuildMessage(args) - if err != nil { - return err - } - output := outputType.New() ctx := cmd.Context() err = clientConn.Invoke(ctx, methodName, input.Interface(), output.Interface()) @@ -222,6 +133,9 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript _, err = fmt.Fprintln(cmd.OutOrStdout(), string(bz)) return err + }) + if err != nil { + return nil, err } if b.AddQueryConnFlags != nil { @@ -230,17 +144,3 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript return cmd, nil } - -func protoNameToCliName(name protoreflect.Name) string { - return strcase.ToKebab(string(name)) -} - -func topLevelCmd(use, short string) *cobra.Command { - return &cobra.Command{ - Use: use, - Short: short, - DisableFlagParsing: false, - SuggestionsMinimumDistance: 2, - RunE: validateCmd, - } -} diff --git a/client/v2/autocli/query_test.go b/client/v2/autocli/query_test.go index 092263b2f3..828bd307e0 100644 --- a/client/v2/autocli/query_test.go +++ b/client/v2/autocli/query_test.go @@ -3,14 +3,13 @@ package autocli import ( "bytes" "context" - "net" + "fmt" "strings" "testing" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "github.com/spf13/cobra" "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/testing/protocmp" "gotest.tools/v3/assert" "gotest.tools/v3/golden" @@ -18,6 +17,14 @@ import ( "cosmossdk.io/client/v2/internal/testpb" ) +var buildModuleQueryCommand = func(moduleName string, b *Builder) (*cobra.Command, error) { + + cmd := topLevelCmd(moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) + + err := b.AddQueryServiceCommands(cmd, testCmdDesc) + return cmd, err +} + var testCmdDesc = &autocliv1.ServiceCommandDescriptor{ Service: testpb.Query_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ @@ -92,47 +99,8 @@ var testCmdDesc = &autocliv1.ServiceCommandDescriptor{ }, } -func testExec(t *testing.T, args ...string) *testClientConn { - server := grpc.NewServer() - testpb.RegisterQueryServer(server, &testEchoServer{}) - listener, err := net.Listen("tcp", "127.0.0.1:0") - assert.NilError(t, err) - go func() { - err := server.Serve(listener) - if err != nil { - panic(err) - } - }() - defer server.GracefulStop() - clientConn, err := grpc.Dial(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())) - assert.NilError(t, err) - defer func() { - err := clientConn.Close() - if err != nil { - panic(err) - } - }() - - conn := &testClientConn{ - ClientConn: clientConn, - t: t, - out: &bytes.Buffer{}, - } - b := &Builder{ - GetClientConn: func(*cobra.Command) (grpc.ClientConnInterface, error) { - return conn, nil - }, - } - cmd, err := b.BuildModuleQueryCommand("test", testCmdDesc) - assert.NilError(t, err) - cmd.SetArgs(args) - cmd.SetOut(conn.out) - assert.NilError(t, cmd.Execute()) - return conn -} - func TestEverything(t *testing.T) { - conn := testExec(t, + conn := testExecCommon(t, buildModuleQueryCommand, "echo", "1", "abc", @@ -177,11 +145,11 @@ func TestEverything(t *testing.T) { } func TestOptions(t *testing.T) { - conn := testExec(t, + conn := testExecCommon(t, buildModuleQueryCommand, "echo", "1", "abc", `{"denom":"foo","amount":"1"}`, "-u", "27", // shorthand - "--u64", // no opt default value + "--u64", "5", // no opt default value ) lastReq := conn.lastRequest.(*testpb.EchoRequest) assert.Equal(t, uint32(27), lastReq.U32) // shorthand got set @@ -190,26 +158,26 @@ func TestOptions(t *testing.T) { } func TestHelp(t *testing.T) { - conn := testExec(t, "-h") + conn := testExecCommon(t, buildModuleQueryCommand, "-h") golden.Assert(t, conn.out.String(), "help-toplevel.golden") - conn = testExec(t, "echo", "-h") + conn = testExecCommon(t, buildModuleQueryCommand, "echo", "-h") golden.Assert(t, conn.out.String(), "help-echo.golden") - conn = testExec(t, "deprecatedecho", "echo", "-h") + conn = testExecCommon(t, buildModuleQueryCommand, "deprecatedecho", "echo", "-h") golden.Assert(t, conn.out.String(), "help-deprecated.golden") - conn = testExec(t, "skipecho", "-h") + conn = testExecCommon(t, buildModuleQueryCommand, "skipecho", "-h") golden.Assert(t, conn.out.String(), "help-skip.golden") } func TestDeprecated(t *testing.T) { - conn := testExec(t, "echo", + conn := testExecCommon(t, buildModuleQueryCommand, "echo", "1", "abc", `{}`, "--deprecated-field", "foo") assert.Assert(t, strings.Contains(conn.out.String(), "--deprecated-field has been deprecated")) - conn = testExec(t, "echo", + conn = testExecCommon(t, buildModuleQueryCommand, "echo", "1", "abc", `{}`, "-s", "foo") assert.Assert(t, strings.Contains(conn.out.String(), "--shorthand-deprecated-field has been deprecated")) @@ -236,19 +204,26 @@ func TestBuildCustomQueryCommand(t *testing.T) { func TestNotFoundErrors(t *testing.T) { b := &Builder{} + buildModuleQueryCommand := func(moduleName string, cmdDescriptor *autocliv1.ServiceCommandDescriptor) (*cobra.Command, error) { + cmd := topLevelCmd("query", "Querying subcommands") + + err := b.AddMsgServiceCommands(cmd, cmdDescriptor) + return cmd, err + } + // bad service - _, err := b.BuildModuleQueryCommand("test", &autocliv1.ServiceCommandDescriptor{Service: "foo"}) + _, err := buildModuleQueryCommand("test", &autocliv1.ServiceCommandDescriptor{Service: "foo"}) assert.ErrorContains(t, err, "can't find service foo") // bad method - _, err = b.BuildModuleQueryCommand("test", &autocliv1.ServiceCommandDescriptor{ + _, err = buildModuleQueryCommand("test", &autocliv1.ServiceCommandDescriptor{ Service: testpb.Query_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{{RpcMethod: "bar"}}, }) assert.ErrorContains(t, err, "rpc method \"bar\" not found") // bad positional field - _, err = b.BuildModuleQueryCommand("test", &autocliv1.ServiceCommandDescriptor{ + _, err = buildModuleQueryCommand("test", &autocliv1.ServiceCommandDescriptor{ Service: testpb.Query_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { @@ -264,7 +239,7 @@ func TestNotFoundErrors(t *testing.T) { assert.ErrorContains(t, err, "can't find field foo") // bad flag field - _, err = b.BuildModuleQueryCommand("test", &autocliv1.ServiceCommandDescriptor{ + _, err = buildModuleQueryCommand("test", &autocliv1.ServiceCommandDescriptor{ Service: testpb.Query_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { @@ -284,6 +259,7 @@ type testClientConn struct { lastRequest interface{} lastResponse interface{} out *bytes.Buffer + errorOut *bytes.Buffer } func (t *testClientConn) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error { diff --git a/client/v2/autocli/testdata/help-deprecated-msg.golden b/client/v2/autocli/testdata/help-deprecated-msg.golden new file mode 100644 index 0000000000..ded8e9c79b --- /dev/null +++ b/client/v2/autocli/testdata/help-deprecated-msg.golden @@ -0,0 +1,38 @@ +Command "send" is deprecated, dont use this +deprecated subcommand + +Usage: + test deprecatedmsg send [flags] + +Flags: + --a-bool + --a-coin cosmos.base.v1beta1.Coin (json) + --a-message testpb.AMessage (json) + --an-address bech32 account address key name + --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) + --bools bools (default []) + --bz bytesBase64 + --deprecated-field string + --duration duration + --durations duration (repeated) + --enums Enum (unspecified | one | two | five | neg-three) (repeated) + -h, --help help for send + --hidden-bool + --i32 int32 + --i64 int + --page-count-total + --page-key bytesBase64 + --page-limit uint + --page-offset uint + --page-reverse + --positional1 int32 + --positional2 string + --positional3-varargs cosmos.base.v1beta1.Coin (json) (repeated) + --shorthand-deprecated-field string + --some-messages testpb.AMessage (json) (repeated) + --str string + --strings strings + --timestamp timestamp (RFC 3339) + --u32 uint32 + --u64 uint + --uints uints (default []) diff --git a/client/v2/autocli/testdata/help-echo-msg.golden b/client/v2/autocli/testdata/help-echo-msg.golden new file mode 100644 index 0000000000..eed1203f33 --- /dev/null +++ b/client/v2/autocli/testdata/help-echo-msg.golden @@ -0,0 +1,40 @@ +send msg the value provided by the user as a proto JSON object with populated with the provided fields and positional arguments + +Usage: + test send [pos1] [pos2] [pos3...] [flags] + +Aliases: + send, s + +Examples: +send 1 abc {} + +Flags: + --a-bool + --a-coin cosmos.base.v1beta1.Coin (json) + --a-message testpb.AMessage (json) + --an-address bech32 account address key name + --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) + --bools bools (default []) + --bz bytesBase64 + --deprecated-field string (DEPRECATED: don't use this) + --duration duration + --durations duration (repeated) + --enums Enum (unspecified | one | two | five | neg-three) (repeated) + -h, --help help for send + --i32 int32 some random int32 + --i64 int + --page-count-total + --page-key bytesBase64 + --page-limit uint + --page-offset uint + --page-reverse + -d, --shorthand-deprecated-field string (DEPRECATED: bad idea) + --some-messages testpb.AMessage (json) (repeated) + --str string + --strings strings + --timestamp timestamp (RFC 3339) + --u64 uint some random uint64 + -u, --uint32 uint32 some random uint32 + --uints uints (default []) + -v, --version version for send diff --git a/client/v2/autocli/testdata/help-echo.golden b/client/v2/autocli/testdata/help-echo.golden index 4f60825ed1..33b0752654 100644 --- a/client/v2/autocli/testdata/help-echo.golden +++ b/client/v2/autocli/testdata/help-echo.golden @@ -34,7 +34,7 @@ Flags: --str string --strings strings --timestamp timestamp (RFC 3339) - --u64 uint[=5] some random uint64 + --u64 uint some random uint64 -u, --uint32 uint32 some random uint32 --uints uints (default []) -v, --version version for echo diff --git a/client/v2/autocli/testdata/help-toplevel-msg.golden b/client/v2/autocli/testdata/help-toplevel-msg.golden new file mode 100644 index 0000000000..12fdc0fbdc --- /dev/null +++ b/client/v2/autocli/testdata/help-toplevel-msg.golden @@ -0,0 +1,17 @@ +Transations commands for the test module + +Usage: + test [flags] + test [command] + +Available Commands: + completion Generate the autocompletion script for the specified shell + deprecatedmsg Tx commands for the testpb.Msg service + help Help about any command + send send msg the value provided by the user + skipmsg Tx commands for the testpb.Msg service + +Flags: + -h, --help help for test + +Use "test [command] --help" for more information about a command. diff --git a/client/v2/autocli/util.go b/client/v2/autocli/util.go index 162ede1287..198007b9af 100644 --- a/client/v2/autocli/util.go +++ b/client/v2/autocli/util.go @@ -1,8 +1,10 @@ package autocli import ( + "google.golang.org/protobuf/reflect/protoreflect" "strings" + "cosmossdk.io/client/v2/internal/strcase" "github.com/spf13/cobra" ) @@ -17,3 +19,20 @@ func findSubCommand(cmd *cobra.Command, subCmdName string) *cobra.Command { } return nil } + +// topLevelCmd creates a new top-level command with the provided name and +// description. The command will have DisableFlagParsing set to false and +// SuggestionsMinimumDistance set to 2. +func topLevelCmd(use, short string) *cobra.Command { + return &cobra.Command{ + Use: use, + Short: short, + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: validateCmd, + } +} + +func protoNameToCliName(name protoreflect.Name) string { + return strcase.ToKebab(string(name)) +} diff --git a/client/v2/internal/testpb/msg.proto b/client/v2/internal/testpb/msg.proto new file mode 100644 index 0000000000..647d205172 --- /dev/null +++ b/client/v2/internal/testpb/msg.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +package testpb; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "testpb/query.proto"; + +service Msg { + // Send a request and returns the request as a response. + rpc Send(MsgRequest) returns (MsgResponse); +} + +message MsgRequest { + // u32 is an uint32 + uint32 u32 = 1; + uint64 u64 = 2; + string str = 3; + bytes bz = 4; + google.protobuf.Timestamp timestamp = 5; + google.protobuf.Duration duration = 6; + int32 i32 = 7; + int64 i64 = 10; + bool a_bool = 15; + testpb.Enum an_enum = 16; + testpb.AMessage a_message = 17; + cosmos.base.v1beta1.Coin a_coin = 18; + string an_address = 19 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.query.v1beta1.PageRequest page = 20; + repeated bool bools = 21; + repeated uint32 uints = 22; + repeated string strings = 23; + repeated testpb.Enum enums = 24; + repeated google.protobuf.Duration durations = 25; + repeated testpb.AMessage some_messages = 26; + + int32 positional1 = 27; + string positional2 = 28; + repeated cosmos.base.v1beta1.Coin positional3_varargs = 29; + + string deprecated_field = 30; + string shorthand_deprecated_field = 31; + bool hidden_bool = 32; +} + + +message MsgResponse { + MsgRequest request = 1; +} + diff --git a/client/v2/internal/testpb/msg.pulsar.go b/client/v2/internal/testpb/msg.pulsar.go new file mode 100644 index 0000000000..d0f23082d2 --- /dev/null +++ b/client/v2/internal/testpb/msg.pulsar.go @@ -0,0 +1,3553 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package testpb + +import ( + v1beta11 "cosmossdk.io/api/cosmos/base/query/v1beta1" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + 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" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_MsgRequest_21_list)(nil) + +type _MsgRequest_21_list struct { + list *[]bool +} + +func (x *_MsgRequest_21_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRequest_21_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfBool((*x.list)[i]) +} + +func (x *_MsgRequest_21_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Bool() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgRequest_21_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Bool() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRequest_21_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgRequest at list field Bools as it is not of Message kind")) +} + +func (x *_MsgRequest_21_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgRequest_21_list) NewElement() protoreflect.Value { + v := false + return protoreflect.ValueOfBool(v) +} + +func (x *_MsgRequest_21_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgRequest_22_list)(nil) + +type _MsgRequest_22_list struct { + list *[]uint32 +} + +func (x *_MsgRequest_22_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRequest_22_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfUint32((*x.list)[i]) +} + +func (x *_MsgRequest_22_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := (uint32)(valueUnwrapped) + (*x.list)[i] = concreteValue +} + +func (x *_MsgRequest_22_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := (uint32)(valueUnwrapped) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRequest_22_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgRequest at list field Uints as it is not of Message kind")) +} + +func (x *_MsgRequest_22_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgRequest_22_list) NewElement() protoreflect.Value { + v := uint32(0) + return protoreflect.ValueOfUint32(v) +} + +func (x *_MsgRequest_22_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgRequest_23_list)(nil) + +type _MsgRequest_23_list struct { + list *[]string +} + +func (x *_MsgRequest_23_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRequest_23_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgRequest_23_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgRequest_23_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRequest_23_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgRequest at list field Strings as it is not of Message kind")) +} + +func (x *_MsgRequest_23_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgRequest_23_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgRequest_23_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgRequest_24_list)(nil) + +type _MsgRequest_24_list struct { + list *[]Enum +} + +func (x *_MsgRequest_24_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRequest_24_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)((*x.list)[i])) +} + +func (x *_MsgRequest_24_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Enum() + concreteValue := (Enum)(valueUnwrapped) + (*x.list)[i] = concreteValue +} + +func (x *_MsgRequest_24_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Enum() + concreteValue := (Enum)(valueUnwrapped) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRequest_24_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgRequest at list field Enums as it is not of Message kind")) +} + +func (x *_MsgRequest_24_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgRequest_24_list) NewElement() protoreflect.Value { + v := 0 + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(v)) +} + +func (x *_MsgRequest_24_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgRequest_25_list)(nil) + +type _MsgRequest_25_list struct { + list *[]*durationpb.Duration +} + +func (x *_MsgRequest_25_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRequest_25_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgRequest_25_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*durationpb.Duration) + (*x.list)[i] = concreteValue +} + +func (x *_MsgRequest_25_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*durationpb.Duration) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRequest_25_list) AppendMutable() protoreflect.Value { + v := new(durationpb.Duration) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgRequest_25_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgRequest_25_list) NewElement() protoreflect.Value { + v := new(durationpb.Duration) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgRequest_25_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgRequest_26_list)(nil) + +type _MsgRequest_26_list struct { + list *[]*AMessage +} + +func (x *_MsgRequest_26_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRequest_26_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgRequest_26_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AMessage) + (*x.list)[i] = concreteValue +} + +func (x *_MsgRequest_26_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AMessage) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRequest_26_list) AppendMutable() protoreflect.Value { + v := new(AMessage) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgRequest_26_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgRequest_26_list) NewElement() protoreflect.Value { + v := new(AMessage) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgRequest_26_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgRequest_29_list)(nil) + +type _MsgRequest_29_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgRequest_29_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRequest_29_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgRequest_29_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgRequest_29_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRequest_29_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgRequest_29_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgRequest_29_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgRequest_29_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgRequest protoreflect.MessageDescriptor + fd_MsgRequest_u32 protoreflect.FieldDescriptor + fd_MsgRequest_u64 protoreflect.FieldDescriptor + fd_MsgRequest_str protoreflect.FieldDescriptor + fd_MsgRequest_bz protoreflect.FieldDescriptor + fd_MsgRequest_timestamp protoreflect.FieldDescriptor + fd_MsgRequest_duration protoreflect.FieldDescriptor + fd_MsgRequest_i32 protoreflect.FieldDescriptor + fd_MsgRequest_i64 protoreflect.FieldDescriptor + fd_MsgRequest_a_bool protoreflect.FieldDescriptor + fd_MsgRequest_an_enum protoreflect.FieldDescriptor + fd_MsgRequest_a_message protoreflect.FieldDescriptor + fd_MsgRequest_a_coin protoreflect.FieldDescriptor + fd_MsgRequest_an_address protoreflect.FieldDescriptor + fd_MsgRequest_page protoreflect.FieldDescriptor + fd_MsgRequest_bools protoreflect.FieldDescriptor + fd_MsgRequest_uints protoreflect.FieldDescriptor + fd_MsgRequest_strings protoreflect.FieldDescriptor + fd_MsgRequest_enums protoreflect.FieldDescriptor + fd_MsgRequest_durations protoreflect.FieldDescriptor + fd_MsgRequest_some_messages protoreflect.FieldDescriptor + fd_MsgRequest_positional1 protoreflect.FieldDescriptor + fd_MsgRequest_positional2 protoreflect.FieldDescriptor + fd_MsgRequest_positional3_varargs protoreflect.FieldDescriptor + fd_MsgRequest_deprecated_field protoreflect.FieldDescriptor + fd_MsgRequest_shorthand_deprecated_field protoreflect.FieldDescriptor + fd_MsgRequest_hidden_bool protoreflect.FieldDescriptor +) + +func init() { + file_testpb_msg_proto_init() + md_MsgRequest = File_testpb_msg_proto.Messages().ByName("MsgRequest") + fd_MsgRequest_u32 = md_MsgRequest.Fields().ByName("u32") + fd_MsgRequest_u64 = md_MsgRequest.Fields().ByName("u64") + fd_MsgRequest_str = md_MsgRequest.Fields().ByName("str") + fd_MsgRequest_bz = md_MsgRequest.Fields().ByName("bz") + fd_MsgRequest_timestamp = md_MsgRequest.Fields().ByName("timestamp") + fd_MsgRequest_duration = md_MsgRequest.Fields().ByName("duration") + fd_MsgRequest_i32 = md_MsgRequest.Fields().ByName("i32") + fd_MsgRequest_i64 = md_MsgRequest.Fields().ByName("i64") + fd_MsgRequest_a_bool = md_MsgRequest.Fields().ByName("a_bool") + fd_MsgRequest_an_enum = md_MsgRequest.Fields().ByName("an_enum") + fd_MsgRequest_a_message = md_MsgRequest.Fields().ByName("a_message") + fd_MsgRequest_a_coin = md_MsgRequest.Fields().ByName("a_coin") + fd_MsgRequest_an_address = md_MsgRequest.Fields().ByName("an_address") + fd_MsgRequest_page = md_MsgRequest.Fields().ByName("page") + fd_MsgRequest_bools = md_MsgRequest.Fields().ByName("bools") + fd_MsgRequest_uints = md_MsgRequest.Fields().ByName("uints") + fd_MsgRequest_strings = md_MsgRequest.Fields().ByName("strings") + fd_MsgRequest_enums = md_MsgRequest.Fields().ByName("enums") + fd_MsgRequest_durations = md_MsgRequest.Fields().ByName("durations") + fd_MsgRequest_some_messages = md_MsgRequest.Fields().ByName("some_messages") + fd_MsgRequest_positional1 = md_MsgRequest.Fields().ByName("positional1") + fd_MsgRequest_positional2 = md_MsgRequest.Fields().ByName("positional2") + fd_MsgRequest_positional3_varargs = md_MsgRequest.Fields().ByName("positional3_varargs") + fd_MsgRequest_deprecated_field = md_MsgRequest.Fields().ByName("deprecated_field") + fd_MsgRequest_shorthand_deprecated_field = md_MsgRequest.Fields().ByName("shorthand_deprecated_field") + fd_MsgRequest_hidden_bool = md_MsgRequest.Fields().ByName("hidden_bool") +} + +var _ protoreflect.Message = (*fastReflection_MsgRequest)(nil) + +type fastReflection_MsgRequest MsgRequest + +func (x *MsgRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRequest)(x) +} + +func (x *MsgRequest) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_msg_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_MsgRequest_messageType fastReflection_MsgRequest_messageType +var _ protoreflect.MessageType = fastReflection_MsgRequest_messageType{} + +type fastReflection_MsgRequest_messageType struct{} + +func (x fastReflection_MsgRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRequest)(nil) +} +func (x fastReflection_MsgRequest_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRequest) +} +func (x fastReflection_MsgRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRequest) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRequest +} + +// 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_MsgRequest) Type() protoreflect.MessageType { + return _fastReflection_MsgRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRequest) New() protoreflect.Message { + return new(fastReflection_MsgRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRequest) Interface() protoreflect.ProtoMessage { + return (*MsgRequest)(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_MsgRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.U32 != uint32(0) { + value := protoreflect.ValueOfUint32(x.U32) + if !f(fd_MsgRequest_u32, value) { + return + } + } + if x.U64 != uint64(0) { + value := protoreflect.ValueOfUint64(x.U64) + if !f(fd_MsgRequest_u64, value) { + return + } + } + if x.Str != "" { + value := protoreflect.ValueOfString(x.Str) + if !f(fd_MsgRequest_str, value) { + return + } + } + if len(x.Bz) != 0 { + value := protoreflect.ValueOfBytes(x.Bz) + if !f(fd_MsgRequest_bz, value) { + return + } + } + if x.Timestamp != nil { + value := protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + if !f(fd_MsgRequest_timestamp, value) { + return + } + } + if x.Duration != nil { + value := protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + if !f(fd_MsgRequest_duration, value) { + return + } + } + if x.I32 != int32(0) { + value := protoreflect.ValueOfInt32(x.I32) + if !f(fd_MsgRequest_i32, value) { + return + } + } + if x.I64 != int64(0) { + value := protoreflect.ValueOfInt64(x.I64) + if !f(fd_MsgRequest_i64, value) { + return + } + } + if x.ABool != false { + value := protoreflect.ValueOfBool(x.ABool) + if !f(fd_MsgRequest_a_bool, value) { + return + } + } + if x.AnEnum != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.AnEnum)) + if !f(fd_MsgRequest_an_enum, value) { + return + } + } + if x.AMessage != nil { + value := protoreflect.ValueOfMessage(x.AMessage.ProtoReflect()) + if !f(fd_MsgRequest_a_message, value) { + return + } + } + if x.ACoin != nil { + value := protoreflect.ValueOfMessage(x.ACoin.ProtoReflect()) + if !f(fd_MsgRequest_a_coin, value) { + return + } + } + if x.AnAddress != "" { + value := protoreflect.ValueOfString(x.AnAddress) + if !f(fd_MsgRequest_an_address, value) { + return + } + } + if x.Page != nil { + value := protoreflect.ValueOfMessage(x.Page.ProtoReflect()) + if !f(fd_MsgRequest_page, value) { + return + } + } + if len(x.Bools) != 0 { + value := protoreflect.ValueOfList(&_MsgRequest_21_list{list: &x.Bools}) + if !f(fd_MsgRequest_bools, value) { + return + } + } + if len(x.Uints) != 0 { + value := protoreflect.ValueOfList(&_MsgRequest_22_list{list: &x.Uints}) + if !f(fd_MsgRequest_uints, value) { + return + } + } + if len(x.Strings) != 0 { + value := protoreflect.ValueOfList(&_MsgRequest_23_list{list: &x.Strings}) + if !f(fd_MsgRequest_strings, value) { + return + } + } + if len(x.Enums) != 0 { + value := protoreflect.ValueOfList(&_MsgRequest_24_list{list: &x.Enums}) + if !f(fd_MsgRequest_enums, value) { + return + } + } + if len(x.Durations) != 0 { + value := protoreflect.ValueOfList(&_MsgRequest_25_list{list: &x.Durations}) + if !f(fd_MsgRequest_durations, value) { + return + } + } + if len(x.SomeMessages) != 0 { + value := protoreflect.ValueOfList(&_MsgRequest_26_list{list: &x.SomeMessages}) + if !f(fd_MsgRequest_some_messages, value) { + return + } + } + if x.Positional1 != int32(0) { + value := protoreflect.ValueOfInt32(x.Positional1) + if !f(fd_MsgRequest_positional1, value) { + return + } + } + if x.Positional2 != "" { + value := protoreflect.ValueOfString(x.Positional2) + if !f(fd_MsgRequest_positional2, value) { + return + } + } + if len(x.Positional3Varargs) != 0 { + value := protoreflect.ValueOfList(&_MsgRequest_29_list{list: &x.Positional3Varargs}) + if !f(fd_MsgRequest_positional3_varargs, value) { + return + } + } + if x.DeprecatedField != "" { + value := protoreflect.ValueOfString(x.DeprecatedField) + if !f(fd_MsgRequest_deprecated_field, value) { + return + } + } + if x.ShorthandDeprecatedField != "" { + value := protoreflect.ValueOfString(x.ShorthandDeprecatedField) + if !f(fd_MsgRequest_shorthand_deprecated_field, value) { + return + } + } + if x.HiddenBool != false { + value := protoreflect.ValueOfBool(x.HiddenBool) + if !f(fd_MsgRequest_hidden_bool, 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_MsgRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "testpb.MsgRequest.u32": + return x.U32 != uint32(0) + case "testpb.MsgRequest.u64": + return x.U64 != uint64(0) + case "testpb.MsgRequest.str": + return x.Str != "" + case "testpb.MsgRequest.bz": + return len(x.Bz) != 0 + case "testpb.MsgRequest.timestamp": + return x.Timestamp != nil + case "testpb.MsgRequest.duration": + return x.Duration != nil + case "testpb.MsgRequest.i32": + return x.I32 != int32(0) + case "testpb.MsgRequest.i64": + return x.I64 != int64(0) + case "testpb.MsgRequest.a_bool": + return x.ABool != false + case "testpb.MsgRequest.an_enum": + return x.AnEnum != 0 + case "testpb.MsgRequest.a_message": + return x.AMessage != nil + case "testpb.MsgRequest.a_coin": + return x.ACoin != nil + case "testpb.MsgRequest.an_address": + return x.AnAddress != "" + case "testpb.MsgRequest.page": + return x.Page != nil + case "testpb.MsgRequest.bools": + return len(x.Bools) != 0 + case "testpb.MsgRequest.uints": + return len(x.Uints) != 0 + case "testpb.MsgRequest.strings": + return len(x.Strings) != 0 + case "testpb.MsgRequest.enums": + return len(x.Enums) != 0 + case "testpb.MsgRequest.durations": + return len(x.Durations) != 0 + case "testpb.MsgRequest.some_messages": + return len(x.SomeMessages) != 0 + case "testpb.MsgRequest.positional1": + return x.Positional1 != int32(0) + case "testpb.MsgRequest.positional2": + return x.Positional2 != "" + case "testpb.MsgRequest.positional3_varargs": + return len(x.Positional3Varargs) != 0 + case "testpb.MsgRequest.deprecated_field": + return x.DeprecatedField != "" + case "testpb.MsgRequest.shorthand_deprecated_field": + return x.ShorthandDeprecatedField != "" + case "testpb.MsgRequest.hidden_bool": + return x.HiddenBool != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) + } + panic(fmt.Errorf("message testpb.MsgRequest 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_MsgRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "testpb.MsgRequest.u32": + x.U32 = uint32(0) + case "testpb.MsgRequest.u64": + x.U64 = uint64(0) + case "testpb.MsgRequest.str": + x.Str = "" + case "testpb.MsgRequest.bz": + x.Bz = nil + case "testpb.MsgRequest.timestamp": + x.Timestamp = nil + case "testpb.MsgRequest.duration": + x.Duration = nil + case "testpb.MsgRequest.i32": + x.I32 = int32(0) + case "testpb.MsgRequest.i64": + x.I64 = int64(0) + case "testpb.MsgRequest.a_bool": + x.ABool = false + case "testpb.MsgRequest.an_enum": + x.AnEnum = 0 + case "testpb.MsgRequest.a_message": + x.AMessage = nil + case "testpb.MsgRequest.a_coin": + x.ACoin = nil + case "testpb.MsgRequest.an_address": + x.AnAddress = "" + case "testpb.MsgRequest.page": + x.Page = nil + case "testpb.MsgRequest.bools": + x.Bools = nil + case "testpb.MsgRequest.uints": + x.Uints = nil + case "testpb.MsgRequest.strings": + x.Strings = nil + case "testpb.MsgRequest.enums": + x.Enums = nil + case "testpb.MsgRequest.durations": + x.Durations = nil + case "testpb.MsgRequest.some_messages": + x.SomeMessages = nil + case "testpb.MsgRequest.positional1": + x.Positional1 = int32(0) + case "testpb.MsgRequest.positional2": + x.Positional2 = "" + case "testpb.MsgRequest.positional3_varargs": + x.Positional3Varargs = nil + case "testpb.MsgRequest.deprecated_field": + x.DeprecatedField = "" + case "testpb.MsgRequest.shorthand_deprecated_field": + x.ShorthandDeprecatedField = "" + case "testpb.MsgRequest.hidden_bool": + x.HiddenBool = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) + } + panic(fmt.Errorf("message testpb.MsgRequest 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_MsgRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "testpb.MsgRequest.u32": + value := x.U32 + return protoreflect.ValueOfUint32(value) + case "testpb.MsgRequest.u64": + value := x.U64 + return protoreflect.ValueOfUint64(value) + case "testpb.MsgRequest.str": + value := x.Str + return protoreflect.ValueOfString(value) + case "testpb.MsgRequest.bz": + value := x.Bz + return protoreflect.ValueOfBytes(value) + case "testpb.MsgRequest.timestamp": + value := x.Timestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.MsgRequest.duration": + value := x.Duration + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.MsgRequest.i32": + value := x.I32 + return protoreflect.ValueOfInt32(value) + case "testpb.MsgRequest.i64": + value := x.I64 + return protoreflect.ValueOfInt64(value) + case "testpb.MsgRequest.a_bool": + value := x.ABool + return protoreflect.ValueOfBool(value) + case "testpb.MsgRequest.an_enum": + value := x.AnEnum + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "testpb.MsgRequest.a_message": + value := x.AMessage + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.MsgRequest.a_coin": + value := x.ACoin + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.MsgRequest.an_address": + value := x.AnAddress + return protoreflect.ValueOfString(value) + case "testpb.MsgRequest.page": + value := x.Page + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.MsgRequest.bools": + if len(x.Bools) == 0 { + return protoreflect.ValueOfList(&_MsgRequest_21_list{}) + } + listValue := &_MsgRequest_21_list{list: &x.Bools} + return protoreflect.ValueOfList(listValue) + case "testpb.MsgRequest.uints": + if len(x.Uints) == 0 { + return protoreflect.ValueOfList(&_MsgRequest_22_list{}) + } + listValue := &_MsgRequest_22_list{list: &x.Uints} + return protoreflect.ValueOfList(listValue) + case "testpb.MsgRequest.strings": + if len(x.Strings) == 0 { + return protoreflect.ValueOfList(&_MsgRequest_23_list{}) + } + listValue := &_MsgRequest_23_list{list: &x.Strings} + return protoreflect.ValueOfList(listValue) + case "testpb.MsgRequest.enums": + if len(x.Enums) == 0 { + return protoreflect.ValueOfList(&_MsgRequest_24_list{}) + } + listValue := &_MsgRequest_24_list{list: &x.Enums} + return protoreflect.ValueOfList(listValue) + case "testpb.MsgRequest.durations": + if len(x.Durations) == 0 { + return protoreflect.ValueOfList(&_MsgRequest_25_list{}) + } + listValue := &_MsgRequest_25_list{list: &x.Durations} + return protoreflect.ValueOfList(listValue) + case "testpb.MsgRequest.some_messages": + if len(x.SomeMessages) == 0 { + return protoreflect.ValueOfList(&_MsgRequest_26_list{}) + } + listValue := &_MsgRequest_26_list{list: &x.SomeMessages} + return protoreflect.ValueOfList(listValue) + case "testpb.MsgRequest.positional1": + value := x.Positional1 + return protoreflect.ValueOfInt32(value) + case "testpb.MsgRequest.positional2": + value := x.Positional2 + return protoreflect.ValueOfString(value) + case "testpb.MsgRequest.positional3_varargs": + if len(x.Positional3Varargs) == 0 { + return protoreflect.ValueOfList(&_MsgRequest_29_list{}) + } + listValue := &_MsgRequest_29_list{list: &x.Positional3Varargs} + return protoreflect.ValueOfList(listValue) + case "testpb.MsgRequest.deprecated_field": + value := x.DeprecatedField + return protoreflect.ValueOfString(value) + case "testpb.MsgRequest.shorthand_deprecated_field": + value := x.ShorthandDeprecatedField + return protoreflect.ValueOfString(value) + case "testpb.MsgRequest.hidden_bool": + value := x.HiddenBool + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) + } + panic(fmt.Errorf("message testpb.MsgRequest 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_MsgRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "testpb.MsgRequest.u32": + x.U32 = uint32(value.Uint()) + case "testpb.MsgRequest.u64": + x.U64 = value.Uint() + case "testpb.MsgRequest.str": + x.Str = value.Interface().(string) + case "testpb.MsgRequest.bz": + x.Bz = value.Bytes() + case "testpb.MsgRequest.timestamp": + x.Timestamp = value.Message().Interface().(*timestamppb.Timestamp) + case "testpb.MsgRequest.duration": + x.Duration = value.Message().Interface().(*durationpb.Duration) + case "testpb.MsgRequest.i32": + x.I32 = int32(value.Int()) + case "testpb.MsgRequest.i64": + x.I64 = value.Int() + case "testpb.MsgRequest.a_bool": + x.ABool = value.Bool() + case "testpb.MsgRequest.an_enum": + x.AnEnum = (Enum)(value.Enum()) + case "testpb.MsgRequest.a_message": + x.AMessage = value.Message().Interface().(*AMessage) + case "testpb.MsgRequest.a_coin": + x.ACoin = value.Message().Interface().(*v1beta1.Coin) + case "testpb.MsgRequest.an_address": + x.AnAddress = value.Interface().(string) + case "testpb.MsgRequest.page": + x.Page = value.Message().Interface().(*v1beta11.PageRequest) + case "testpb.MsgRequest.bools": + lv := value.List() + clv := lv.(*_MsgRequest_21_list) + x.Bools = *clv.list + case "testpb.MsgRequest.uints": + lv := value.List() + clv := lv.(*_MsgRequest_22_list) + x.Uints = *clv.list + case "testpb.MsgRequest.strings": + lv := value.List() + clv := lv.(*_MsgRequest_23_list) + x.Strings = *clv.list + case "testpb.MsgRequest.enums": + lv := value.List() + clv := lv.(*_MsgRequest_24_list) + x.Enums = *clv.list + case "testpb.MsgRequest.durations": + lv := value.List() + clv := lv.(*_MsgRequest_25_list) + x.Durations = *clv.list + case "testpb.MsgRequest.some_messages": + lv := value.List() + clv := lv.(*_MsgRequest_26_list) + x.SomeMessages = *clv.list + case "testpb.MsgRequest.positional1": + x.Positional1 = int32(value.Int()) + case "testpb.MsgRequest.positional2": + x.Positional2 = value.Interface().(string) + case "testpb.MsgRequest.positional3_varargs": + lv := value.List() + clv := lv.(*_MsgRequest_29_list) + x.Positional3Varargs = *clv.list + case "testpb.MsgRequest.deprecated_field": + x.DeprecatedField = value.Interface().(string) + case "testpb.MsgRequest.shorthand_deprecated_field": + x.ShorthandDeprecatedField = value.Interface().(string) + case "testpb.MsgRequest.hidden_bool": + x.HiddenBool = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) + } + panic(fmt.Errorf("message testpb.MsgRequest 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_MsgRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.MsgRequest.timestamp": + if x.Timestamp == nil { + x.Timestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + case "testpb.MsgRequest.duration": + if x.Duration == nil { + x.Duration = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + case "testpb.MsgRequest.a_message": + if x.AMessage == nil { + x.AMessage = new(AMessage) + } + return protoreflect.ValueOfMessage(x.AMessage.ProtoReflect()) + case "testpb.MsgRequest.a_coin": + if x.ACoin == nil { + x.ACoin = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ACoin.ProtoReflect()) + case "testpb.MsgRequest.page": + if x.Page == nil { + x.Page = new(v1beta11.PageRequest) + } + return protoreflect.ValueOfMessage(x.Page.ProtoReflect()) + case "testpb.MsgRequest.bools": + if x.Bools == nil { + x.Bools = []bool{} + } + value := &_MsgRequest_21_list{list: &x.Bools} + return protoreflect.ValueOfList(value) + case "testpb.MsgRequest.uints": + if x.Uints == nil { + x.Uints = []uint32{} + } + value := &_MsgRequest_22_list{list: &x.Uints} + return protoreflect.ValueOfList(value) + case "testpb.MsgRequest.strings": + if x.Strings == nil { + x.Strings = []string{} + } + value := &_MsgRequest_23_list{list: &x.Strings} + return protoreflect.ValueOfList(value) + case "testpb.MsgRequest.enums": + if x.Enums == nil { + x.Enums = []Enum{} + } + value := &_MsgRequest_24_list{list: &x.Enums} + return protoreflect.ValueOfList(value) + case "testpb.MsgRequest.durations": + if x.Durations == nil { + x.Durations = []*durationpb.Duration{} + } + value := &_MsgRequest_25_list{list: &x.Durations} + return protoreflect.ValueOfList(value) + case "testpb.MsgRequest.some_messages": + if x.SomeMessages == nil { + x.SomeMessages = []*AMessage{} + } + value := &_MsgRequest_26_list{list: &x.SomeMessages} + return protoreflect.ValueOfList(value) + case "testpb.MsgRequest.positional3_varargs": + if x.Positional3Varargs == nil { + x.Positional3Varargs = []*v1beta1.Coin{} + } + value := &_MsgRequest_29_list{list: &x.Positional3Varargs} + return protoreflect.ValueOfList(value) + case "testpb.MsgRequest.u32": + panic(fmt.Errorf("field u32 of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.u64": + panic(fmt.Errorf("field u64 of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.str": + panic(fmt.Errorf("field str of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.bz": + panic(fmt.Errorf("field bz of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.i32": + panic(fmt.Errorf("field i32 of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.i64": + panic(fmt.Errorf("field i64 of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.a_bool": + panic(fmt.Errorf("field a_bool of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.an_enum": + panic(fmt.Errorf("field an_enum of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.an_address": + panic(fmt.Errorf("field an_address of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.positional1": + panic(fmt.Errorf("field positional1 of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.positional2": + panic(fmt.Errorf("field positional2 of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.deprecated_field": + panic(fmt.Errorf("field deprecated_field of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.shorthand_deprecated_field": + panic(fmt.Errorf("field shorthand_deprecated_field of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.hidden_bool": + panic(fmt.Errorf("field hidden_bool of message testpb.MsgRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) + } + panic(fmt.Errorf("message testpb.MsgRequest 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_MsgRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.MsgRequest.u32": + return protoreflect.ValueOfUint32(uint32(0)) + case "testpb.MsgRequest.u64": + return protoreflect.ValueOfUint64(uint64(0)) + case "testpb.MsgRequest.str": + return protoreflect.ValueOfString("") + case "testpb.MsgRequest.bz": + return protoreflect.ValueOfBytes(nil) + case "testpb.MsgRequest.timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.MsgRequest.duration": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.MsgRequest.i32": + return protoreflect.ValueOfInt32(int32(0)) + case "testpb.MsgRequest.i64": + return protoreflect.ValueOfInt64(int64(0)) + case "testpb.MsgRequest.a_bool": + return protoreflect.ValueOfBool(false) + case "testpb.MsgRequest.an_enum": + return protoreflect.ValueOfEnum(0) + case "testpb.MsgRequest.a_message": + m := new(AMessage) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.MsgRequest.a_coin": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.MsgRequest.an_address": + return protoreflect.ValueOfString("") + case "testpb.MsgRequest.page": + m := new(v1beta11.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.MsgRequest.bools": + list := []bool{} + return protoreflect.ValueOfList(&_MsgRequest_21_list{list: &list}) + case "testpb.MsgRequest.uints": + list := []uint32{} + return protoreflect.ValueOfList(&_MsgRequest_22_list{list: &list}) + case "testpb.MsgRequest.strings": + list := []string{} + return protoreflect.ValueOfList(&_MsgRequest_23_list{list: &list}) + case "testpb.MsgRequest.enums": + list := []Enum{} + return protoreflect.ValueOfList(&_MsgRequest_24_list{list: &list}) + case "testpb.MsgRequest.durations": + list := []*durationpb.Duration{} + return protoreflect.ValueOfList(&_MsgRequest_25_list{list: &list}) + case "testpb.MsgRequest.some_messages": + list := []*AMessage{} + return protoreflect.ValueOfList(&_MsgRequest_26_list{list: &list}) + case "testpb.MsgRequest.positional1": + return protoreflect.ValueOfInt32(int32(0)) + case "testpb.MsgRequest.positional2": + return protoreflect.ValueOfString("") + case "testpb.MsgRequest.positional3_varargs": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgRequest_29_list{list: &list}) + case "testpb.MsgRequest.deprecated_field": + return protoreflect.ValueOfString("") + case "testpb.MsgRequest.shorthand_deprecated_field": + return protoreflect.ValueOfString("") + case "testpb.MsgRequest.hidden_bool": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) + } + panic(fmt.Errorf("message testpb.MsgRequest 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_MsgRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.MsgRequest", 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_MsgRequest) 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_MsgRequest) 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_MsgRequest) 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_MsgRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRequest) + 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.U32 != 0 { + n += 1 + runtime.Sov(uint64(x.U32)) + } + if x.U64 != 0 { + n += 1 + runtime.Sov(uint64(x.U64)) + } + l = len(x.Str) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Bz) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Timestamp != nil { + l = options.Size(x.Timestamp) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Duration != nil { + l = options.Size(x.Duration) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.I32 != 0 { + n += 1 + runtime.Sov(uint64(x.I32)) + } + if x.I64 != 0 { + n += 1 + runtime.Sov(uint64(x.I64)) + } + if x.ABool { + n += 2 + } + if x.AnEnum != 0 { + n += 2 + runtime.Sov(uint64(x.AnEnum)) + } + if x.AMessage != nil { + l = options.Size(x.AMessage) + n += 2 + l + runtime.Sov(uint64(l)) + } + if x.ACoin != nil { + l = options.Size(x.ACoin) + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.AnAddress) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + if x.Page != nil { + l = options.Size(x.Page) + n += 2 + l + runtime.Sov(uint64(l)) + } + if len(x.Bools) > 0 { + n += 2 + runtime.Sov(uint64(len(x.Bools))) + len(x.Bools)*1 + } + if len(x.Uints) > 0 { + l = 0 + for _, e := range x.Uints { + l += runtime.Sov(uint64(e)) + } + n += 2 + runtime.Sov(uint64(l)) + l + } + if len(x.Strings) > 0 { + for _, s := range x.Strings { + l = len(s) + n += 2 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Enums) > 0 { + l = 0 + for _, e := range x.Enums { + l += runtime.Sov(uint64(e)) + } + n += 2 + runtime.Sov(uint64(l)) + l + } + if len(x.Durations) > 0 { + for _, e := range x.Durations { + l = options.Size(e) + n += 2 + l + runtime.Sov(uint64(l)) + } + } + if len(x.SomeMessages) > 0 { + for _, e := range x.SomeMessages { + l = options.Size(e) + n += 2 + l + runtime.Sov(uint64(l)) + } + } + if x.Positional1 != 0 { + n += 2 + runtime.Sov(uint64(x.Positional1)) + } + l = len(x.Positional2) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + if len(x.Positional3Varargs) > 0 { + for _, e := range x.Positional3Varargs { + l = options.Size(e) + n += 2 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.DeprecatedField) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.ShorthandDeprecatedField) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + if x.HiddenBool { + n += 3 + } + 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().(*MsgRequest) + 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.HiddenBool { + i-- + if x.HiddenBool { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x80 + } + if len(x.ShorthandDeprecatedField) > 0 { + i -= len(x.ShorthandDeprecatedField) + copy(dAtA[i:], x.ShorthandDeprecatedField) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShorthandDeprecatedField))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + if len(x.DeprecatedField) > 0 { + i -= len(x.DeprecatedField) + copy(dAtA[i:], x.DeprecatedField) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DeprecatedField))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + if len(x.Positional3Varargs) > 0 { + for iNdEx := len(x.Positional3Varargs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Positional3Varargs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xea + } + } + if len(x.Positional2) > 0 { + i -= len(x.Positional2) + copy(dAtA[i:], x.Positional2) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Positional2))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe2 + } + if x.Positional1 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Positional1)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd8 + } + if len(x.SomeMessages) > 0 { + for iNdEx := len(x.SomeMessages) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.SomeMessages[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + } + if len(x.Durations) > 0 { + for iNdEx := len(x.Durations) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Durations[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + } + if len(x.Enums) > 0 { + var pksize2 int + for _, num := range x.Enums { + pksize2 += runtime.Sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range x.Enums { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(x.Strings) > 0 { + for iNdEx := len(x.Strings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Strings[iNdEx]) + copy(dAtA[i:], x.Strings[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Strings[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + } + if len(x.Uints) > 0 { + var pksize4 int + for _, num := range x.Uints { + pksize4 += runtime.Sov(uint64(num)) + } + i -= pksize4 + j3 := i + for _, num := range x.Uints { + for num >= 1<<7 { + dAtA[j3] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j3++ + } + dAtA[j3] = uint8(num) + j3++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize4)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if len(x.Bools) > 0 { + for iNdEx := len(x.Bools) - 1; iNdEx >= 0; iNdEx-- { + i-- + if x.Bools[iNdEx] { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + } + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bools))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if x.Page != nil { + encoded, err := options.Marshal(x.Page) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if len(x.AnAddress) > 0 { + i -= len(x.AnAddress) + copy(dAtA[i:], x.AnAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AnAddress))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if x.ACoin != nil { + encoded, err := options.Marshal(x.ACoin) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if x.AMessage != nil { + encoded, err := options.Marshal(x.AMessage) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if x.AnEnum != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AnEnum)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if x.ABool { + i-- + if x.ABool { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if x.I64 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.I64)) + i-- + dAtA[i] = 0x50 + } + if x.I32 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.I32)) + i-- + dAtA[i] = 0x38 + } + if x.Duration != nil { + encoded, err := options.Marshal(x.Duration) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x32 + } + if x.Timestamp != nil { + encoded, err := options.Marshal(x.Timestamp) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if len(x.Bz) > 0 { + i -= len(x.Bz) + copy(dAtA[i:], x.Bz) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bz))) + i-- + dAtA[i] = 0x22 + } + if len(x.Str) > 0 { + i -= len(x.Str) + copy(dAtA[i:], x.Str) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Str))) + i-- + dAtA[i] = 0x1a + } + if x.U64 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.U64)) + i-- + dAtA[i] = 0x10 + } + if x.U32 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.U32)) + 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().(*MsgRequest) + 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: MsgRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRequest: 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 U32", wireType) + } + x.U32 = 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.U32 |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field U64", wireType) + } + x.U64 = 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.U64 |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Str", 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.Str = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bz", wireType) + } + var byteLen 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + 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.Bz = append(x.Bz[:0], dAtA[iNdEx:postIndex]...) + if x.Bz == nil { + x.Bz = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Timestamp == nil { + x.Timestamp = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Timestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Duration == nil { + x.Duration = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Duration); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field I32", wireType) + } + x.I32 = 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.I32 |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field I64", wireType) + } + x.I64 = 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.I64 |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ABool", 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.ABool = bool(v != 0) + case 16: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AnEnum", wireType) + } + x.AnEnum = 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.AnEnum |= Enum(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AMessage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.AMessage == nil { + x.AMessage = &AMessage{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AMessage); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ACoin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ACoin == nil { + x.ACoin = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ACoin); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 19: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AnAddress", 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.AnAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Page", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Page == nil { + x.Page = &v1beta11.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Page); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 21: + if wireType == 0 { + 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.Bools = append(x.Bools, bool(v != 0)) + } else if wireType == 2 { + var packedLen 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++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + 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 + } + var elementCount int + elementCount = packedLen + if elementCount != 0 && len(x.Bools) == 0 { + x.Bools = make([]bool, 0, elementCount) + } + for iNdEx < postIndex { + 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.Bools = append(x.Bools, bool(v != 0)) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bools", wireType) + } + case 22: + if wireType == 0 { + var v uint32 + 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 |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Uints = append(x.Uints, v) + } else if wireType == 2 { + var packedLen 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++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + 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 + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(x.Uints) == 0 { + x.Uints = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + 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 |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Uints = append(x.Uints, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Uints", wireType) + } + case 23: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Strings", 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.Strings = append(x.Strings, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 24: + if wireType == 0 { + var v Enum + 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 |= Enum(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Enums = append(x.Enums, v) + } else if wireType == 2 { + var packedLen 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++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + 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 + } + var elementCount int + if elementCount != 0 && len(x.Enums) == 0 { + x.Enums = make([]Enum, 0, elementCount) + } + for iNdEx < postIndex { + var v Enum + 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 |= Enum(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Enums = append(x.Enums, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enums", wireType) + } + case 25: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Durations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Durations = append(x.Durations, &durationpb.Duration{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Durations[len(x.Durations)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 26: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SomeMessages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SomeMessages = append(x.SomeMessages, &AMessage{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SomeMessages[len(x.SomeMessages)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 27: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Positional1", wireType) + } + x.Positional1 = 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.Positional1 |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 28: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Positional2", 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.Positional2 = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 29: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Positional3Varargs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Positional3Varargs = append(x.Positional3Varargs, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Positional3Varargs[len(x.Positional3Varargs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 30: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DeprecatedField", 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.DeprecatedField = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 31: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ShorthandDeprecatedField", 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.ShorthandDeprecatedField = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 32: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HiddenBool", 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.HiddenBool = bool(v != 0) + 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_MsgResponse protoreflect.MessageDescriptor + fd_MsgResponse_request protoreflect.FieldDescriptor +) + +func init() { + file_testpb_msg_proto_init() + md_MsgResponse = File_testpb_msg_proto.Messages().ByName("MsgResponse") + fd_MsgResponse_request = md_MsgResponse.Fields().ByName("request") +} + +var _ protoreflect.Message = (*fastReflection_MsgResponse)(nil) + +type fastReflection_MsgResponse MsgResponse + +func (x *MsgResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgResponse)(x) +} + +func (x *MsgResponse) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_msg_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_MsgResponse_messageType fastReflection_MsgResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgResponse_messageType{} + +type fastReflection_MsgResponse_messageType struct{} + +func (x fastReflection_MsgResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgResponse)(nil) +} +func (x fastReflection_MsgResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgResponse) +} +func (x fastReflection_MsgResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgResponse +} + +// 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_MsgResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgResponse) New() protoreflect.Message { + return new(fastReflection_MsgResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgResponse) Interface() protoreflect.ProtoMessage { + return (*MsgResponse)(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_MsgResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Request != nil { + value := protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + if !f(fd_MsgResponse_request, 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_MsgResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "testpb.MsgResponse.request": + return x.Request != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgResponse")) + } + panic(fmt.Errorf("message testpb.MsgResponse 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_MsgResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "testpb.MsgResponse.request": + x.Request = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgResponse")) + } + panic(fmt.Errorf("message testpb.MsgResponse 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_MsgResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "testpb.MsgResponse.request": + value := x.Request + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgResponse")) + } + panic(fmt.Errorf("message testpb.MsgResponse 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_MsgResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "testpb.MsgResponse.request": + x.Request = value.Message().Interface().(*MsgRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgResponse")) + } + panic(fmt.Errorf("message testpb.MsgResponse 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_MsgResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.MsgResponse.request": + if x.Request == nil { + x.Request = new(MsgRequest) + } + return protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgResponse")) + } + panic(fmt.Errorf("message testpb.MsgResponse 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_MsgResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.MsgResponse.request": + m := new(MsgRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgResponse")) + } + panic(fmt.Errorf("message testpb.MsgResponse 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_MsgResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.MsgResponse", 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_MsgResponse) 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_MsgResponse) 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_MsgResponse) 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_MsgResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgResponse) + 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.Request != nil { + l = options.Size(x.Request) + 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().(*MsgResponse) + 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.Request != nil { + encoded, err := options.Marshal(x.Request) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 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().(*MsgResponse) + 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: MsgResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgResponse: 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 Request", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Request == nil { + x.Request = &MsgRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Request); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: testpb/msg.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) +) + +type MsgRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // u32 is an uint32 + U32 uint32 `protobuf:"varint,1,opt,name=u32,proto3" json:"u32,omitempty"` + U64 uint64 `protobuf:"varint,2,opt,name=u64,proto3" json:"u64,omitempty"` + Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"` + Bz []byte `protobuf:"bytes,4,opt,name=bz,proto3" json:"bz,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Duration *durationpb.Duration `protobuf:"bytes,6,opt,name=duration,proto3" json:"duration,omitempty"` + I32 int32 `protobuf:"varint,7,opt,name=i32,proto3" json:"i32,omitempty"` + I64 int64 `protobuf:"varint,10,opt,name=i64,proto3" json:"i64,omitempty"` + ABool bool `protobuf:"varint,15,opt,name=a_bool,json=aBool,proto3" json:"a_bool,omitempty"` + AnEnum Enum `protobuf:"varint,16,opt,name=an_enum,json=anEnum,proto3,enum=testpb.Enum" json:"an_enum,omitempty"` + AMessage *AMessage `protobuf:"bytes,17,opt,name=a_message,json=aMessage,proto3" json:"a_message,omitempty"` + ACoin *v1beta1.Coin `protobuf:"bytes,18,opt,name=a_coin,json=aCoin,proto3" json:"a_coin,omitempty"` + AnAddress string `protobuf:"bytes,19,opt,name=an_address,json=anAddress,proto3" json:"an_address,omitempty"` + Page *v1beta11.PageRequest `protobuf:"bytes,20,opt,name=page,proto3" json:"page,omitempty"` + Bools []bool `protobuf:"varint,21,rep,packed,name=bools,proto3" json:"bools,omitempty"` + Uints []uint32 `protobuf:"varint,22,rep,packed,name=uints,proto3" json:"uints,omitempty"` + Strings []string `protobuf:"bytes,23,rep,name=strings,proto3" json:"strings,omitempty"` + Enums []Enum `protobuf:"varint,24,rep,packed,name=enums,proto3,enum=testpb.Enum" json:"enums,omitempty"` + Durations []*durationpb.Duration `protobuf:"bytes,25,rep,name=durations,proto3" json:"durations,omitempty"` + SomeMessages []*AMessage `protobuf:"bytes,26,rep,name=some_messages,json=someMessages,proto3" json:"some_messages,omitempty"` + Positional1 int32 `protobuf:"varint,27,opt,name=positional1,proto3" json:"positional1,omitempty"` + Positional2 string `protobuf:"bytes,28,opt,name=positional2,proto3" json:"positional2,omitempty"` + Positional3Varargs []*v1beta1.Coin `protobuf:"bytes,29,rep,name=positional3_varargs,json=positional3Varargs,proto3" json:"positional3_varargs,omitempty"` + DeprecatedField string `protobuf:"bytes,30,opt,name=deprecated_field,json=deprecatedField,proto3" json:"deprecated_field,omitempty"` + ShorthandDeprecatedField string `protobuf:"bytes,31,opt,name=shorthand_deprecated_field,json=shorthandDeprecatedField,proto3" json:"shorthand_deprecated_field,omitempty"` + HiddenBool bool `protobuf:"varint,32,opt,name=hidden_bool,json=hiddenBool,proto3" json:"hidden_bool,omitempty"` +} + +func (x *MsgRequest) Reset() { + *x = MsgRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRequest) ProtoMessage() {} + +// Deprecated: Use MsgRequest.ProtoReflect.Descriptor instead. +func (*MsgRequest) Descriptor() ([]byte, []int) { + return file_testpb_msg_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgRequest) GetU32() uint32 { + if x != nil { + return x.U32 + } + return 0 +} + +func (x *MsgRequest) GetU64() uint64 { + if x != nil { + return x.U64 + } + return 0 +} + +func (x *MsgRequest) GetStr() string { + if x != nil { + return x.Str + } + return "" +} + +func (x *MsgRequest) GetBz() []byte { + if x != nil { + return x.Bz + } + return nil +} + +func (x *MsgRequest) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *MsgRequest) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *MsgRequest) GetI32() int32 { + if x != nil { + return x.I32 + } + return 0 +} + +func (x *MsgRequest) GetI64() int64 { + if x != nil { + return x.I64 + } + return 0 +} + +func (x *MsgRequest) GetABool() bool { + if x != nil { + return x.ABool + } + return false +} + +func (x *MsgRequest) GetAnEnum() Enum { + if x != nil { + return x.AnEnum + } + return Enum_ENUM_UNSPECIFIED +} + +func (x *MsgRequest) GetAMessage() *AMessage { + if x != nil { + return x.AMessage + } + return nil +} + +func (x *MsgRequest) GetACoin() *v1beta1.Coin { + if x != nil { + return x.ACoin + } + return nil +} + +func (x *MsgRequest) GetAnAddress() string { + if x != nil { + return x.AnAddress + } + return "" +} + +func (x *MsgRequest) GetPage() *v1beta11.PageRequest { + if x != nil { + return x.Page + } + return nil +} + +func (x *MsgRequest) GetBools() []bool { + if x != nil { + return x.Bools + } + return nil +} + +func (x *MsgRequest) GetUints() []uint32 { + if x != nil { + return x.Uints + } + return nil +} + +func (x *MsgRequest) GetStrings() []string { + if x != nil { + return x.Strings + } + return nil +} + +func (x *MsgRequest) GetEnums() []Enum { + if x != nil { + return x.Enums + } + return nil +} + +func (x *MsgRequest) GetDurations() []*durationpb.Duration { + if x != nil { + return x.Durations + } + return nil +} + +func (x *MsgRequest) GetSomeMessages() []*AMessage { + if x != nil { + return x.SomeMessages + } + return nil +} + +func (x *MsgRequest) GetPositional1() int32 { + if x != nil { + return x.Positional1 + } + return 0 +} + +func (x *MsgRequest) GetPositional2() string { + if x != nil { + return x.Positional2 + } + return "" +} + +func (x *MsgRequest) GetPositional3Varargs() []*v1beta1.Coin { + if x != nil { + return x.Positional3Varargs + } + return nil +} + +func (x *MsgRequest) GetDeprecatedField() string { + if x != nil { + return x.DeprecatedField + } + return "" +} + +func (x *MsgRequest) GetShorthandDeprecatedField() string { + if x != nil { + return x.ShorthandDeprecatedField + } + return "" +} + +func (x *MsgRequest) GetHiddenBool() bool { + if x != nil { + return x.HiddenBool + } + return false +} + +type MsgResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *MsgRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *MsgResponse) Reset() { + *x = MsgResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgResponse) ProtoMessage() {} + +// Deprecated: Use MsgResponse.ProtoReflect.Descriptor instead. +func (*MsgResponse) Descriptor() ([]byte, []int) { + return file_testpb_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgResponse) GetRequest() *MsgRequest { + if x != nil { + return x.Request + } + return nil +} + +var File_testpb_msg_proto protoreflect.FileDescriptor + +var file_testpb_msg_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x12, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xef, 0x07, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x74, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x62, + 0x7a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x62, 0x7a, 0x12, 0x38, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, + 0x69, 0x33, 0x32, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x33, 0x32, 0x12, 0x10, + 0x0a, 0x03, 0x69, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, + 0x12, 0x15, 0x0a, 0x06, 0x61, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x61, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x25, 0x0a, 0x07, 0x61, 0x6e, 0x5f, 0x65, 0x6e, + 0x75, 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x06, 0x61, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x2d, + 0x0a, 0x09, 0x61, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x08, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, + 0x06, 0x61, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x61, 0x43, 0x6f, 0x69, 0x6e, 0x12, + 0x37, 0x0a, 0x0a, 0x61, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x13, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, + 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, + 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x15, 0x20, + 0x03, 0x28, 0x08, 0x52, 0x05, 0x62, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x69, + 0x6e, 0x74, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x05, 0x75, 0x69, 0x6e, 0x74, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x17, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x22, 0x0a, 0x05, 0x65, 0x6e, + 0x75, 0x6d, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x37, + 0x0a, 0x09, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x19, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x0a, 0x0d, 0x73, 0x6f, 0x6d, 0x65, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x0c, 0x73, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x20, + 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x31, 0x18, 0x1b, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x31, + 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x32, 0x18, + 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x32, 0x12, 0x4a, 0x0a, 0x13, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x33, 0x5f, 0x76, 0x61, 0x72, 0x61, 0x72, 0x67, 0x73, 0x18, 0x1d, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x12, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x33, 0x56, 0x61, 0x72, 0x61, 0x72, 0x67, 0x73, 0x12, 0x29, + 0x0a, 0x10, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x3c, 0x0a, 0x1a, 0x73, 0x68, 0x6f, + 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x73, + 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, + 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x69, 0x64, 0x64, 0x65, + 0x6e, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x20, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x68, 0x69, + 0x64, 0x64, 0x65, 0x6e, 0x42, 0x6f, 0x6f, 0x6c, 0x22, 0x3b, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x36, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x2f, 0x0a, 0x04, + 0x53, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x86, 0x01, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x08, 0x4d, 0x73, + 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 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, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, + 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, + 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, + 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_testpb_msg_proto_rawDescOnce sync.Once + file_testpb_msg_proto_rawDescData = file_testpb_msg_proto_rawDesc +) + +func file_testpb_msg_proto_rawDescGZIP() []byte { + file_testpb_msg_proto_rawDescOnce.Do(func() { + file_testpb_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_msg_proto_rawDescData) + }) + return file_testpb_msg_proto_rawDescData +} + +var file_testpb_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_testpb_msg_proto_goTypes = []interface{}{ + (*MsgRequest)(nil), // 0: testpb.MsgRequest + (*MsgResponse)(nil), // 1: testpb.MsgResponse + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration + (Enum)(0), // 4: testpb.Enum + (*AMessage)(nil), // 5: testpb.AMessage + (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin + (*v1beta11.PageRequest)(nil), // 7: cosmos.base.query.v1beta1.PageRequest +} +var file_testpb_msg_proto_depIdxs = []int32{ + 2, // 0: testpb.MsgRequest.timestamp:type_name -> google.protobuf.Timestamp + 3, // 1: testpb.MsgRequest.duration:type_name -> google.protobuf.Duration + 4, // 2: testpb.MsgRequest.an_enum:type_name -> testpb.Enum + 5, // 3: testpb.MsgRequest.a_message:type_name -> testpb.AMessage + 6, // 4: testpb.MsgRequest.a_coin:type_name -> cosmos.base.v1beta1.Coin + 7, // 5: testpb.MsgRequest.page:type_name -> cosmos.base.query.v1beta1.PageRequest + 4, // 6: testpb.MsgRequest.enums:type_name -> testpb.Enum + 3, // 7: testpb.MsgRequest.durations:type_name -> google.protobuf.Duration + 5, // 8: testpb.MsgRequest.some_messages:type_name -> testpb.AMessage + 6, // 9: testpb.MsgRequest.positional3_varargs:type_name -> cosmos.base.v1beta1.Coin + 0, // 10: testpb.MsgResponse.request:type_name -> testpb.MsgRequest + 0, // 11: testpb.Msg.Send:input_type -> testpb.MsgRequest + 1, // 12: testpb.Msg.Send:output_type -> testpb.MsgResponse + 12, // [12:13] is the sub-list for method output_type + 11, // [11:12] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_testpb_msg_proto_init() } +func file_testpb_msg_proto_init() { + if File_testpb_msg_proto != nil { + return + } + file_testpb_query_proto_init() + if !protoimpl.UnsafeEnabled { + file_testpb_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_testpb_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgResponse); 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_testpb_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_testpb_msg_proto_goTypes, + DependencyIndexes: file_testpb_msg_proto_depIdxs, + MessageInfos: file_testpb_msg_proto_msgTypes, + }.Build() + File_testpb_msg_proto = out.File + file_testpb_msg_proto_rawDesc = nil + file_testpb_msg_proto_goTypes = nil + file_testpb_msg_proto_depIdxs = nil +} diff --git a/client/v2/internal/testpb/msg_grpc.pb.go b/client/v2/internal/testpb/msg_grpc.pb.go new file mode 100644 index 0000000000..4d8c24526e --- /dev/null +++ b/client/v2/internal/testpb/msg_grpc.pb.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: testpb/msg.proto + +package testpb + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// 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. +type MsgClient interface { + // Send a request and returns the request as a response. + Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) { + out := new(MsgResponse) + err := c.cc.Invoke(ctx, "/testpb.Msg/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // Send a request and returns the request as a response. + Send(context.Context, *MsgRequest) (*MsgResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) Send(context.Context, *MsgRequest) (*MsgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// 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) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testpb.Msg/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Send(ctx, req.(*MsgRequest)) + } + 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: "testpb.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _Msg_Send_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "testpb/msg.proto", +}