From 64c76d20d00dcb3b47713071c6b06877b1c73b55 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 12 Oct 2020 11:51:23 -0400 Subject: [PATCH 01/51] Refactor RegisterQueryServices -> RegisterServices --- simapp/app.go | 2 +- tests/mocks/types_module_module.go | 26 +++++++++++++------------- types/module/configurator.go | 21 +++++++++++++++++++++ types/module/module.go | 13 +++++++------ types/module/module_test.go | 6 +++--- x/auth/module.go | 5 ++--- x/auth/vesting/module.go | 3 +-- x/bank/module.go | 5 ++--- x/capability/module.go | 3 +-- x/crisis/module.go | 3 +-- x/distribution/module.go | 5 ++--- x/evidence/module.go | 5 ++--- x/gov/module.go | 5 ++--- x/ibc/applications/transfer/module.go | 5 ++--- x/ibc/core/module.go | 5 ++--- x/ibc/testing/mock/mock.go | 5 +++-- x/mint/module.go | 5 ++--- x/params/module.go | 5 ++--- x/slashing/module.go | 5 ++--- x/staking/module.go | 5 ++--- x/upgrade/module.go | 5 ++--- 21 files changed, 75 insertions(+), 67 deletions(-) create mode 100644 types/module/configurator.go diff --git a/simapp/app.go b/simapp/app.go index c4ea3d070a56..cbb477b9d362 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -359,7 +359,7 @@ func NewSimApp( app.mm.RegisterInvariants(&app.CrisisKeeper) app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - app.mm.RegisterQueryServices(app.GRPCQueryRouter()) + app.mm.RegisterServices(app.GRPCQueryRouter()) // add test gRPC service for testing gRPC queries in isolation testdata.RegisterTestServiceServer(app.GRPCQueryRouter(), testdata.TestServiceImpl{}) diff --git a/tests/mocks/types_module_module.go b/tests/mocks/types_module_module.go index 816a486b2ec7..b03b3580949b 100644 --- a/tests/mocks/types_module_module.go +++ b/tests/mocks/types_module_module.go @@ -10,10 +10,10 @@ import ( codec "github.com/cosmos/cosmos-sdk/codec" types "github.com/cosmos/cosmos-sdk/codec/types" types0 "github.com/cosmos/cosmos-sdk/types" - grpc "github.com/gogo/protobuf/grpc" + module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" mux "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + runtime "github.com/grpc-ecosystem/grpc-gateway/runtime" cobra "github.com/spf13/cobra" types1 "github.com/tendermint/tendermint/abci/types" reflect "reflect" @@ -264,7 +264,7 @@ func (mr *MockAppModuleGenesisMockRecorder) RegisterRESTRoutes(arg0, arg1 interf // RegisterGRPCRoutes mocks base method func (m *MockAppModuleGenesis) RegisterGRPCRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterRESTRoutes", arg0, arg1) + m.ctrl.Call(m, "RegisterGRPCRoutes", arg0, arg1) } // RegisterGRPCRoutes indicates an expected call of RegisterGRPCRoutes @@ -539,29 +539,29 @@ func (mr *MockAppModuleMockRecorder) QuerierRoute() *gomock.Call { } // LegacyQuerierHandler mocks base method -func (m *MockAppModule) LegacyQuerierHandler(*codec.LegacyAmino) types0.Querier { +func (m *MockAppModule) LegacyQuerierHandler(arg0 *codec.LegacyAmino) types0.Querier { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LegacyQuerierHandler") + ret := m.ctrl.Call(m, "LegacyQuerierHandler", arg0) ret0, _ := ret[0].(types0.Querier) return ret0 } // LegacyQuerierHandler indicates an expected call of LegacyQuerierHandler -func (mr *MockAppModuleMockRecorder) NewQuerierHandler() *gomock.Call { +func (mr *MockAppModuleMockRecorder) LegacyQuerierHandler(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyQuerierHandler", reflect.TypeOf((*MockAppModule)(nil).LegacyQuerierHandler)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyQuerierHandler", reflect.TypeOf((*MockAppModule)(nil).LegacyQuerierHandler), arg0) } -// RegisterQueryService mocks base method -func (m *MockAppModule) RegisterQueryService(arg0 grpc.Server) { +// RegisterServices mocks base method +func (m *MockAppModule) RegisterServices(arg0 module.Configurator) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterQueryService", arg0) + m.ctrl.Call(m, "RegisterServices", arg0) } -// RegisterQueryService indicates an expected call of RegisterQueryService -func (mr *MockAppModuleMockRecorder) RegisterQueryService(arg0 interface{}) *gomock.Call { +// RegisterServices indicates an expected call of RegisterServices +func (mr *MockAppModuleMockRecorder) RegisterServices(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterQueryService", reflect.TypeOf((*MockAppModule)(nil).RegisterQueryService), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterServices", reflect.TypeOf((*MockAppModule)(nil).RegisterServices), arg0) } // BeginBlock mocks base method diff --git a/types/module/configurator.go b/types/module/configurator.go new file mode 100644 index 000000000000..e720aff240af --- /dev/null +++ b/types/module/configurator.go @@ -0,0 +1,21 @@ +package module + +import "github.com/gogo/protobuf/grpc" + +type Configurator interface { + QueryServer() grpc.Server +} + +type configurator struct { + queryServer grpc.Server +} + +func NewConfigurator(queryServer grpc.Server) Configurator { + return configurator{queryServer: queryServer} +} + +var _ Configurator = configurator{} + +func (c configurator) QueryServer() grpc.Server { + return c.queryServer +} diff --git a/types/module/module.go b/types/module/module.go index d02b9b25682a..f610bb0dee9c 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -173,8 +173,8 @@ type AppModule interface { // Deprecated: use RegisterQueryService LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier - // RegisterQueryService allows a module to register a gRPC query service - RegisterQueryService(grpc.Server) + // RegisterServices allows a module to register services + RegisterServices(Configurator) // ABCI BeginBlock(sdk.Context, abci.RequestBeginBlock) @@ -208,7 +208,7 @@ func (GenesisOnlyAppModule) QuerierRoute() string { return "" } func (gam GenesisOnlyAppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } // RegisterQueryService registers all gRPC query services. -func (gam GenesisOnlyAppModule) RegisterQueryService(grpc.Server) {} +func (gam GenesisOnlyAppModule) RegisterServices(Configurator) {} // BeginBlock returns an empty module begin-block func (gam GenesisOnlyAppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {} @@ -288,10 +288,11 @@ func (m *Manager) RegisterRoutes(router sdk.Router, queryRouter sdk.QueryRouter, } } -// RegisterQueryServices registers all module query services -func (m *Manager) RegisterQueryServices(grpcRouter grpc.Server) { +// RegisterServices registers all module services +func (m *Manager) RegisterServices(queryRouter grpc.Server) { + cfg := NewConfigurator(queryRouter) for _, module := range m.Modules { - module.RegisterQueryService(grpcRouter) + module.RegisterServices(cfg) } } diff --git a/types/module/module_test.go b/types/module/module_test.go index 6dc3665043f2..4b265646e596 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -182,10 +182,10 @@ func TestManager_RegisterQueryServices(t *testing.T) { require.Equal(t, 2, len(mm.Modules)) queryRouter := mocks.NewMockServer(mockCtrl) - mockAppModule1.EXPECT().RegisterQueryService(queryRouter).Times(1) - mockAppModule2.EXPECT().RegisterQueryService(queryRouter).Times(1) + mockAppModule1.EXPECT().RegisterServices(queryRouter).Times(1) + mockAppModule2.EXPECT().RegisterServices(queryRouter).Times(1) - mm.RegisterQueryServices(queryRouter) + mm.RegisterServices(queryRouter) } func TestManager_InitGenesis(t *testing.T) { diff --git a/x/auth/module.go b/x/auth/module.go index 80a738551bfd..21e43bef262b 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -128,8 +127,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.accountKeeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.accountKeeper) } // InitGenesis performs genesis initialization for the auth module. It returns diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index 026b9858bbe9..b4997d60e4bd 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -3,7 +3,6 @@ package vesting import ( "encoding/json" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -102,7 +101,7 @@ func (am AppModule) Route() sdk.Route { func (AppModule) QuerierRoute() string { return "" } // RegisterQueryService performs a no-op. -func (am AppModule) RegisterQueryService(_ grpc.Server) {} +func (am AppModule) RegisterServices(_ module.Configurator) {} // LegacyQuerierHandler performs a no-op. func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { diff --git a/x/bank/module.go b/x/bank/module.go index 6bbf0e7dc382..1b3d68f4607d 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -97,8 +96,8 @@ type AppModule struct { // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // NewAppModule creates a new AppModule object diff --git a/x/capability/module.go b/x/capability/module.go index 1f5e17df3272..cc1d6272eb0f 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -5,7 +5,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -114,7 +113,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { retur // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(grpc.Server) {} +func (am AppModule) RegisterServices(module.Configurator) {} // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} diff --git a/x/crisis/module.go b/x/crisis/module.go index cc0beac0637a..fdc2ffb03d6f 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -115,7 +114,7 @@ func (AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return n // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(grpc.Server) {} +func (am AppModule) RegisterServices(module.Configurator) {} // InitGenesis performs genesis initialization for the crisis module. It returns // no validator updates. diff --git a/x/distribution/module.go b/x/distribution/module.go index efd6bcc739a2..9c53d5619170 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -142,8 +141,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the distribution module. It returns diff --git a/x/evidence/module.go b/x/evidence/module.go index 078cd6e2c925..1ac32c2148b7 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -151,8 +150,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // RegisterInvariants registers the evidence module's invariants. diff --git a/x/gov/module.go b/x/gov/module.go index 033bae0a3f28..31c0e5c05d80 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -8,7 +8,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -158,8 +157,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the gov module. It returns diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 9e8830c1c75d..4d73f693cd2a 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -123,8 +122,8 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the ibc-transfer module. It returns diff --git a/x/ibc/core/module.go b/x/ibc/core/module.go index 3f82bfcd9ddb..35a734ccf959 100644 --- a/x/ibc/core/module.go +++ b/x/ibc/core/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -132,8 +131,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd } // RegisterQueryService registers the gRPC query service for the ibc module. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryService(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryService(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the ibc module. It returns diff --git a/x/ibc/testing/mock/mock.go b/x/ibc/testing/mock/mock.go index 27613773619c..f984009e8a74 100644 --- a/x/ibc/testing/mock/mock.go +++ b/x/ibc/testing/mock/mock.go @@ -3,7 +3,8 @@ package mock import ( "encoding/json" - "github.com/gogo/protobuf/grpc" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -102,7 +103,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { } // RegisterQueryService implements the AppModule interface. -func (am AppModule) RegisterQueryService(server grpc.Server) {} +func (am AppModule) RegisterServices(server module.Configurator) {} // InitGenesis implements the AppModule interface. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { diff --git a/x/mint/module.go b/x/mint/module.go index b483696b9228..0a29598add2c 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -126,8 +125,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a gRPC query service to respond to the // module-specific gRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the mint module. It returns diff --git a/x/params/module.go b/x/params/module.go index 0c947938311d..b95f76947ddb 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -5,7 +5,6 @@ import ( "encoding/json" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -112,8 +111,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a gRPC query service to respond to the // module-specific gRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - proposal.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + proposal.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // ProposalContents returns all the params content functions used to diff --git a/x/slashing/module.go b/x/slashing/module.go index 21fa5e336090..f74c4a84dfd2 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -140,8 +139,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the slashing module. It returns diff --git a/x/staking/module.go b/x/staking/module.go index f91d0eee7617..6a344265b74a 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -136,9 +135,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { +func (am AppModule) RegisterServices(cfg module.Configurator) { querier := keeper.Querier{Keeper: am.keeper} - types.RegisterQueryServer(server, querier) + types.RegisterQueryServer(cfg.QueryServer(), querier) } // InitGenesis performs genesis initialization for the staking module. It returns diff --git a/x/upgrade/module.go b/x/upgrade/module.go index bc44a497426e..df5e23a2f4f2 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -97,8 +96,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis is ignored, no sense in serializing future upgrades From d9b8a1db89e42eb5cfd7b2595c57fae109c90ed9 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 18:01:04 +0200 Subject: [PATCH 02/51] Cleaner proto files --- baseapp/baseapp_test.go | 6 +- baseapp/grpcrouter_test.go | 4 +- client/context_test.go | 2 +- client/grpc_query_test.go | 2 +- scripts/protocgen.sh | 2 +- server/grpc/server_test.go | 2 +- simapp/app.go | 2 +- .../{test_service.go => grpc_query.go} | 10 +- testutil/testdata/msg_service.go | 10 + testutil/testdata/proto.pb.go | 1624 +- testutil/testdata/query.pb.go | 1371 ++ testutil/testdata/query.proto | 39 + testutil/testdata/testdata.pb.go | 1412 ++ testutil/testdata/testdata.proto | 37 + testutil/testdata/tx.pb.go | 764 + testutil/testdata/tx.proto | 28 + testutil/testdata/unknonwnproto.pb.go | 13229 ++++++++++++++++ .../{proto.proto => unknonwnproto.proto} | 66 - types/msg_service.go | 22 + 19 files changed, 17127 insertions(+), 1505 deletions(-) rename testutil/testdata/{test_service.go => grpc_query.go} (72%) create mode 100644 testutil/testdata/msg_service.go create mode 100644 testutil/testdata/query.pb.go create mode 100644 testutil/testdata/query.proto create mode 100644 testutil/testdata/testdata.pb.go create mode 100644 testutil/testdata/testdata.proto create mode 100644 testutil/testdata/tx.pb.go create mode 100644 testutil/testdata/tx.proto create mode 100644 testutil/testdata/unknonwnproto.pb.go rename testutil/testdata/{proto.proto => unknonwnproto.proto} (87%) create mode 100644 types/msg_service.go diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 760e624eb99f..8c28d151ad55 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -1692,9 +1692,9 @@ func TestQuery(t *testing.T) { func TestGRPCQuery(t *testing.T) { grpcQueryOpt := func(bapp *BaseApp) { - testdata.RegisterTestServiceServer( + testdata.RegisterQueryServer( bapp.GRPCQueryRouter(), - testdata.TestServiceImpl{}, + testdata.QueryImpl{}, ) } @@ -1711,7 +1711,7 @@ func TestGRPCQuery(t *testing.T) { reqQuery := abci.RequestQuery{ Data: reqBz, - Path: "/testdata.TestService/SayHello", + Path: "/testdata.Query/SayHello", } resQuery := app.Query(reqQuery) diff --git a/baseapp/grpcrouter_test.go b/baseapp/grpcrouter_test.go index 8761780f9f8a..d2051a113239 100644 --- a/baseapp/grpcrouter_test.go +++ b/baseapp/grpcrouter_test.go @@ -15,12 +15,12 @@ func TestGRPCRouter(t *testing.T) { qr := NewGRPCQueryRouter() interfaceRegistry := testdata.NewTestInterfaceRegistry() qr.SetInterfaceRegistry(interfaceRegistry) - testdata.RegisterTestServiceServer(qr, testdata.TestServiceImpl{}) + testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) helper := &QueryServiceTestHelper{ GRPCQueryRouter: qr, ctx: sdk.Context{}.WithContext(context.Background()), } - client := testdata.NewTestServiceClient(helper) + client := testdata.NewQueryClient(helper) res, err := client.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) require.Nil(t, err) diff --git a/client/context_test.go b/client/context_test.go index 79f6de5d0dfe..c4628d0ef2d7 100644 --- a/client/context_test.go +++ b/client/context_test.go @@ -108,7 +108,7 @@ func TestCLIQueryConn(t *testing.T) { n := network.New(t, cfg) defer n.Cleanup() - testClient := testdata.NewTestServiceClient(n.Validators[0].ClientCtx) + testClient := testdata.NewQueryClient(n.Validators[0].ClientCtx) res, err := testClient.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) require.NoError(t, err) require.Equal(t, "hello", res.Message) diff --git a/client/grpc_query_test.go b/client/grpc_query_test.go index d98a73fbf2e5..c4d2f024a07b 100644 --- a/client/grpc_query_test.go +++ b/client/grpc_query_test.go @@ -43,7 +43,7 @@ func (s *IntegrationTestSuite) TestGRPCQuery() { val0 := s.network.Validators[0] // gRPC query to test service should work - testClient := testdata.NewTestServiceClient(val0.ClientCtx) + testClient := testdata.NewQueryClient(val0.ClientCtx) testRes, err := testClient.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) s.Require().NoError(err) s.Require().Equal("hello", testRes.Message) diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 74447d849774..e1592aa780b6 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -22,7 +22,7 @@ done # generate codec/testdata proto code protoc -I "proto" -I "third_party/proto" -I "testutil/testdata" --gocosmos_out=plugins=interfacetype+grpc,\ -Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. ./testutil/testdata/proto.proto +Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. ./testutil/testdata/*.proto # move proto files to the right places cp -r github.com/cosmos/cosmos-sdk/* ./ diff --git a/server/grpc/server_test.go b/server/grpc/server_test.go index 19cac38acfdb..f5db3c7fc208 100644 --- a/server/grpc/server_test.go +++ b/server/grpc/server_test.go @@ -50,7 +50,7 @@ func (s *IntegrationTestSuite) TestGRPCServer() { s.Require().NoError(err) // gRPC query to test service should work - testClient := testdata.NewTestServiceClient(conn) + testClient := testdata.NewQueryClient(conn) testRes, err := testClient.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) s.Require().NoError(err) s.Require().Equal("hello", testRes.Message) diff --git a/simapp/app.go b/simapp/app.go index 91a107bee682..51fd8d70e293 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -362,7 +362,7 @@ func NewSimApp( app.mm.RegisterQueryServices(app.GRPCQueryRouter()) // add test gRPC service for testing gRPC queries in isolation - testdata.RegisterTestServiceServer(app.GRPCQueryRouter(), testdata.TestServiceImpl{}) + testdata.RegisterQueryServer(app.GRPCQueryRouter(), testdata.QueryImpl{}) // create the simulation manager and define the order of the modules for deterministic simulations // diff --git a/testutil/testdata/test_service.go b/testutil/testdata/grpc_query.go similarity index 72% rename from testutil/testdata/test_service.go rename to testutil/testdata/grpc_query.go index 5311c160b820..c80a61594f9b 100644 --- a/testutil/testdata/test_service.go +++ b/testutil/testdata/grpc_query.go @@ -9,9 +9,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" ) -type TestServiceImpl struct{} +type QueryImpl struct{} -func (e TestServiceImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) { +func (e QueryImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) { animal, ok := request.AnyAnimal.GetCachedValue().(Animal) if !ok { return nil, fmt.Errorf("expected Animal") @@ -28,16 +28,16 @@ func (e TestServiceImpl) TestAny(_ context.Context, request *TestAnyRequest) (*T }}, nil } -func (e TestServiceImpl) Echo(_ context.Context, req *EchoRequest) (*EchoResponse, error) { +func (e QueryImpl) Echo(_ context.Context, req *EchoRequest) (*EchoResponse, error) { return &EchoResponse{Message: req.Message}, nil } -func (e TestServiceImpl) SayHello(_ context.Context, request *SayHelloRequest) (*SayHelloResponse, error) { +func (e QueryImpl) SayHello(_ context.Context, request *SayHelloRequest) (*SayHelloResponse, error) { greeting := fmt.Sprintf("Hello %s!", request.Name) return &SayHelloResponse{Greeting: greeting}, nil } -var _ TestServiceServer = TestServiceImpl{} +var _ QueryServer = QueryImpl{} var _ types.UnpackInterfacesMessage = &TestAnyRequest{} diff --git a/testutil/testdata/msg_service.go b/testutil/testdata/msg_service.go new file mode 100644 index 000000000000..c63067481660 --- /dev/null +++ b/testutil/testdata/msg_service.go @@ -0,0 +1,10 @@ +package testdata + +import ( + "context" + "fmt" + + "github.com/gogo/protobuf/proto" + + "github.com/cosmos/cosmos-sdk/codec/types" +) diff --git a/testutil/testdata/proto.pb.go b/testutil/testdata/proto.pb.go index 929f0d442333..a43d6b6e8f67 100644 --- a/testutil/testdata/proto.pb.go +++ b/testutil/testdata/proto.pb.go @@ -4,17 +4,12 @@ package testdata import ( - context "context" encoding_binary "encoding/binary" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" tx "github.com/cosmos/cosmos-sdk/types/tx" _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -62,7 +57,7 @@ func (x Customer2_City) String() string { } func (Customer2_City) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{14, 0} + return fileDescriptor_2fcc84b9998d60d8, []int{8, 0} } type Dog struct { @@ -309,270 +304,6 @@ func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any { return nil } -type EchoRequest struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *EchoRequest) Reset() { *m = EchoRequest{} } -func (m *EchoRequest) String() string { return proto.CompactTextString(m) } -func (*EchoRequest) ProtoMessage() {} -func (*EchoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{5} -} -func (m *EchoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EchoRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EchoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EchoRequest.Merge(m, src) -} -func (m *EchoRequest) XXX_Size() int { - return m.Size() -} -func (m *EchoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EchoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EchoRequest proto.InternalMessageInfo - -func (m *EchoRequest) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -type EchoResponse struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *EchoResponse) Reset() { *m = EchoResponse{} } -func (m *EchoResponse) String() string { return proto.CompactTextString(m) } -func (*EchoResponse) ProtoMessage() {} -func (*EchoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{6} -} -func (m *EchoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EchoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EchoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EchoResponse.Merge(m, src) -} -func (m *EchoResponse) XXX_Size() int { - return m.Size() -} -func (m *EchoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EchoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_EchoResponse proto.InternalMessageInfo - -func (m *EchoResponse) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -type SayHelloRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *SayHelloRequest) Reset() { *m = SayHelloRequest{} } -func (m *SayHelloRequest) String() string { return proto.CompactTextString(m) } -func (*SayHelloRequest) ProtoMessage() {} -func (*SayHelloRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{7} -} -func (m *SayHelloRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SayHelloRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SayHelloRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SayHelloRequest.Merge(m, src) -} -func (m *SayHelloRequest) XXX_Size() int { - return m.Size() -} -func (m *SayHelloRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SayHelloRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SayHelloRequest proto.InternalMessageInfo - -func (m *SayHelloRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type SayHelloResponse struct { - Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` -} - -func (m *SayHelloResponse) Reset() { *m = SayHelloResponse{} } -func (m *SayHelloResponse) String() string { return proto.CompactTextString(m) } -func (*SayHelloResponse) ProtoMessage() {} -func (*SayHelloResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{8} -} -func (m *SayHelloResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SayHelloResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SayHelloResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SayHelloResponse.Merge(m, src) -} -func (m *SayHelloResponse) XXX_Size() int { - return m.Size() -} -func (m *SayHelloResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SayHelloResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SayHelloResponse proto.InternalMessageInfo - -func (m *SayHelloResponse) GetGreeting() string { - if m != nil { - return m.Greeting - } - return "" -} - -type TestAnyRequest struct { - AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"` -} - -func (m *TestAnyRequest) Reset() { *m = TestAnyRequest{} } -func (m *TestAnyRequest) String() string { return proto.CompactTextString(m) } -func (*TestAnyRequest) ProtoMessage() {} -func (*TestAnyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{9} -} -func (m *TestAnyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestAnyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestAnyRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestAnyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestAnyRequest.Merge(m, src) -} -func (m *TestAnyRequest) XXX_Size() int { - return m.Size() -} -func (m *TestAnyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TestAnyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo - -func (m *TestAnyRequest) GetAnyAnimal() *types.Any { - if m != nil { - return m.AnyAnimal - } - return nil -} - -type TestAnyResponse struct { - HasAnimal *HasAnimal `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` -} - -func (m *TestAnyResponse) Reset() { *m = TestAnyResponse{} } -func (m *TestAnyResponse) String() string { return proto.CompactTextString(m) } -func (*TestAnyResponse) ProtoMessage() {} -func (*TestAnyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{10} -} -func (m *TestAnyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestAnyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestAnyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestAnyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestAnyResponse.Merge(m, src) -} -func (m *TestAnyResponse) XXX_Size() int { - return m.Size() -} -func (m *TestAnyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TestAnyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TestAnyResponse proto.InternalMessageInfo - -func (m *TestAnyResponse) GetHasAnimal() *HasAnimal { - if m != nil { - return m.HasAnimal - } - return nil -} - // msg type for testing type TestMsg struct { Signers []string `protobuf:"bytes,1,rep,name=signers,proto3" json:"signers,omitempty"` @@ -582,7 +313,7 @@ func (m *TestMsg) Reset() { *m = TestMsg{} } func (m *TestMsg) String() string { return proto.CompactTextString(m) } func (*TestMsg) ProtoMessage() {} func (*TestMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{11} + return fileDescriptor_2fcc84b9998d60d8, []int{5} } func (m *TestMsg) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -622,7 +353,7 @@ func (m *BadMultiSignature) Reset() { *m = BadMultiSignature{} } func (m *BadMultiSignature) String() string { return proto.CompactTextString(m) } func (*BadMultiSignature) ProtoMessage() {} func (*BadMultiSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{12} + return fileDescriptor_2fcc84b9998d60d8, []int{6} } func (m *BadMultiSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -676,7 +407,7 @@ func (m *Customer1) Reset() { *m = Customer1{} } func (m *Customer1) String() string { return proto.CompactTextString(m) } func (*Customer1) ProtoMessage() {} func (*Customer1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{13} + return fileDescriptor_2fcc84b9998d60d8, []int{7} } func (m *Customer1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -747,7 +478,7 @@ func (m *Customer2) Reset() { *m = Customer2{} } func (m *Customer2) String() string { return proto.CompactTextString(m) } func (*Customer2) ProtoMessage() {} func (*Customer2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{14} + return fileDescriptor_2fcc84b9998d60d8, []int{8} } func (m *Customer2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -834,7 +565,7 @@ func (m *Nested4A) Reset() { *m = Nested4A{} } func (m *Nested4A) String() string { return proto.CompactTextString(m) } func (*Nested4A) ProtoMessage() {} func (*Nested4A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{15} + return fileDescriptor_2fcc84b9998d60d8, []int{9} } func (m *Nested4A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -888,7 +619,7 @@ func (m *Nested3A) Reset() { *m = Nested3A{} } func (m *Nested3A) String() string { return proto.CompactTextString(m) } func (*Nested3A) ProtoMessage() {} func (*Nested3A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{16} + return fileDescriptor_2fcc84b9998d60d8, []int{10} } func (m *Nested3A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -955,7 +686,7 @@ func (m *Nested2A) Reset() { *m = Nested2A{} } func (m *Nested2A) String() string { return proto.CompactTextString(m) } func (*Nested2A) ProtoMessage() {} func (*Nested2A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{17} + return fileDescriptor_2fcc84b9998d60d8, []int{11} } func (m *Nested2A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1014,7 +745,7 @@ func (m *Nested1A) Reset() { *m = Nested1A{} } func (m *Nested1A) String() string { return proto.CompactTextString(m) } func (*Nested1A) ProtoMessage() {} func (*Nested1A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{18} + return fileDescriptor_2fcc84b9998d60d8, []int{12} } func (m *Nested1A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1067,7 +798,7 @@ func (m *Nested4B) Reset() { *m = Nested4B{} } func (m *Nested4B) String() string { return proto.CompactTextString(m) } func (*Nested4B) ProtoMessage() {} func (*Nested4B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{19} + return fileDescriptor_2fcc84b9998d60d8, []int{13} } func (m *Nested4B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1128,7 +859,7 @@ func (m *Nested3B) Reset() { *m = Nested3B{} } func (m *Nested3B) String() string { return proto.CompactTextString(m) } func (*Nested3B) ProtoMessage() {} func (*Nested3B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{20} + return fileDescriptor_2fcc84b9998d60d8, []int{14} } func (m *Nested3B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1196,7 +927,7 @@ func (m *Nested2B) Reset() { *m = Nested2B{} } func (m *Nested2B) String() string { return proto.CompactTextString(m) } func (*Nested2B) ProtoMessage() {} func (*Nested2B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{21} + return fileDescriptor_2fcc84b9998d60d8, []int{15} } func (m *Nested2B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1263,7 +994,7 @@ func (m *Nested1B) Reset() { *m = Nested1B{} } func (m *Nested1B) String() string { return proto.CompactTextString(m) } func (*Nested1B) ProtoMessage() {} func (*Nested1B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{22} + return fileDescriptor_2fcc84b9998d60d8, []int{16} } func (m *Nested1B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1330,7 +1061,7 @@ func (m *Customer3) Reset() { *m = Customer3{} } func (m *Customer3) String() string { return proto.CompactTextString(m) } func (*Customer3) ProtoMessage() {} func (*Customer3) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{23} + return fileDescriptor_2fcc84b9998d60d8, []int{17} } func (m *Customer3) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1467,7 +1198,7 @@ func (m *TestVersion1) Reset() { *m = TestVersion1{} } func (m *TestVersion1) String() string { return proto.CompactTextString(m) } func (*TestVersion1) ProtoMessage() {} func (*TestVersion1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{24} + return fileDescriptor_2fcc84b9998d60d8, []int{18} } func (m *TestVersion1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1612,7 +1343,7 @@ func (m *TestVersion2) Reset() { *m = TestVersion2{} } func (m *TestVersion2) String() string { return proto.CompactTextString(m) } func (*TestVersion2) ProtoMessage() {} func (*TestVersion2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{25} + return fileDescriptor_2fcc84b9998d60d8, []int{19} } func (m *TestVersion2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1764,7 +1495,7 @@ func (m *TestVersion3) Reset() { *m = TestVersion3{} } func (m *TestVersion3) String() string { return proto.CompactTextString(m) } func (*TestVersion3) ProtoMessage() {} func (*TestVersion3) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{26} + return fileDescriptor_2fcc84b9998d60d8, []int{20} } func (m *TestVersion3) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1915,7 +1646,7 @@ func (m *TestVersion3LoneOneOfValue) Reset() { *m = TestVersion3LoneOneO func (m *TestVersion3LoneOneOfValue) String() string { return proto.CompactTextString(m) } func (*TestVersion3LoneOneOfValue) ProtoMessage() {} func (*TestVersion3LoneOneOfValue) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{27} + return fileDescriptor_2fcc84b9998d60d8, []int{21} } func (m *TestVersion3LoneOneOfValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2056,7 +1787,7 @@ func (m *TestVersion3LoneNesting) Reset() { *m = TestVersion3LoneNesting func (m *TestVersion3LoneNesting) String() string { return proto.CompactTextString(m) } func (*TestVersion3LoneNesting) ProtoMessage() {} func (*TestVersion3LoneNesting) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28} + return fileDescriptor_2fcc84b9998d60d8, []int{22} } func (m *TestVersion3LoneNesting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2198,7 +1929,7 @@ func (m *TestVersion3LoneNesting_Inner1) Reset() { *m = TestVersion3Lone func (m *TestVersion3LoneNesting_Inner1) String() string { return proto.CompactTextString(m) } func (*TestVersion3LoneNesting_Inner1) ProtoMessage() {} func (*TestVersion3LoneNesting_Inner1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 0} + return fileDescriptor_2fcc84b9998d60d8, []int{22, 0} } func (m *TestVersion3LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2261,7 +1992,7 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) String() string { } func (*TestVersion3LoneNesting_Inner1_InnerInner) ProtoMessage() {} func (*TestVersion3LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 0, 0} + return fileDescriptor_2fcc84b9998d60d8, []int{22, 0, 0} } func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2314,7 +2045,7 @@ func (m *TestVersion3LoneNesting_Inner2) Reset() { *m = TestVersion3Lone func (m *TestVersion3LoneNesting_Inner2) String() string { return proto.CompactTextString(m) } func (*TestVersion3LoneNesting_Inner2) ProtoMessage() {} func (*TestVersion3LoneNesting_Inner2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 1} + return fileDescriptor_2fcc84b9998d60d8, []int{22, 1} } func (m *TestVersion3LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2377,7 +2108,7 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) String() string { } func (*TestVersion3LoneNesting_Inner2_InnerInner) ProtoMessage() {} func (*TestVersion3LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 1, 0} + return fileDescriptor_2fcc84b9998d60d8, []int{22, 1, 0} } func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2443,7 +2174,7 @@ func (m *TestVersion4LoneNesting) Reset() { *m = TestVersion4LoneNesting func (m *TestVersion4LoneNesting) String() string { return proto.CompactTextString(m) } func (*TestVersion4LoneNesting) ProtoMessage() {} func (*TestVersion4LoneNesting) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29} + return fileDescriptor_2fcc84b9998d60d8, []int{23} } func (m *TestVersion4LoneNesting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2585,7 +2316,7 @@ func (m *TestVersion4LoneNesting_Inner1) Reset() { *m = TestVersion4Lone func (m *TestVersion4LoneNesting_Inner1) String() string { return proto.CompactTextString(m) } func (*TestVersion4LoneNesting_Inner1) ProtoMessage() {} func (*TestVersion4LoneNesting_Inner1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 0} + return fileDescriptor_2fcc84b9998d60d8, []int{23, 0} } func (m *TestVersion4LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2648,7 +2379,7 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) String() string { } func (*TestVersion4LoneNesting_Inner1_InnerInner) ProtoMessage() {} func (*TestVersion4LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 0, 0} + return fileDescriptor_2fcc84b9998d60d8, []int{23, 0, 0} } func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2701,7 +2432,7 @@ func (m *TestVersion4LoneNesting_Inner2) Reset() { *m = TestVersion4Lone func (m *TestVersion4LoneNesting_Inner2) String() string { return proto.CompactTextString(m) } func (*TestVersion4LoneNesting_Inner2) ProtoMessage() {} func (*TestVersion4LoneNesting_Inner2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 1} + return fileDescriptor_2fcc84b9998d60d8, []int{23, 1} } func (m *TestVersion4LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2764,7 +2495,7 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) String() string { } func (*TestVersion4LoneNesting_Inner2_InnerInner) ProtoMessage() {} func (*TestVersion4LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 1, 0} + return fileDescriptor_2fcc84b9998d60d8, []int{23, 1, 0} } func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2822,7 +2553,7 @@ func (m *TestVersionFD1) Reset() { *m = TestVersionFD1{} } func (m *TestVersionFD1) String() string { return proto.CompactTextString(m) } func (*TestVersionFD1) ProtoMessage() {} func (*TestVersionFD1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{30} + return fileDescriptor_2fcc84b9998d60d8, []int{24} } func (m *TestVersionFD1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2939,7 +2670,7 @@ func (m *TestVersionFD1WithExtraAny) Reset() { *m = TestVersionFD1WithEx func (m *TestVersionFD1WithExtraAny) String() string { return proto.CompactTextString(m) } func (*TestVersionFD1WithExtraAny) ProtoMessage() {} func (*TestVersionFD1WithExtraAny) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{31} + return fileDescriptor_2fcc84b9998d60d8, []int{25} } func (m *TestVersionFD1WithExtraAny) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3051,7 +2782,7 @@ func (m *AnyWithExtra) Reset() { *m = AnyWithExtra{} } func (m *AnyWithExtra) String() string { return proto.CompactTextString(m) } func (*AnyWithExtra) ProtoMessage() {} func (*AnyWithExtra) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{32} + return fileDescriptor_2fcc84b9998d60d8, []int{26} } func (m *AnyWithExtra) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3106,7 +2837,7 @@ func (m *TestUpdatedTxRaw) Reset() { *m = TestUpdatedTxRaw{} } func (m *TestUpdatedTxRaw) String() string { return proto.CompactTextString(m) } func (*TestUpdatedTxRaw) ProtoMessage() {} func (*TestUpdatedTxRaw) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{33} + return fileDescriptor_2fcc84b9998d60d8, []int{27} } func (m *TestUpdatedTxRaw) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3184,7 +2915,7 @@ func (m *TestUpdatedTxBody) Reset() { *m = TestUpdatedTxBody{} } func (m *TestUpdatedTxBody) String() string { return proto.CompactTextString(m) } func (*TestUpdatedTxBody) ProtoMessage() {} func (*TestUpdatedTxBody) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{34} + return fileDescriptor_2fcc84b9998d60d8, []int{28} } func (m *TestUpdatedTxBody) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3273,7 +3004,7 @@ func (m *TestUpdatedAuthInfo) Reset() { *m = TestUpdatedAuthInfo{} } func (m *TestUpdatedAuthInfo) String() string { return proto.CompactTextString(m) } func (*TestUpdatedAuthInfo) ProtoMessage() {} func (*TestUpdatedAuthInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{35} + return fileDescriptor_2fcc84b9998d60d8, []int{29} } func (m *TestUpdatedAuthInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3338,7 +3069,7 @@ func (m *TestRepeatedUints) Reset() { *m = TestRepeatedUints{} } func (m *TestRepeatedUints) String() string { return proto.CompactTextString(m) } func (*TestRepeatedUints) ProtoMessage() {} func (*TestRepeatedUints) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{36} + return fileDescriptor_2fcc84b9998d60d8, []int{30} } func (m *TestRepeatedUints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3381,12 +3112,6 @@ func init() { proto.RegisterType((*HasAnimal)(nil), "testdata.HasAnimal") proto.RegisterType((*HasHasAnimal)(nil), "testdata.HasHasAnimal") proto.RegisterType((*HasHasHasAnimal)(nil), "testdata.HasHasHasAnimal") - proto.RegisterType((*EchoRequest)(nil), "testdata.EchoRequest") - proto.RegisterType((*EchoResponse)(nil), "testdata.EchoResponse") - proto.RegisterType((*SayHelloRequest)(nil), "testdata.SayHelloRequest") - proto.RegisterType((*SayHelloResponse)(nil), "testdata.SayHelloResponse") - proto.RegisterType((*TestAnyRequest)(nil), "testdata.TestAnyRequest") - proto.RegisterType((*TestAnyResponse)(nil), "testdata.TestAnyResponse") proto.RegisterType((*TestMsg)(nil), "testdata.TestMsg") proto.RegisterType((*BadMultiSignature)(nil), "testdata.BadMultiSignature") proto.RegisterType((*Customer1)(nil), "testdata.Customer1") @@ -3427,331 +3152,168 @@ func init() { func init() { proto.RegisterFile("proto.proto", fileDescriptor_2fcc84b9998d60d8) } var fileDescriptor_2fcc84b9998d60d8 = []byte{ - // 1987 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x72, 0x49, 0x89, 0x7c, 0xa2, 0x29, 0x7a, 0xe2, 0xa6, 0x6b, 0x3a, 0x96, 0x95, 0x85, - 0x63, 0x33, 0x41, 0x4c, 0x5a, 0x4b, 0x1a, 0x28, 0x7c, 0x28, 0x4c, 0xca, 0x52, 0x64, 0xc0, 0x96, - 0x8b, 0xb5, 0x93, 0x16, 0xbe, 0x10, 0xcb, 0xdd, 0x21, 0xb9, 0x30, 0x39, 0xa3, 0xee, 0x2c, 0x25, - 0xb1, 0xa7, 0xa2, 0x3d, 0xb4, 0xc7, 0x5c, 0x8a, 0x02, 0x3d, 0xb5, 0xc7, 0x9e, 0x8a, 0xfc, 0x07, - 0xbd, 0xd5, 0x97, 0x02, 0xbe, 0x14, 0x28, 0x50, 0x20, 0x28, 0xec, 0x6b, 0xff, 0x83, 0xa2, 0x48, - 0x31, 0x1f, 0xfb, 0x41, 0x89, 0x54, 0x68, 0xa5, 0x8d, 0x21, 0x20, 0x17, 0x72, 0xe6, 0xed, 0x6f, - 0x7e, 0xf3, 0xe6, 0x7d, 0xed, 0xce, 0x0c, 0xac, 0xee, 0x07, 0x34, 0xa4, 0x35, 0xf1, 0x8b, 0xf2, - 0x21, 0x66, 0xa1, 0xe7, 0x84, 0x4e, 0xe5, 0x52, 0x9f, 0xf6, 0xa9, 0x10, 0xd6, 0x79, 0x4b, 0x3e, - 0xaf, 0x5c, 0xee, 0x53, 0xda, 0x1f, 0xe2, 0xba, 0xe8, 0x75, 0xc7, 0xbd, 0xba, 0x43, 0x26, 0xea, - 0x51, 0xc5, 0xa5, 0x6c, 0x44, 0x59, 0x3d, 0x3c, 0xaa, 0x1f, 0x6c, 0x76, 0x71, 0xe8, 0x6c, 0xd6, - 0xc3, 0x23, 0xf9, 0xcc, 0xbc, 0x05, 0xfa, 0x7d, 0xda, 0x47, 0x08, 0xb2, 0xcc, 0xff, 0x19, 0x36, - 0xb4, 0x0d, 0xad, 0x5a, 0xb0, 0x45, 0x9b, 0xcb, 0x88, 0x33, 0xc2, 0x46, 0x46, 0xca, 0x78, 0xdb, - 0xbc, 0x03, 0xfa, 0x96, 0x13, 0x22, 0x03, 0x56, 0x46, 0x94, 0xf8, 0xcf, 0x71, 0xa0, 0x46, 0x44, - 0x5d, 0x74, 0x09, 0x72, 0x43, 0xff, 0x00, 0x33, 0x31, 0x2a, 0x67, 0xcb, 0x8e, 0xf9, 0x09, 0x14, - 0x76, 0x1d, 0xd6, 0x22, 0xfe, 0xc8, 0x19, 0xa2, 0x8f, 0x61, 0xd9, 0x11, 0x2d, 0x31, 0x76, 0xd5, - 0xba, 0x54, 0x93, 0xaa, 0xd7, 0x22, 0xd5, 0x6b, 0x2d, 0x32, 0xb1, 0x15, 0x06, 0x15, 0x41, 0x3b, - 0x12, 0x64, 0xba, 0xad, 0x1d, 0x99, 0x5b, 0x50, 0xdc, 0x75, 0x58, 0xc2, 0xd5, 0x00, 0x18, 0x38, - 0xac, 0xb3, 0x00, 0x5f, 0x61, 0x10, 0x0d, 0x32, 0x1f, 0xc1, 0x9a, 0x24, 0x49, 0x78, 0xee, 0x42, - 0x89, 0xf3, 0x2c, 0xc8, 0x55, 0x1c, 0xa4, 0xc6, 0x9a, 0x37, 0x61, 0x75, 0xdb, 0x1d, 0x50, 0x1b, - 0xff, 0x74, 0x8c, 0x99, 0xb4, 0x0d, 0x66, 0xcc, 0xe9, 0xe3, 0xd8, 0x36, 0xb2, 0x6b, 0x56, 0xa1, - 0x28, 0x81, 0x6c, 0x9f, 0x12, 0x86, 0x4f, 0x41, 0x7e, 0x00, 0x6b, 0x4f, 0x9c, 0xc9, 0x2e, 0x1e, - 0x0e, 0x63, 0xda, 0xc8, 0x1b, 0x5a, 0xca, 0x1b, 0x35, 0x28, 0x27, 0x30, 0x45, 0x5a, 0x81, 0x7c, - 0x3f, 0xc0, 0x38, 0xf4, 0x49, 0x5f, 0x61, 0xe3, 0xbe, 0xb9, 0x0d, 0xa5, 0xa7, 0x98, 0x85, 0x7c, - 0x09, 0x8a, 0xb5, 0x01, 0xe0, 0x90, 0xc9, 0x42, 0xf6, 0x73, 0xc8, 0x44, 0x2d, 0x78, 0x1b, 0xd6, - 0x62, 0x1a, 0x35, 0xab, 0x35, 0xc3, 0x0f, 0xef, 0xd4, 0xa2, 0x90, 0xad, 0xc5, 0xc6, 0x4a, 0xbb, - 0xe1, 0x43, 0x58, 0xe1, 0x34, 0x8f, 0x58, 0x9f, 0x5b, 0x82, 0xf9, 0x7d, 0x82, 0x03, 0x66, 0x68, - 0x1b, 0x3a, 0xb7, 0x84, 0xea, 0xde, 0xcd, 0xfe, 0xfa, 0xf7, 0xd7, 0x96, 0xcc, 0x2e, 0x5c, 0x6c, - 0x3b, 0xde, 0xa3, 0xf1, 0x30, 0xf4, 0x9f, 0xf8, 0x7d, 0xe2, 0x84, 0xe3, 0x00, 0xa3, 0x75, 0x00, - 0x16, 0x75, 0xe4, 0xb8, 0xa2, 0x9d, 0x92, 0xa0, 0x9b, 0xb0, 0x36, 0x72, 0x86, 0xbe, 0xeb, 0xd3, - 0x31, 0xeb, 0xf4, 0x7c, 0x3c, 0xf4, 0x8c, 0xdc, 0x86, 0x56, 0x2d, 0xda, 0xa5, 0x58, 0xbc, 0xc3, - 0xa5, 0x77, 0xb3, 0x2f, 0xff, 0x70, 0x4d, 0x33, 0x43, 0x28, 0x6c, 0x8d, 0x59, 0x48, 0x47, 0x38, - 0xd8, 0x44, 0x25, 0xc8, 0xf8, 0x9e, 0x58, 0x47, 0xce, 0xce, 0xf8, 0xde, 0xac, 0x5c, 0x40, 0x1f, - 0x42, 0x99, 0x8d, 0xbb, 0xcc, 0x0d, 0xfc, 0xfd, 0xd0, 0xa7, 0xa4, 0xd3, 0xc3, 0xd8, 0xd0, 0x37, - 0xb4, 0x6a, 0xc6, 0x5e, 0x4b, 0xcb, 0x77, 0xb0, 0xf0, 0xf4, 0xbe, 0x33, 0x19, 0x61, 0x12, 0x1a, - 0x2b, 0xd2, 0xd3, 0xaa, 0x6b, 0x7e, 0x91, 0x49, 0xa6, 0xb5, 0x4e, 0x4c, 0x5b, 0x81, 0xbc, 0x4f, - 0xbc, 0x31, 0x0b, 0x83, 0x89, 0x4a, 0xa8, 0xb8, 0x1f, 0xab, 0xa4, 0xa7, 0x54, 0xba, 0x04, 0xb9, - 0x1e, 0x3e, 0xc4, 0x81, 0x91, 0x15, 0x7a, 0xc8, 0x0e, 0xba, 0x02, 0xf9, 0x00, 0x33, 0x1c, 0x1c, - 0x60, 0xcf, 0xf8, 0x6d, 0x5e, 0xa4, 0x52, 0x2c, 0x40, 0x1f, 0x43, 0xd6, 0xf5, 0xc3, 0x89, 0xb1, - 0xbc, 0xa1, 0x55, 0x4b, 0x96, 0x91, 0xf8, 0x2c, 0xd6, 0xaa, 0xb6, 0xe5, 0x87, 0x13, 0x5b, 0xa0, - 0xd0, 0x5d, 0xb8, 0x30, 0xf2, 0x99, 0x8b, 0x87, 0x43, 0x87, 0x60, 0x3a, 0x66, 0x06, 0x9c, 0x12, - 0x32, 0xd3, 0x50, 0xf3, 0x13, 0xc8, 0x72, 0x26, 0x94, 0x87, 0xec, 0x43, 0x87, 0xb2, 0xf2, 0x12, - 0x2a, 0x01, 0x3c, 0xa4, 0xac, 0x45, 0xfa, 0x78, 0x88, 0x59, 0x59, 0x43, 0x45, 0xc8, 0xff, 0xc8, - 0x19, 0xd2, 0xd6, 0x30, 0xa4, 0xe5, 0x0c, 0x02, 0x58, 0x7e, 0x44, 0x99, 0x4b, 0x0f, 0xcb, 0x3a, - 0x5a, 0x85, 0x95, 0x3d, 0xc7, 0x0f, 0x68, 0xd7, 0x2f, 0x67, 0xcd, 0x1a, 0xe4, 0xf7, 0x30, 0x0b, - 0xb1, 0xd7, 0x6c, 0x2d, 0xe2, 0x28, 0xf3, 0x6f, 0x5a, 0x34, 0xa0, 0xb1, 0xd0, 0x00, 0x64, 0x42, - 0xc6, 0x69, 0x1a, 0xd9, 0x0d, 0xbd, 0xba, 0x6a, 0xa1, 0xc4, 0x22, 0xd1, 0xa4, 0x76, 0xc6, 0x69, - 0xa2, 0x06, 0xe4, 0x7c, 0xe2, 0xe1, 0x23, 0x23, 0x27, 0x60, 0x57, 0x8f, 0xc3, 0x1a, 0xad, 0xda, - 0x03, 0xfe, 0x7c, 0x9b, 0x84, 0xc1, 0xc4, 0x96, 0xd8, 0xca, 0x43, 0x80, 0x44, 0x88, 0xca, 0xa0, - 0x3f, 0xc7, 0x13, 0xa1, 0x8b, 0x6e, 0xf3, 0x26, 0xaa, 0x42, 0xee, 0xc0, 0x19, 0x8e, 0xa5, 0x36, - 0xb3, 0xe7, 0x96, 0x80, 0xbb, 0x99, 0x1f, 0x68, 0xe6, 0xb3, 0x68, 0x59, 0xd6, 0x62, 0xcb, 0xfa, - 0x08, 0x96, 0x89, 0xc0, 0x8b, 0x98, 0x99, 0x41, 0xdf, 0x68, 0xd9, 0x0a, 0x61, 0xee, 0x44, 0xdc, - 0x9b, 0x27, 0xb9, 0x13, 0x9e, 0x39, 0x6a, 0x5a, 0x09, 0xcf, 0xbd, 0xd8, 0x57, 0xed, 0x13, 0x3c, - 0x65, 0xd0, 0x79, 0xed, 0x93, 0x81, 0xcd, 0x9b, 0xb3, 0x62, 0xda, 0xf4, 0x62, 0xe7, 0x9d, 0x91, - 0x81, 0xbb, 0xb3, 0x3b, 0xdf, 0x9d, 0x6d, 0x3b, 0xd3, 0x6d, 0x9a, 0x24, 0xb6, 0xe5, 0xcc, 0x59, - 0x78, 0x6e, 0xf3, 0x59, 0x34, 0x9b, 0x37, 0x17, 0xb0, 0x64, 0x3b, 0xb2, 0x00, 0xcf, 0xc9, 0x80, - 0x8e, 0x43, 0x2c, 0x72, 0xb2, 0x60, 0xcb, 0x8e, 0xf9, 0x93, 0xd8, 0xbe, 0xed, 0x33, 0xd8, 0x37, - 0x61, 0x57, 0x16, 0xd0, 0x63, 0x0b, 0x98, 0xbf, 0x48, 0x55, 0x94, 0xc6, 0x42, 0x71, 0x51, 0x82, - 0x0c, 0xeb, 0xa9, 0xd2, 0x95, 0x61, 0x3d, 0xf4, 0x1e, 0x14, 0xd8, 0x38, 0x70, 0x07, 0x4e, 0xd0, - 0xc7, 0xaa, 0x92, 0x24, 0x02, 0xb4, 0x01, 0xab, 0x1e, 0x66, 0xa1, 0x4f, 0x1c, 0x5e, 0xdd, 0x44, - 0x49, 0x2d, 0xd8, 0x69, 0x11, 0xba, 0x01, 0x25, 0x37, 0xc0, 0x9e, 0x1f, 0x76, 0x5c, 0x27, 0xf0, - 0x3a, 0x84, 0xca, 0xa2, 0xb7, 0xbb, 0x64, 0x17, 0xa5, 0x7c, 0xcb, 0x09, 0xbc, 0x3d, 0x8a, 0xae, - 0x42, 0xc1, 0x1d, 0xf0, 0x17, 0x11, 0x87, 0xe4, 0x15, 0x24, 0x2f, 0x45, 0x7b, 0x14, 0xd5, 0x21, - 0x4f, 0x03, 0xbf, 0xef, 0x13, 0x67, 0x68, 0x14, 0x8e, 0xbf, 0x51, 0xe2, 0x52, 0x6d, 0xc7, 0xa0, - 0x76, 0x21, 0xae, 0xb2, 0xe6, 0xbf, 0x32, 0x50, 0xe4, 0x2f, 0x97, 0xcf, 0x70, 0xc0, 0x7c, 0x4a, - 0x36, 0xe5, 0x67, 0x84, 0xa6, 0x3e, 0x23, 0xd0, 0x75, 0xd0, 0x1c, 0x65, 0xdc, 0x77, 0x13, 0xce, - 0xf4, 0x00, 0x5b, 0x73, 0x38, 0xaa, 0xab, 0x1c, 0x3c, 0x17, 0xd5, 0xe5, 0x28, 0x57, 0x05, 0xd7, - 0x5c, 0x94, 0x8b, 0x3e, 0x02, 0xcd, 0x53, 0xa5, 0x62, 0x0e, 0xaa, 0x9d, 0x7d, 0xf1, 0xe5, 0xb5, - 0x25, 0x5b, 0xf3, 0x50, 0x09, 0x34, 0x2c, 0xea, 0x71, 0x6e, 0x77, 0xc9, 0xd6, 0x30, 0xba, 0x01, - 0x5a, 0x4f, 0x98, 0x70, 0xee, 0x58, 0x8e, 0xeb, 0x21, 0x13, 0xb4, 0xbe, 0xb0, 0xe3, 0xbc, 0x82, - 0xac, 0xf5, 0xb9, 0xb6, 0x03, 0xa3, 0x70, 0xba, 0xb6, 0x03, 0x74, 0x13, 0xb4, 0xe7, 0x46, 0x71, - 0xae, 0xcd, 0xdb, 0xd9, 0x97, 0x5f, 0x5e, 0xd3, 0x6c, 0xed, 0x79, 0x3b, 0x07, 0x3a, 0x1b, 0x8f, - 0xcc, 0x5f, 0xea, 0x53, 0xe6, 0xb6, 0xde, 0xd4, 0xdc, 0xd6, 0x42, 0xe6, 0xb6, 0x16, 0x32, 0xb7, - 0xc5, 0xcd, 0x7d, 0xfd, 0xeb, 0xcc, 0x6d, 0x9d, 0xc9, 0xd0, 0xd6, 0xdb, 0x32, 0x34, 0xba, 0x02, - 0x05, 0x82, 0x0f, 0xd5, 0x67, 0xcc, 0xe5, 0x0d, 0xad, 0x9a, 0xb5, 0xf3, 0x04, 0x1f, 0x8a, 0x0f, - 0x98, 0xc8, 0x0b, 0xbf, 0x99, 0xf6, 0x42, 0xe3, 0x4d, 0xbd, 0xd0, 0x58, 0xc8, 0x0b, 0x8d, 0x85, - 0xbc, 0xd0, 0x58, 0xc8, 0x0b, 0x8d, 0x33, 0x79, 0xa1, 0xf1, 0xd6, 0xbc, 0x70, 0x0b, 0x10, 0xa1, - 0xa4, 0xe3, 0x06, 0x7e, 0xe8, 0xbb, 0xce, 0x50, 0xb9, 0xe3, 0x57, 0xa2, 0x76, 0xd9, 0x65, 0x42, - 0xc9, 0x96, 0x7a, 0x32, 0xe5, 0x97, 0x7f, 0x67, 0xa0, 0x92, 0x56, 0xff, 0x21, 0x25, 0xf8, 0x31, - 0xc1, 0x8f, 0x7b, 0x9f, 0xf1, 0x57, 0xf9, 0x39, 0xf5, 0xd2, 0xb9, 0xb1, 0xfe, 0x7f, 0x96, 0xe1, - 0xfb, 0xc7, 0xad, 0xbf, 0x27, 0xde, 0x56, 0xfd, 0x73, 0x62, 0xfa, 0xcd, 0x24, 0x21, 0xde, 0x9f, - 0x8d, 0x4a, 0xad, 0xe9, 0x9c, 0xe4, 0x06, 0xba, 0x07, 0xcb, 0x3e, 0x21, 0x38, 0xd8, 0x34, 0x4a, - 0x82, 0xbc, 0xfa, 0xb5, 0x2b, 0xab, 0x3d, 0x10, 0x78, 0x5b, 0x8d, 0x8b, 0x19, 0x2c, 0x63, 0xed, - 0x8d, 0x18, 0x2c, 0xc5, 0x60, 0x55, 0xfe, 0xa8, 0xc1, 0xb2, 0x24, 0x4d, 0x7d, 0x27, 0xe9, 0x73, - 0xbf, 0x93, 0x1e, 0xf0, 0x4f, 0x7e, 0x82, 0x03, 0xe5, 0xfd, 0xc6, 0xa2, 0x1a, 0xcb, 0x3f, 0xf1, - 0x63, 0x4b, 0x86, 0xca, 0x6d, 0xbe, 0x11, 0x88, 0x84, 0xa9, 0xc9, 0x0b, 0xd1, 0xe4, 0x62, 0x4f, - 0xa6, 0x26, 0xe7, 0xed, 0xca, 0x9f, 0x22, 0x5d, 0xad, 0x13, 0x70, 0x03, 0x56, 0x5c, 0x3a, 0x26, - 0xd1, 0x26, 0xb1, 0x60, 0x47, 0xdd, 0xb3, 0x6a, 0x6c, 0xfd, 0x2f, 0x34, 0x8e, 0xf2, 0xef, 0xab, - 0xe9, 0xfc, 0x6b, 0x7e, 0x97, 0x7f, 0xe7, 0x28, 0xff, 0x9a, 0xdf, 0x38, 0xff, 0x9a, 0xdf, 0x72, - 0xfe, 0x35, 0xbf, 0x51, 0xfe, 0xe9, 0x73, 0xf3, 0xef, 0x8b, 0xff, 0x5b, 0xfe, 0x35, 0x17, 0xca, - 0x3f, 0xeb, 0xd4, 0xfc, 0xbb, 0x94, 0x3e, 0x38, 0xd0, 0xd5, 0x21, 0x41, 0x94, 0x81, 0x7f, 0xd5, - 0xe4, 0xb9, 0x9f, 0x9a, 0x6f, 0xe7, 0xfe, 0xd9, 0xb6, 0x43, 0x6f, 0x7d, 0x5b, 0x12, 0xad, 0xe7, - 0x1f, 0xda, 0xd4, 0xf7, 0xd4, 0xce, 0xfd, 0xcd, 0x1f, 0xfb, 0xe1, 0x60, 0xfb, 0x28, 0x0c, 0x9c, - 0x16, 0x99, 0x7c, 0xab, 0x6b, 0xbb, 0x9e, 0xac, 0x2d, 0x85, 0x6b, 0x91, 0x49, 0xac, 0xd1, 0x1b, - 0xaf, 0xee, 0x29, 0x14, 0xd3, 0xe3, 0x51, 0x95, 0x2f, 0xe0, 0x94, 0x93, 0xd9, 0xa8, 0x02, 0x38, - 0x7c, 0xe1, 0xb2, 0x32, 0xea, 0xbc, 0x02, 0x16, 0x65, 0x05, 0x14, 0x3d, 0xd7, 0xfc, 0xb3, 0x06, - 0x65, 0x3e, 0xe1, 0xa7, 0xfb, 0x9e, 0x13, 0x62, 0xef, 0xe9, 0x91, 0xed, 0x1c, 0xa2, 0xab, 0x00, - 0x5d, 0xea, 0x4d, 0x3a, 0xdd, 0x49, 0x28, 0x4e, 0x50, 0xb5, 0x6a, 0xd1, 0x2e, 0x70, 0x49, 0x9b, - 0x0b, 0xd0, 0x0d, 0x58, 0x73, 0xc6, 0xe1, 0xa0, 0xe3, 0x93, 0x1e, 0x55, 0x98, 0x8c, 0xc0, 0x5c, - 0xe0, 0xe2, 0x07, 0xa4, 0x47, 0x25, 0x6e, 0xfa, 0x20, 0x56, 0x3f, 0x71, 0x10, 0xbb, 0x0e, 0xab, - 0xf1, 0xde, 0xa5, 0x73, 0x47, 0x1d, 0xc2, 0x16, 0xa2, 0xdd, 0xcb, 0x1d, 0xf4, 0x01, 0x94, 0x92, - 0xe7, 0x9b, 0xb7, 0xad, 0xa6, 0xf1, 0xf3, 0xbc, 0xc0, 0x14, 0x23, 0x0c, 0x17, 0x9a, 0x9f, 0xeb, - 0x70, 0x71, 0x6a, 0x09, 0x6d, 0xea, 0x4d, 0xd0, 0x6d, 0xc8, 0xab, 0x53, 0x73, 0x79, 0x06, 0x3c, - 0x2f, 0xc8, 0x62, 0x14, 0xcf, 0xee, 0x11, 0x1e, 0xd1, 0x28, 0xbb, 0x79, 0x9b, 0xab, 0x10, 0xfa, - 0x23, 0x4c, 0xc7, 0x61, 0x67, 0x80, 0xfd, 0xfe, 0x20, 0x54, 0x76, 0xbc, 0xa0, 0xa4, 0xbb, 0x42, - 0x88, 0xae, 0x43, 0x89, 0xd1, 0x11, 0xee, 0x24, 0x5b, 0xb1, 0xac, 0xd8, 0x8a, 0x15, 0xb9, 0x74, - 0x4f, 0x29, 0x8b, 0x76, 0xe1, 0xfd, 0x69, 0x54, 0x67, 0x46, 0x61, 0xfe, 0x9d, 0x2c, 0xcc, 0xef, - 0xa5, 0x47, 0xee, 0x1d, 0x2f, 0xd2, 0x6d, 0xb8, 0x88, 0x8f, 0x42, 0x4c, 0x78, 0x8c, 0x74, 0xa8, - 0x38, 0x4e, 0x66, 0xc6, 0x57, 0x2b, 0xa7, 0x2c, 0xb3, 0x1c, 0xe3, 0x1f, 0x4b, 0x38, 0x7a, 0x06, - 0xeb, 0x53, 0xd3, 0xcf, 0x20, 0x5c, 0x3b, 0x85, 0xf0, 0x4a, 0xea, 0xcd, 0xb1, 0x7d, 0x8c, 0xdb, - 0x7c, 0xa1, 0xc1, 0x3b, 0x29, 0x97, 0xb4, 0x54, 0x58, 0xa0, 0x7b, 0x50, 0x94, 0x07, 0xf8, 0x22, - 0x76, 0x22, 0xc7, 0x5c, 0xad, 0xc9, 0x8b, 0xa8, 0x5a, 0x78, 0x54, 0x53, 0x17, 0x51, 0xb5, 0x27, - 0x02, 0xc6, 0x07, 0xd9, 0xab, 0x2c, 0x6e, 0x33, 0x54, 0x4d, 0xce, 0xdc, 0x78, 0xd2, 0x9c, 0x1c, - 0xb8, 0x83, 0xb1, 0x3c, 0x8b, 0x9b, 0x8a, 0xae, 0x86, 0xf0, 0x5b, 0x2a, 0xba, 0x1a, 0x8b, 0x46, - 0xd7, 0x4d, 0x19, 0x5c, 0x36, 0xde, 0xc7, 0x7c, 0x29, 0x9f, 0xfa, 0x24, 0x14, 0xa1, 0x42, 0xc6, - 0x23, 0xa9, 0x7f, 0xd6, 0x16, 0x6d, 0xeb, 0x2f, 0x1a, 0xac, 0x72, 0xe4, 0x13, 0x1c, 0x1c, 0xf8, - 0x2e, 0x46, 0x77, 0x20, 0xbb, 0xed, 0x0e, 0x28, 0xfa, 0x5e, 0x92, 0xd9, 0xa9, 0xeb, 0xa0, 0xca, - 0xbb, 0xc7, 0xc5, 0xea, 0xc6, 0xa4, 0x05, 0xf9, 0xe8, 0xee, 0x06, 0x5d, 0x4e, 0x30, 0xc7, 0xae, - 0x7d, 0x2a, 0x95, 0x59, 0x8f, 0x14, 0xc5, 0x0f, 0xe5, 0x05, 0x0a, 0xaf, 0x79, 0xc6, 0x74, 0x59, - 0x49, 0x6e, 0x78, 0x2a, 0x97, 0x67, 0x3c, 0x91, 0xe3, 0xdb, 0xbb, 0x2f, 0x5e, 0xad, 0x6b, 0x2f, - 0x5f, 0xad, 0x6b, 0xff, 0x7c, 0xb5, 0xae, 0x7d, 0xfe, 0x7a, 0x7d, 0xe9, 0xe5, 0xeb, 0xf5, 0xa5, - 0xbf, 0xbf, 0x5e, 0x5f, 0x7a, 0x56, 0xeb, 0xfb, 0xe1, 0x60, 0xdc, 0xad, 0xb9, 0x74, 0x54, 0x57, - 0x97, 0x87, 0xf2, 0xef, 0x16, 0xf3, 0x9e, 0xd7, 0x39, 0xe1, 0x38, 0xf4, 0x87, 0xf5, 0x88, 0xb9, - 0xbb, 0x2c, 0x42, 0xa6, 0xf1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8b, 0xd7, 0x2e, 0x82, 0xb2, - 0x1c, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// TestServiceClient is the client API for TestService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TestServiceClient interface { - Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) - SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) - TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) + // 1820 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4f, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x72, 0x49, 0x89, 0x7c, 0xa2, 0x29, 0x7a, 0x22, 0xb4, 0x1b, 0x39, 0x96, 0x95, 0x85, + 0x6b, 0x33, 0x41, 0x4c, 0x9a, 0x4b, 0x1a, 0x28, 0x74, 0x32, 0x29, 0x5b, 0x91, 0x01, 0x5b, 0x2e, + 0x36, 0x4e, 0x5a, 0xf8, 0x42, 0x0c, 0xb9, 0x43, 0x72, 0x20, 0x72, 0x46, 0xdd, 0x99, 0xb5, 0xc4, + 0x9e, 0x8a, 0xf6, 0xd0, 0x1e, 0x73, 0x29, 0x0a, 0xf4, 0xd4, 0x1e, 0x7b, 0x2a, 0xf2, 0x0d, 0x7a, + 0xf4, 0xa5, 0x80, 0x2f, 0x05, 0x0a, 0x14, 0x08, 0x0a, 0xfb, 0xda, 0x6f, 0x50, 0x14, 0x29, 0x66, + 0xf6, 0x0f, 0x97, 0x96, 0xa8, 0xd0, 0x4a, 0x6b, 0x43, 0x40, 0x2f, 0xd2, 0xcc, 0xdb, 0xdf, 0xbc, + 0x79, 0xef, 0xf7, 0xfe, 0xec, 0xce, 0x10, 0x56, 0x0f, 0x7d, 0x2e, 0x79, 0x55, 0xff, 0x45, 0x79, + 0x49, 0x84, 0xf4, 0xb0, 0xc4, 0x1b, 0xeb, 0x03, 0x3e, 0xe0, 0x5a, 0x58, 0x53, 0xa3, 0xf0, 0xf9, + 0xc6, 0xfb, 0x03, 0xce, 0x07, 0x23, 0x52, 0xd3, 0xb3, 0x6e, 0xd0, 0xaf, 0x61, 0x36, 0x89, 0x1e, + 0x6d, 0xf4, 0xb8, 0x18, 0x73, 0x51, 0x93, 0xc7, 0xb5, 0x67, 0xf5, 0x2e, 0x91, 0xb8, 0x5e, 0x93, + 0xc7, 0xe1, 0x33, 0xfb, 0x16, 0x98, 0xf7, 0xf8, 0x00, 0x21, 0xc8, 0x0a, 0xfa, 0x33, 0x62, 0x19, + 0x5b, 0x46, 0xa5, 0xe0, 0xea, 0xb1, 0x92, 0x31, 0x3c, 0x26, 0x56, 0x26, 0x94, 0xa9, 0xb1, 0x7d, + 0x07, 0xcc, 0x1d, 0x2c, 0x91, 0x05, 0x2b, 0x63, 0xce, 0xe8, 0x01, 0xf1, 0xa3, 0x15, 0xf1, 0x14, + 0xad, 0x43, 0x6e, 0x44, 0x9f, 0x11, 0xa1, 0x57, 0xe5, 0xdc, 0x70, 0x62, 0x7f, 0x0a, 0x85, 0x3d, + 0x2c, 0x5a, 0x8c, 0x8e, 0xf1, 0x08, 0x7d, 0x02, 0xcb, 0x58, 0x8f, 0xf4, 0xda, 0x55, 0x67, 0xbd, + 0x1a, 0x9a, 0x5e, 0x8d, 0x4d, 0xaf, 0xb6, 0xd8, 0xc4, 0x8d, 0x30, 0xa8, 0x08, 0xc6, 0xb1, 0x56, + 0x66, 0xba, 0xc6, 0xb1, 0xbd, 0x03, 0xc5, 0x3d, 0x2c, 0xa6, 0xba, 0x1a, 0x00, 0x43, 0x2c, 0x3a, + 0x0b, 0xe8, 0x2b, 0x0c, 0xe3, 0x45, 0xf6, 0x23, 0x58, 0x0b, 0x95, 0x4c, 0xf5, 0x6c, 0x43, 0x49, + 0xe9, 0x59, 0x50, 0x57, 0x71, 0x98, 0x5a, 0x6b, 0x7f, 0x04, 0x2b, 0x4f, 0x88, 0x90, 0x8f, 0xc4, + 0x40, 0xf1, 0x22, 0xe8, 0x80, 0x11, 0x5f, 0x58, 0xc6, 0x96, 0xa9, 0x78, 0x89, 0xa6, 0xdb, 0xd9, + 0x5f, 0xff, 0xfe, 0xda, 0x92, 0xdd, 0x85, 0xcb, 0x6d, 0xec, 0x3d, 0x0a, 0x46, 0x92, 0x7e, 0x46, + 0x07, 0x0c, 0xcb, 0xc0, 0x27, 0x68, 0x13, 0x40, 0xc4, 0x93, 0x70, 0x5d, 0xd1, 0x4d, 0x49, 0xd0, + 0x4d, 0x58, 0x1b, 0xe3, 0x11, 0xed, 0x51, 0x1e, 0x88, 0x4e, 0x9f, 0x92, 0x91, 0x67, 0xe5, 0xb6, + 0x8c, 0x4a, 0xd1, 0x2d, 0x25, 0xe2, 0x5d, 0x25, 0xdd, 0xce, 0xbe, 0xf8, 0xc3, 0x35, 0xc3, 0x96, + 0x50, 0xd8, 0x09, 0x84, 0xe4, 0x63, 0xe2, 0xd7, 0x51, 0x09, 0x32, 0xd4, 0xd3, 0xbe, 0xe4, 0xdc, + 0x0c, 0xf5, 0x4e, 0x8b, 0x29, 0xfa, 0x08, 0xca, 0x22, 0xe8, 0x8a, 0x9e, 0x4f, 0x0f, 0x25, 0xe5, + 0xac, 0xd3, 0x27, 0xc4, 0x32, 0xb7, 0x8c, 0x4a, 0xc6, 0x5d, 0x4b, 0xcb, 0x77, 0x09, 0x51, 0xfe, + 0x1d, 0xe2, 0xc9, 0x98, 0x30, 0x69, 0xad, 0x84, 0x71, 0x8f, 0xa6, 0xf6, 0x57, 0x99, 0xe9, 0xb6, + 0xce, 0x89, 0x6d, 0x37, 0x20, 0x4f, 0x99, 0x17, 0x08, 0xe9, 0x4f, 0xa2, 0xc4, 0x48, 0xe6, 0x89, + 0x49, 0x66, 0xca, 0xa4, 0x75, 0xc8, 0xf5, 0xc9, 0x11, 0xf1, 0xad, 0xac, 0xb6, 0x23, 0x9c, 0xa0, + 0x2b, 0x90, 0xf7, 0x89, 0x20, 0xfe, 0x33, 0xe2, 0x59, 0xbf, 0xcd, 0xeb, 0x94, 0x48, 0x04, 0xe8, + 0x13, 0xc8, 0xf6, 0xa8, 0x9c, 0x58, 0xcb, 0x5b, 0x46, 0xa5, 0xe4, 0x58, 0xd5, 0xb8, 0x5c, 0xaa, + 0x89, 0x55, 0xd5, 0x1d, 0x2a, 0x27, 0xae, 0x46, 0xa1, 0x6d, 0xb8, 0x34, 0xa6, 0xa2, 0x47, 0x46, + 0x23, 0xcc, 0x08, 0x0f, 0x84, 0x05, 0x67, 0x84, 0x7b, 0x16, 0x6a, 0x7f, 0x0a, 0x59, 0xa5, 0x09, + 0xe5, 0x21, 0xfb, 0x10, 0x73, 0x51, 0x5e, 0x42, 0x25, 0x80, 0x87, 0x5c, 0xb4, 0xd8, 0x80, 0x8c, + 0x88, 0x28, 0x1b, 0xa8, 0x08, 0xf9, 0x1f, 0xe1, 0x11, 0x6f, 0x8d, 0x24, 0x2f, 0x67, 0x10, 0xc0, + 0xf2, 0x23, 0x2e, 0x7a, 0xfc, 0xa8, 0x6c, 0xa2, 0x55, 0x58, 0xd9, 0xc7, 0xd4, 0xe7, 0x5d, 0x5a, + 0xce, 0xda, 0x55, 0xc8, 0xef, 0x13, 0x21, 0x89, 0xd7, 0x6c, 0x2d, 0x12, 0x28, 0xfb, 0xaf, 0x46, + 0xbc, 0xa0, 0xb1, 0xd0, 0x02, 0x64, 0x43, 0x06, 0x37, 0xad, 0xec, 0x96, 0x59, 0x59, 0x75, 0xd0, + 0x94, 0x91, 0x78, 0x53, 0x37, 0x83, 0x9b, 0xa8, 0x01, 0x39, 0xca, 0x3c, 0x72, 0x6c, 0xe5, 0x34, + 0xec, 0xea, 0xeb, 0xb0, 0x46, 0xab, 0xfa, 0x40, 0x3d, 0xbf, 0xcf, 0xa4, 0x3f, 0x71, 0x43, 0xec, + 0xc6, 0x43, 0x80, 0xa9, 0x10, 0x95, 0xc1, 0x3c, 0x20, 0x13, 0x6d, 0x8b, 0xe9, 0xaa, 0x21, 0xaa, + 0x40, 0xee, 0x19, 0x1e, 0x05, 0xa1, 0x35, 0xa7, 0xef, 0x1d, 0x02, 0xb6, 0x33, 0x3f, 0x34, 0xec, + 0xa7, 0xb1, 0x5b, 0xce, 0x62, 0x6e, 0x7d, 0x0c, 0xcb, 0x4c, 0xe3, 0x75, 0xce, 0x9c, 0xa2, 0xbe, + 0xd1, 0x72, 0x23, 0x84, 0xbd, 0x1b, 0xeb, 0xae, 0x9f, 0xd4, 0x3d, 0xd5, 0x33, 0xc7, 0x4c, 0x67, + 0xaa, 0xe7, 0x6e, 0x12, 0xab, 0xf6, 0x09, 0x3d, 0x65, 0x30, 0xf1, 0x80, 0x44, 0x89, 0xad, 0x86, + 0xa7, 0xe5, 0xb4, 0xed, 0x25, 0xc1, 0x3b, 0xa7, 0x06, 0x15, 0xce, 0xee, 0xfc, 0x70, 0xb6, 0xdd, + 0x4c, 0xb7, 0x69, 0xb3, 0x84, 0xcb, 0x53, 0x77, 0x51, 0xb5, 0xad, 0x76, 0x31, 0x5c, 0x35, 0x5c, + 0x80, 0xc9, 0x76, 0xcc, 0x80, 0xaa, 0x49, 0x9f, 0x07, 0x92, 0xe8, 0x9a, 0x2c, 0xb8, 0xe1, 0xc4, + 0xfe, 0x49, 0xc2, 0x6f, 0xfb, 0x1c, 0xfc, 0x4e, 0xb5, 0x47, 0x0c, 0x98, 0x09, 0x03, 0xf6, 0x2f, + 0x52, 0x1d, 0xa5, 0xb1, 0x50, 0x5e, 0x94, 0x20, 0x23, 0xfa, 0x51, 0xeb, 0xca, 0x88, 0x3e, 0xfa, + 0x00, 0x0a, 0x22, 0xf0, 0x7b, 0x43, 0xec, 0x0f, 0x48, 0xd4, 0x49, 0xa6, 0x02, 0xb4, 0x05, 0xab, + 0x1e, 0x11, 0x92, 0x32, 0xac, 0xba, 0x9b, 0x6e, 0xa9, 0x05, 0x37, 0x2d, 0x42, 0x37, 0xa0, 0xd4, + 0xf3, 0x89, 0x47, 0x65, 0xa7, 0x87, 0x7d, 0xaf, 0xc3, 0x78, 0xd8, 0xf4, 0xf6, 0x96, 0xdc, 0x62, + 0x28, 0xdf, 0xc1, 0xbe, 0xb7, 0xcf, 0xd1, 0x55, 0x28, 0xf4, 0x86, 0xe4, 0xa7, 0x01, 0x51, 0x90, + 0x7c, 0x04, 0xc9, 0x87, 0xa2, 0x7d, 0x8e, 0x6a, 0x90, 0xe7, 0x3e, 0x1d, 0x50, 0x86, 0x47, 0x56, + 0x41, 0x13, 0xf1, 0xde, 0xc9, 0xee, 0x54, 0x77, 0x13, 0x50, 0xbb, 0x90, 0x74, 0x59, 0xfb, 0x9f, + 0x19, 0x28, 0xaa, 0x97, 0xcb, 0x17, 0xc4, 0x17, 0x94, 0xb3, 0x7a, 0xf8, 0x3a, 0x34, 0xa2, 0xd7, + 0x21, 0xba, 0x0e, 0x06, 0x8e, 0xc8, 0xfd, 0xde, 0x54, 0x67, 0x7a, 0x81, 0x6b, 0x60, 0x85, 0xea, + 0x46, 0x01, 0x9e, 0x8b, 0xea, 0x2a, 0x54, 0x2f, 0x4a, 0xae, 0xb9, 0xa8, 0x1e, 0xfa, 0x18, 0x0c, + 0x2f, 0x6a, 0x15, 0x73, 0x50, 0xed, 0xec, 0xf3, 0xaf, 0xaf, 0x2d, 0xb9, 0x86, 0x87, 0x4a, 0x60, + 0x10, 0xdd, 0x8f, 0x73, 0x7b, 0x4b, 0xae, 0x41, 0xd0, 0x0d, 0x30, 0xfa, 0x9a, 0xc2, 0xb9, 0x6b, + 0x15, 0xae, 0x8f, 0x6c, 0x30, 0x06, 0x9a, 0xc7, 0x79, 0x0d, 0xd9, 0x18, 0x28, 0x6b, 0x87, 0x56, + 0xe1, 0x6c, 0x6b, 0x87, 0xe8, 0x26, 0x18, 0x07, 0x56, 0x71, 0x2e, 0xe7, 0xed, 0xec, 0x8b, 0xaf, + 0xaf, 0x19, 0xae, 0x71, 0xd0, 0xce, 0x81, 0x29, 0x82, 0xb1, 0xfd, 0x4b, 0x73, 0x86, 0x6e, 0xe7, + 0x4d, 0xe9, 0x76, 0x16, 0xa2, 0xdb, 0x59, 0x88, 0x6e, 0x47, 0xd1, 0x7d, 0xfd, 0xdb, 0xe8, 0x76, + 0xce, 0x45, 0xb4, 0xf3, 0xae, 0x88, 0x46, 0x57, 0xa0, 0xc0, 0xc8, 0x51, 0xf4, 0x19, 0xf3, 0xfe, + 0x96, 0x51, 0xc9, 0xba, 0x79, 0x46, 0x8e, 0xf4, 0x07, 0x4c, 0x1c, 0x85, 0xdf, 0xcc, 0x46, 0xa1, + 0xf1, 0xa6, 0x51, 0x68, 0x2c, 0x14, 0x85, 0xc6, 0x42, 0x51, 0x68, 0x2c, 0x14, 0x85, 0xc6, 0xb9, + 0xa2, 0xd0, 0x78, 0x67, 0x51, 0xb8, 0x05, 0x88, 0x71, 0xd6, 0xe9, 0xf9, 0x54, 0xd2, 0x1e, 0x1e, + 0x45, 0xe1, 0xf8, 0x95, 0xee, 0x5d, 0x6e, 0x99, 0x71, 0xb6, 0x13, 0x3d, 0x99, 0x89, 0xcb, 0xbf, + 0x32, 0xb0, 0x91, 0x36, 0xff, 0x21, 0x67, 0xe4, 0x31, 0x23, 0x8f, 0xfb, 0x5f, 0xa8, 0x57, 0xf9, + 0x05, 0x8d, 0xd2, 0x85, 0x61, 0xff, 0xdf, 0xcb, 0xf0, 0xfd, 0xd7, 0xd9, 0xdf, 0xd7, 0x6f, 0xab, + 0xc1, 0x05, 0xa1, 0xbe, 0x3e, 0x2d, 0x88, 0x0f, 0x4f, 0x47, 0xa5, 0x7c, 0xba, 0x20, 0xb5, 0x81, + 0xee, 0xc2, 0x32, 0x65, 0x8c, 0xf8, 0x75, 0xab, 0xa4, 0x95, 0x57, 0xbe, 0xd5, 0xb3, 0xea, 0x03, + 0x8d, 0x77, 0xa3, 0x75, 0x89, 0x06, 0xc7, 0x5a, 0x7b, 0x23, 0x0d, 0x4e, 0xa4, 0xc1, 0xd9, 0xf8, + 0xa3, 0x01, 0xcb, 0xa1, 0xd2, 0xd4, 0x77, 0x92, 0x39, 0xf7, 0x3b, 0xe9, 0x81, 0xfa, 0xe4, 0x67, + 0xc4, 0x8f, 0xa2, 0xdf, 0x58, 0xd4, 0xe2, 0xf0, 0x9f, 0xfe, 0xe3, 0x86, 0x1a, 0x36, 0x6e, 0xab, + 0x83, 0x40, 0x2c, 0x4c, 0x6d, 0x5e, 0x88, 0x37, 0xd7, 0x67, 0xb2, 0x68, 0x73, 0x35, 0xde, 0xf8, + 0x53, 0x6c, 0xab, 0x73, 0x02, 0x6e, 0xc1, 0x4a, 0x8f, 0x07, 0x2c, 0x3e, 0x24, 0x16, 0xdc, 0x78, + 0x7a, 0x5e, 0x8b, 0x9d, 0xff, 0x86, 0xc5, 0x71, 0xfd, 0x7d, 0x33, 0x5b, 0x7f, 0xcd, 0xff, 0xd7, + 0xdf, 0x05, 0xaa, 0xbf, 0xe6, 0x77, 0xae, 0xbf, 0xe6, 0x5b, 0xae, 0xbf, 0xe6, 0x77, 0xaa, 0x3f, + 0x73, 0x6e, 0xfd, 0x7d, 0xf5, 0x3f, 0xab, 0xbf, 0xe6, 0x42, 0xf5, 0xe7, 0x9c, 0x59, 0x7f, 0xeb, + 0xe9, 0x8b, 0x03, 0x33, 0xba, 0x24, 0x88, 0x2b, 0xf0, 0x2f, 0x06, 0x94, 0x52, 0xfb, 0xed, 0xde, + 0x3b, 0xdf, 0x71, 0xe8, 0x9d, 0x1f, 0x4b, 0x62, 0x7f, 0xfe, 0x6e, 0xcc, 0x7c, 0x4f, 0xed, 0xde, + 0xab, 0xff, 0x98, 0xca, 0xe1, 0xfd, 0x63, 0xe9, 0xe3, 0x16, 0x9b, 0xbc, 0x55, 0xdf, 0xae, 0x4f, + 0x7d, 0x4b, 0xe1, 0x5a, 0x6c, 0x92, 0x58, 0xf4, 0xc6, 0xde, 0x3d, 0x81, 0x62, 0x7a, 0x3d, 0xaa, + 0x28, 0x07, 0xce, 0xb8, 0x55, 0x8d, 0x3b, 0x00, 0x56, 0x8e, 0x87, 0x9d, 0xd1, 0x54, 0x1d, 0xb0, + 0x18, 0x76, 0x40, 0x3d, 0xeb, 0xd9, 0x7f, 0x36, 0xa0, 0xac, 0x36, 0xfc, 0xfc, 0xd0, 0xc3, 0x92, + 0x78, 0x4f, 0x8e, 0x5d, 0x7c, 0x84, 0xae, 0x02, 0x74, 0xb9, 0x37, 0xe9, 0x74, 0x27, 0x52, 0xdf, + 0xa0, 0x1a, 0x95, 0xa2, 0x5b, 0x50, 0x92, 0xb6, 0x12, 0xa0, 0x1b, 0xb0, 0x86, 0x03, 0x39, 0xec, + 0x50, 0xd6, 0xe7, 0x11, 0x26, 0xa3, 0x31, 0x97, 0x94, 0xf8, 0x01, 0xeb, 0xf3, 0x10, 0x37, 0x7b, + 0x11, 0x6b, 0x9e, 0xb8, 0x88, 0xdd, 0x84, 0xd5, 0xe4, 0xec, 0xd2, 0xb9, 0x13, 0x5d, 0xc2, 0x16, + 0xe2, 0xd3, 0xcb, 0x1d, 0xf4, 0x03, 0x28, 0x4d, 0x9f, 0xd7, 0x6f, 0x3b, 0x4d, 0xeb, 0xe7, 0x79, + 0x8d, 0x29, 0xc6, 0x18, 0x25, 0xb4, 0xbf, 0x34, 0xe1, 0xf2, 0x8c, 0x0b, 0x6d, 0xee, 0x4d, 0xd0, + 0x6d, 0xc8, 0x8f, 0x89, 0x10, 0x78, 0x10, 0xdd, 0x01, 0xcf, 0x4b, 0xb2, 0x04, 0xa5, 0xaa, 0x7b, + 0x4c, 0xc6, 0x3c, 0xae, 0x6e, 0x35, 0x56, 0x26, 0x48, 0x3a, 0x26, 0x3c, 0x90, 0x9d, 0x21, 0xa1, + 0x83, 0xa1, 0x8c, 0x78, 0xbc, 0x14, 0x49, 0xf7, 0xb4, 0x10, 0x5d, 0x87, 0x92, 0xe0, 0x63, 0xd2, + 0x99, 0x1e, 0xc5, 0xb2, 0xfa, 0x28, 0x56, 0x54, 0xd2, 0xfd, 0xc8, 0x58, 0xb4, 0x07, 0x1f, 0xce, + 0xa2, 0x3a, 0xa7, 0x34, 0xe6, 0xdf, 0x85, 0x8d, 0xf9, 0x83, 0xf4, 0xca, 0xfd, 0xd7, 0x9b, 0x74, + 0x1b, 0x2e, 0x93, 0x63, 0x49, 0x98, 0xca, 0x91, 0x0e, 0xd7, 0xd7, 0xc9, 0xc2, 0xfa, 0x66, 0xe5, + 0x0c, 0x37, 0xcb, 0x09, 0xfe, 0x71, 0x08, 0x47, 0x4f, 0x61, 0x73, 0x66, 0xfb, 0x53, 0x14, 0xae, + 0x9d, 0xa1, 0xf0, 0x4a, 0xea, 0xcd, 0x71, 0xff, 0x35, 0xdd, 0xf6, 0x73, 0x03, 0xde, 0x4b, 0x85, + 0xa4, 0x15, 0xa5, 0x05, 0xba, 0x0b, 0xc5, 0xf0, 0x02, 0x5f, 0xe7, 0x4e, 0x1c, 0x98, 0xab, 0xd5, + 0xf0, 0x07, 0x95, 0xaa, 0x3c, 0xae, 0x46, 0x3f, 0xa8, 0x54, 0x3f, 0xd3, 0x30, 0xb5, 0xc8, 0x5d, + 0x15, 0xc9, 0x58, 0xa0, 0xca, 0xf4, 0xce, 0x4d, 0x15, 0xcd, 0xc9, 0x85, 0xbb, 0x84, 0x84, 0x77, + 0x71, 0x33, 0xd9, 0xd5, 0xd0, 0x71, 0x4b, 0x65, 0x57, 0x63, 0xd1, 0xec, 0xba, 0x19, 0x26, 0x97, + 0x4b, 0x0e, 0x89, 0x72, 0xe5, 0x73, 0xca, 0xa4, 0x4e, 0x15, 0x16, 0x8c, 0x43, 0xfb, 0xb3, 0xae, + 0x1e, 0xb7, 0xf7, 0x9e, 0xbf, 0xdc, 0x34, 0x5e, 0xbc, 0xdc, 0x34, 0xfe, 0xf1, 0x72, 0xd3, 0xf8, + 0xf2, 0xd5, 0xe6, 0xd2, 0x8b, 0x57, 0x9b, 0x4b, 0x7f, 0x7b, 0xb5, 0xb9, 0xf4, 0xb4, 0x3a, 0xa0, + 0x72, 0x18, 0x74, 0xab, 0x3d, 0x3e, 0xae, 0x45, 0x3f, 0x1d, 0x85, 0xff, 0x6e, 0x09, 0xef, 0xa0, + 0xa6, 0xea, 0x3e, 0x90, 0x74, 0x54, 0x8b, 0x1b, 0x40, 0x77, 0x59, 0x13, 0xdd, 0xf8, 0x4f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xdd, 0x4c, 0x01, 0xd9, 0xb0, 0x1a, 0x00, 0x00, } -type testServiceClient struct { - cc grpc1.ClientConn -} - -func NewTestServiceClient(cc grpc1.ClientConn) TestServiceClient { - return &testServiceClient{cc} -} - -func (c *testServiceClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { - out := new(EchoResponse) - err := c.cc.Invoke(ctx, "/testdata.TestService/Echo", in, out, opts...) +func (m *Dog) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *testServiceClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { - out := new(SayHelloResponse) - err := c.cc.Invoke(ctx, "/testdata.TestService/SayHello", in, out, opts...) - if err != nil { - return nil, err +func (m *Dog) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Dog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Size_) > 0 { + i -= len(m.Size_) + copy(dAtA[i:], m.Size_) + i = encodeVarintProto(dAtA, i, uint64(len(m.Size_))) + i-- + dAtA[i] = 0xa } - return out, nil + return len(dAtA) - i, nil } -func (c *testServiceClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) { - out := new(TestAnyResponse) - err := c.cc.Invoke(ctx, "/testdata.TestService/TestAny", in, out, opts...) +func (m *Cat) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil -} - -// TestServiceServer is the server API for TestService service. -type TestServiceServer interface { - Echo(context.Context, *EchoRequest) (*EchoResponse, error) - SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) - TestAny(context.Context, *TestAnyRequest) (*TestAnyResponse, error) -} - -// UnimplementedTestServiceServer can be embedded to have forward compatible implementations. -type UnimplementedTestServiceServer struct { -} - -func (*UnimplementedTestServiceServer) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") -} -func (*UnimplementedTestServiceServer) SayHello(ctx context.Context, req *SayHelloRequest) (*SayHelloResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") -} -func (*UnimplementedTestServiceServer) TestAny(ctx context.Context, req *TestAnyRequest) (*TestAnyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TestAny not implemented") -} - -func RegisterTestServiceServer(s grpc1.Server, srv TestServiceServer) { - s.RegisterService(&_TestService_serviceDesc, srv) -} - -func _TestService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EchoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServiceServer).Echo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/testdata.TestService/Echo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).Echo(ctx, req.(*EchoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestService_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SayHelloRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServiceServer).SayHello(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/testdata.TestService/SayHello", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).SayHello(ctx, req.(*SayHelloRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestService_TestAny_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TestAnyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServiceServer).TestAny(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/testdata.TestService/TestAny", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).TestAny(ctx, req.(*TestAnyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _TestService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "testdata.TestService", - HandlerType: (*TestServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Echo", - Handler: _TestService_Echo_Handler, - }, - { - MethodName: "SayHello", - Handler: _TestService_SayHello_Handler, - }, - { - MethodName: "TestAny", - Handler: _TestService_TestAny_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "proto.proto", -} - -func (m *Dog) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Dog) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Dog) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Size_) > 0 { - i -= len(m.Size_) - copy(dAtA[i:], m.Size_) - i = encodeVarintProto(dAtA, i, uint64(len(m.Size_))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Cat) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return dAtA[:n], nil } func (m *Cat) MarshalTo(dAtA []byte) (int, error) { @@ -3889,196 +3451,6 @@ func (m *HasHasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *EchoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EchoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EchoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintProto(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EchoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EchoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EchoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintProto(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SayHelloRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SayHelloRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SayHelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SayHelloResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SayHelloResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SayHelloResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Greeting) > 0 { - i -= len(m.Greeting) - copy(dAtA[i:], m.Greeting) - i = encodeVarintProto(dAtA, i, uint64(len(m.Greeting))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestAnyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestAnyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestAnyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AnyAnimal != nil { - { - size, err := m.AnyAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestAnyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestAnyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestAnyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HasAnimal != nil { - { - size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *TestMsg) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6608,20 +5980,20 @@ func (m *TestRepeatedUints) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.Nums) > 0 { - dAtA59 := make([]byte, len(m.Nums)*10) - var j58 int + dAtA57 := make([]byte, len(m.Nums)*10) + var j56 int for _, num := range m.Nums { for num >= 1<<7 { - dAtA59[j58] = uint8(uint64(num)&0x7f | 0x80) + dAtA57[j56] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j58++ + j56++ } - dAtA59[j58] = uint8(num) - j58++ + dAtA57[j56] = uint8(num) + j56++ } - i -= j58 - copy(dAtA[i:], dAtA59[:j58]) - i = encodeVarintProto(dAtA, i, uint64(j58)) + i -= j56 + copy(dAtA[i:], dAtA57[:j56]) + i = encodeVarintProto(dAtA, i, uint64(j56)) i-- dAtA[i] = 0xa } @@ -6714,100 +6086,22 @@ func (m *HasHasHasAnimal) Size() (n int) { return n } -func (m *EchoRequest) Size() (n int) { +func (m *TestMsg) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) + if len(m.Signers) > 0 { + for _, s := range m.Signers { + l = len(s) + n += 1 + l + sovProto(uint64(l)) + } } return n } -func (m *EchoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *SayHelloRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *SayHelloResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Greeting) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestAnyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AnyAnimal != nil { - l = m.AnyAnimal.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestAnyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HasAnimal != nil { - l = m.HasAnimal.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Signers) > 0 { - for _, s := range m.Signers { - l = len(s) - n += 1 + l + sovProto(uint64(l)) - } - } - return n -} - -func (m *BadMultiSignature) Size() (n int) { +func (m *BadMultiSignature) Size() (n int) { if m == nil { return 0 } @@ -8430,524 +7724,6 @@ func (m *HasHasHasAnimal) Unmarshal(dAtA []byte) error { } return nil } -func (m *EchoRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EchoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EchoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EchoResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EchoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EchoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SayHelloRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SayHelloRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SayHelloRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SayHelloResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SayHelloResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SayHelloResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Greeting", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Greeting = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestAnyRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestAnyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestAnyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AnyAnimal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AnyAnimal == nil { - m.AnyAnimal = &types.Any{} - } - if err := m.AnyAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestAnyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestAnyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestAnyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HasAnimal == nil { - m.HasAnimal = &HasAnimal{} - } - if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *TestMsg) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/testutil/testdata/query.pb.go b/testutil/testdata/query.pb.go new file mode 100644 index 000000000000..fc5f7af7cbae --- /dev/null +++ b/testutil/testdata/query.pb.go @@ -0,0 +1,1371 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: query.proto + +package testdata + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type EchoRequest struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *EchoRequest) Reset() { *m = EchoRequest{} } +func (m *EchoRequest) String() string { return proto.CompactTextString(m) } +func (*EchoRequest) ProtoMessage() {} +func (*EchoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{0} +} +func (m *EchoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EchoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EchoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EchoRequest.Merge(m, src) +} +func (m *EchoRequest) XXX_Size() int { + return m.Size() +} +func (m *EchoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EchoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_EchoRequest proto.InternalMessageInfo + +func (m *EchoRequest) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +type EchoResponse struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *EchoResponse) Reset() { *m = EchoResponse{} } +func (m *EchoResponse) String() string { return proto.CompactTextString(m) } +func (*EchoResponse) ProtoMessage() {} +func (*EchoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{1} +} +func (m *EchoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EchoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EchoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EchoResponse.Merge(m, src) +} +func (m *EchoResponse) XXX_Size() int { + return m.Size() +} +func (m *EchoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EchoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_EchoResponse proto.InternalMessageInfo + +func (m *EchoResponse) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +type SayHelloRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *SayHelloRequest) Reset() { *m = SayHelloRequest{} } +func (m *SayHelloRequest) String() string { return proto.CompactTextString(m) } +func (*SayHelloRequest) ProtoMessage() {} +func (*SayHelloRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{2} +} +func (m *SayHelloRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SayHelloRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SayHelloRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SayHelloRequest.Merge(m, src) +} +func (m *SayHelloRequest) XXX_Size() int { + return m.Size() +} +func (m *SayHelloRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SayHelloRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SayHelloRequest proto.InternalMessageInfo + +func (m *SayHelloRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type SayHelloResponse struct { + Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` +} + +func (m *SayHelloResponse) Reset() { *m = SayHelloResponse{} } +func (m *SayHelloResponse) String() string { return proto.CompactTextString(m) } +func (*SayHelloResponse) ProtoMessage() {} +func (*SayHelloResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{3} +} +func (m *SayHelloResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SayHelloResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SayHelloResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SayHelloResponse.Merge(m, src) +} +func (m *SayHelloResponse) XXX_Size() int { + return m.Size() +} +func (m *SayHelloResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SayHelloResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SayHelloResponse proto.InternalMessageInfo + +func (m *SayHelloResponse) GetGreeting() string { + if m != nil { + return m.Greeting + } + return "" +} + +type TestAnyRequest struct { + AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"` +} + +func (m *TestAnyRequest) Reset() { *m = TestAnyRequest{} } +func (m *TestAnyRequest) String() string { return proto.CompactTextString(m) } +func (*TestAnyRequest) ProtoMessage() {} +func (*TestAnyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{4} +} +func (m *TestAnyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestAnyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestAnyRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestAnyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestAnyRequest.Merge(m, src) +} +func (m *TestAnyRequest) XXX_Size() int { + return m.Size() +} +func (m *TestAnyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TestAnyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo + +func (m *TestAnyRequest) GetAnyAnimal() *types.Any { + if m != nil { + return m.AnyAnimal + } + return nil +} + +type TestAnyResponse struct { + HasAnimal *HasAnimal `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` +} + +func (m *TestAnyResponse) Reset() { *m = TestAnyResponse{} } +func (m *TestAnyResponse) String() string { return proto.CompactTextString(m) } +func (*TestAnyResponse) ProtoMessage() {} +func (*TestAnyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{5} +} +func (m *TestAnyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestAnyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestAnyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestAnyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestAnyResponse.Merge(m, src) +} +func (m *TestAnyResponse) XXX_Size() int { + return m.Size() +} +func (m *TestAnyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TestAnyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TestAnyResponse proto.InternalMessageInfo + +func (m *TestAnyResponse) GetHasAnimal() *HasAnimal { + if m != nil { + return m.HasAnimal + } + return nil +} + +func init() { + proto.RegisterType((*EchoRequest)(nil), "testdata.EchoRequest") + proto.RegisterType((*EchoResponse)(nil), "testdata.EchoResponse") + proto.RegisterType((*SayHelloRequest)(nil), "testdata.SayHelloRequest") + proto.RegisterType((*SayHelloResponse)(nil), "testdata.SayHelloResponse") + proto.RegisterType((*TestAnyRequest)(nil), "testdata.TestAnyRequest") + proto.RegisterType((*TestAnyResponse)(nil), "testdata.TestAnyResponse") +} + +func init() { proto.RegisterFile("query.proto", fileDescriptor_5c6ac9b241082464) } + +var fileDescriptor_5c6ac9b241082464 = []byte{ + // 359 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcf, 0x4f, 0xc2, 0x30, + 0x14, 0xc7, 0x59, 0x82, 0x02, 0x0f, 0x03, 0xa6, 0xfe, 0x08, 0xf4, 0xb0, 0x98, 0x25, 0x46, 0x2e, + 0x76, 0x09, 0xc4, 0xab, 0x09, 0x26, 0x24, 0x5c, 0x45, 0x4f, 0x5e, 0x4c, 0x81, 0xba, 0x2d, 0x6e, + 0x2d, 0xd0, 0xee, 0xb0, 0xff, 0xc2, 0x7f, 0xc9, 0x9b, 0x47, 0x8e, 0x1e, 0x0d, 0xfc, 0x23, 0x66, + 0x5b, 0xbb, 0x09, 0x21, 0x9e, 0xda, 0xd7, 0x7e, 0xde, 0xe7, 0xe5, 0x7d, 0xa1, 0xb9, 0x8c, 0xd9, + 0x2a, 0x21, 0x8b, 0x95, 0x50, 0x02, 0xd5, 0x15, 0x93, 0x6a, 0x4e, 0x15, 0xc5, 0x5d, 0x4f, 0x08, + 0x2f, 0x64, 0x6e, 0xf6, 0x3e, 0x8d, 0xdf, 0x5c, 0xca, 0x35, 0x84, 0x5b, 0x06, 0xca, 0x6b, 0xe7, + 0x06, 0x9a, 0xa3, 0x99, 0x2f, 0x26, 0x6c, 0x19, 0x33, 0xa9, 0x50, 0x07, 0x6a, 0x11, 0x93, 0x92, + 0x7a, 0xac, 0x63, 0x5d, 0x59, 0xbd, 0xc6, 0xc4, 0x94, 0x4e, 0x0f, 0x4e, 0x72, 0x50, 0x2e, 0x04, + 0x97, 0xec, 0x1f, 0xf2, 0x1a, 0xda, 0x4f, 0x34, 0x19, 0xb3, 0x30, 0x2c, 0xb4, 0x08, 0xaa, 0x9c, + 0x46, 0x86, 0xcc, 0xee, 0x0e, 0x81, 0xd3, 0x12, 0xd3, 0x52, 0x0c, 0x75, 0x6f, 0xc5, 0x98, 0x0a, + 0xb8, 0xa7, 0xd9, 0xa2, 0x76, 0x46, 0xd0, 0x7a, 0x66, 0x52, 0x0d, 0x79, 0x62, 0xac, 0x03, 0x00, + 0xca, 0x93, 0x57, 0xca, 0x83, 0x88, 0x86, 0x19, 0xdf, 0xec, 0x9f, 0x93, 0x7c, 0x77, 0x62, 0x76, + 0x27, 0x69, 0x43, 0x83, 0xf2, 0x64, 0x98, 0x61, 0xce, 0x08, 0xda, 0x85, 0x46, 0x4f, 0xed, 0x03, + 0xf8, 0x54, 0xee, 0x7a, 0xce, 0x48, 0x11, 0xd4, 0x98, 0xca, 0xbc, 0x77, 0xd2, 0xf0, 0xcd, 0xb5, + 0xff, 0x69, 0xc1, 0xd1, 0x63, 0x1a, 0x3e, 0xba, 0x83, 0x6a, 0x1a, 0x0c, 0xba, 0x28, 0x3b, 0xfe, + 0x24, 0x8a, 0x2f, 0xf7, 0x9f, 0xf5, 0xd0, 0x21, 0xd4, 0xcd, 0xfa, 0xa8, 0x5b, 0x32, 0x7b, 0xc9, + 0x61, 0x7c, 0xe8, 0x4b, 0x2b, 0xee, 0xa1, 0xa6, 0x57, 0x41, 0x9d, 0x12, 0xdb, 0x0d, 0x09, 0x77, + 0x0f, 0xfc, 0xe4, 0xfd, 0x0f, 0xe3, 0xaf, 0x8d, 0x6d, 0xad, 0x37, 0xb6, 0xf5, 0xb3, 0xb1, 0xad, + 0x8f, 0xad, 0x5d, 0x59, 0x6f, 0xed, 0xca, 0xf7, 0xd6, 0xae, 0xbc, 0x10, 0x2f, 0x50, 0x7e, 0x3c, + 0x25, 0x33, 0x11, 0xb9, 0x33, 0x21, 0x23, 0x21, 0xf5, 0x71, 0x2b, 0xe7, 0xef, 0x6e, 0x2a, 0x8c, + 0x55, 0x10, 0xba, 0xc6, 0x3c, 0x3d, 0xce, 0xd2, 0x1e, 0xfc, 0x06, 0x00, 0x00, 0xff, 0xff, 0xe8, + 0xb4, 0x42, 0x4e, 0x90, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) + SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) + TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { + out := new(EchoResponse) + err := c.cc.Invoke(ctx, "/testdata.Query/Echo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { + out := new(SayHelloResponse) + err := c.cc.Invoke(ctx, "/testdata.Query/SayHello", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) { + out := new(TestAnyResponse) + err := c.cc.Invoke(ctx, "/testdata.Query/TestAny", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Echo(context.Context, *EchoRequest) (*EchoResponse, error) + SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) + TestAny(context.Context, *TestAnyRequest) (*TestAnyResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") +} +func (*UnimplementedQueryServer) SayHello(ctx context.Context, req *SayHelloRequest) (*SayHelloResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") +} +func (*UnimplementedQueryServer) TestAny(ctx context.Context, req *TestAnyRequest) (*TestAnyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestAny not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EchoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Echo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Query/Echo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Echo(ctx, req.(*EchoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SayHelloRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SayHello(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Query/SayHello", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SayHello(ctx, req.(*SayHelloRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TestAny_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TestAnyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TestAny(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Query/TestAny", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TestAny(ctx, req.(*TestAnyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "testdata.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Echo", + Handler: _Query_Echo_Handler, + }, + { + MethodName: "SayHello", + Handler: _Query_SayHello_Handler, + }, + { + MethodName: "TestAny", + Handler: _Query_TestAny_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "query.proto", +} + +func (m *EchoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EchoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EchoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EchoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EchoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EchoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SayHelloRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SayHelloRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SayHelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SayHelloResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SayHelloResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SayHelloResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Greeting) > 0 { + i -= len(m.Greeting) + copy(dAtA[i:], m.Greeting) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Greeting))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestAnyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestAnyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestAnyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AnyAnimal != nil { + { + size, err := m.AnyAnimal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestAnyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestAnyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestAnyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HasAnimal != nil { + { + size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EchoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *EchoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *SayHelloRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *SayHelloResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Greeting) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *TestAnyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AnyAnimal != nil { + l = m.AnyAnimal.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *TestAnyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HasAnimal != nil { + l = m.HasAnimal.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EchoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EchoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EchoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EchoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EchoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EchoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SayHelloRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SayHelloRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SayHelloRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SayHelloResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SayHelloResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SayHelloResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Greeting", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Greeting = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestAnyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestAnyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestAnyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AnyAnimal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AnyAnimal == nil { + m.AnyAnimal = &types.Any{} + } + if err := m.AnyAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestAnyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestAnyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestAnyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HasAnimal == nil { + m.HasAnimal = &HasAnimal{} + } + if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/testdata/query.proto b/testutil/testdata/query.proto new file mode 100644 index 000000000000..0090b4fca856 --- /dev/null +++ b/testutil/testdata/query.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package testdata; + +import "google/protobuf/any.proto"; +import "testdata.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata"; + +// Query tests the protobuf Query service as defined in +// https://github.com/cosmos/cosmos-sdk/issues/5921. +service Query { + rpc Echo(EchoRequest) returns (EchoResponse); + rpc SayHello(SayHelloRequest) returns (SayHelloResponse); + rpc TestAny(TestAnyRequest) returns (TestAnyResponse); +} + +message EchoRequest { + string message = 1; +} + +message EchoResponse { + string message = 1; +} + +message SayHelloRequest { + string name = 1; +} + +message SayHelloResponse { + string greeting = 1; +} + +message TestAnyRequest { + google.protobuf.Any any_animal = 1; +} + +message TestAnyResponse { + testdata.HasAnimal has_animal = 1; +} diff --git a/testutil/testdata/testdata.pb.go b/testutil/testdata/testdata.pb.go new file mode 100644 index 000000000000..3c5b44e7a464 --- /dev/null +++ b/testutil/testdata/testdata.pb.go @@ -0,0 +1,1412 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: testdata.proto + +package testdata + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Dog struct { + Size_ string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *Dog) Reset() { *m = Dog{} } +func (m *Dog) String() string { return proto.CompactTextString(m) } +func (*Dog) ProtoMessage() {} +func (*Dog) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{0} +} +func (m *Dog) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Dog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Dog.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Dog) XXX_Merge(src proto.Message) { + xxx_messageInfo_Dog.Merge(m, src) +} +func (m *Dog) XXX_Size() int { + return m.Size() +} +func (m *Dog) XXX_DiscardUnknown() { + xxx_messageInfo_Dog.DiscardUnknown(m) +} + +var xxx_messageInfo_Dog proto.InternalMessageInfo + +func (m *Dog) GetSize_() string { + if m != nil { + return m.Size_ + } + return "" +} + +func (m *Dog) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type Cat struct { + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + Lives int32 `protobuf:"varint,2,opt,name=lives,proto3" json:"lives,omitempty"` +} + +func (m *Cat) Reset() { *m = Cat{} } +func (m *Cat) String() string { return proto.CompactTextString(m) } +func (*Cat) ProtoMessage() {} +func (*Cat) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{1} +} +func (m *Cat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Cat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Cat.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Cat) XXX_Merge(src proto.Message) { + xxx_messageInfo_Cat.Merge(m, src) +} +func (m *Cat) XXX_Size() int { + return m.Size() +} +func (m *Cat) XXX_DiscardUnknown() { + xxx_messageInfo_Cat.DiscardUnknown(m) +} + +var xxx_messageInfo_Cat proto.InternalMessageInfo + +func (m *Cat) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *Cat) GetLives() int32 { + if m != nil { + return m.Lives + } + return 0 +} + +type HasAnimal struct { + Animal *types.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"` + X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` +} + +func (m *HasAnimal) Reset() { *m = HasAnimal{} } +func (m *HasAnimal) String() string { return proto.CompactTextString(m) } +func (*HasAnimal) ProtoMessage() {} +func (*HasAnimal) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{2} +} +func (m *HasAnimal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HasAnimal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HasAnimal) XXX_Merge(src proto.Message) { + xxx_messageInfo_HasAnimal.Merge(m, src) +} +func (m *HasAnimal) XXX_Size() int { + return m.Size() +} +func (m *HasAnimal) XXX_DiscardUnknown() { + xxx_messageInfo_HasAnimal.DiscardUnknown(m) +} + +var xxx_messageInfo_HasAnimal proto.InternalMessageInfo + +func (m *HasAnimal) GetAnimal() *types.Any { + if m != nil { + return m.Animal + } + return nil +} + +func (m *HasAnimal) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +type HasHasAnimal struct { + HasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` +} + +func (m *HasHasAnimal) Reset() { *m = HasHasAnimal{} } +func (m *HasHasAnimal) String() string { return proto.CompactTextString(m) } +func (*HasHasAnimal) ProtoMessage() {} +func (*HasHasAnimal) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{3} +} +func (m *HasHasAnimal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HasHasAnimal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HasHasAnimal) XXX_Merge(src proto.Message) { + xxx_messageInfo_HasHasAnimal.Merge(m, src) +} +func (m *HasHasAnimal) XXX_Size() int { + return m.Size() +} +func (m *HasHasAnimal) XXX_DiscardUnknown() { + xxx_messageInfo_HasHasAnimal.DiscardUnknown(m) +} + +var xxx_messageInfo_HasHasAnimal proto.InternalMessageInfo + +func (m *HasHasAnimal) GetHasAnimal() *types.Any { + if m != nil { + return m.HasAnimal + } + return nil +} + +type HasHasHasAnimal struct { + HasHasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` +} + +func (m *HasHasHasAnimal) Reset() { *m = HasHasHasAnimal{} } +func (m *HasHasHasAnimal) String() string { return proto.CompactTextString(m) } +func (*HasHasHasAnimal) ProtoMessage() {} +func (*HasHasHasAnimal) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{4} +} +func (m *HasHasHasAnimal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HasHasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HasHasHasAnimal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HasHasHasAnimal) XXX_Merge(src proto.Message) { + xxx_messageInfo_HasHasHasAnimal.Merge(m, src) +} +func (m *HasHasHasAnimal) XXX_Size() int { + return m.Size() +} +func (m *HasHasHasAnimal) XXX_DiscardUnknown() { + xxx_messageInfo_HasHasHasAnimal.DiscardUnknown(m) +} + +var xxx_messageInfo_HasHasHasAnimal proto.InternalMessageInfo + +func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any { + if m != nil { + return m.HasHasAnimal + } + return nil +} + +// bad MultiSignature with extra fields +type BadMultiSignature struct { + Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` + MaliciousField []byte `protobuf:"bytes,5,opt,name=malicious_field,json=maliciousField,proto3" json:"malicious_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *BadMultiSignature) Reset() { *m = BadMultiSignature{} } +func (m *BadMultiSignature) String() string { return proto.CompactTextString(m) } +func (*BadMultiSignature) ProtoMessage() {} +func (*BadMultiSignature) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{5} +} +func (m *BadMultiSignature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BadMultiSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BadMultiSignature.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BadMultiSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_BadMultiSignature.Merge(m, src) +} +func (m *BadMultiSignature) XXX_Size() int { + return m.Size() +} +func (m *BadMultiSignature) XXX_DiscardUnknown() { + xxx_messageInfo_BadMultiSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_BadMultiSignature proto.InternalMessageInfo + +func (m *BadMultiSignature) GetSignatures() [][]byte { + if m != nil { + return m.Signatures + } + return nil +} + +func (m *BadMultiSignature) GetMaliciousField() []byte { + if m != nil { + return m.MaliciousField + } + return nil +} + +func init() { + proto.RegisterType((*Dog)(nil), "testdata.Dog") + proto.RegisterType((*Cat)(nil), "testdata.Cat") + proto.RegisterType((*HasAnimal)(nil), "testdata.HasAnimal") + proto.RegisterType((*HasHasAnimal)(nil), "testdata.HasHasAnimal") + proto.RegisterType((*HasHasHasAnimal)(nil), "testdata.HasHasHasAnimal") + proto.RegisterType((*BadMultiSignature)(nil), "testdata.BadMultiSignature") +} + +func init() { proto.RegisterFile("testdata.proto", fileDescriptor_40c4782d007dfce9) } + +var fileDescriptor_40c4782d007dfce9 = []byte{ + // 365 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x4f, 0xc2, 0x40, + 0x18, 0x86, 0x39, 0x0b, 0x28, 0x9f, 0x0d, 0xc4, 0x0b, 0x43, 0x65, 0xa8, 0xa4, 0x8b, 0x0c, 0xd2, + 0x26, 0x12, 0x17, 0x36, 0xc0, 0x28, 0x0b, 0x4b, 0xdd, 0x5c, 0xc8, 0x95, 0x1e, 0xed, 0x85, 0xb6, + 0x67, 0xb8, 0xab, 0x01, 0x7f, 0x85, 0x7f, 0xc1, 0x7f, 0xe3, 0xc8, 0xe8, 0x68, 0xe0, 0x8f, 0x98, + 0x5e, 0xa9, 0x30, 0x32, 0xf5, 0x7d, 0xdf, 0xaf, 0xef, 0x93, 0xef, 0x92, 0x0f, 0xea, 0x92, 0x0a, + 0xe9, 0x13, 0x49, 0xec, 0xb7, 0x25, 0x97, 0x1c, 0x5f, 0x14, 0xbe, 0xd5, 0x0c, 0x78, 0xc0, 0x55, + 0xe8, 0x64, 0x2a, 0x9f, 0xb7, 0xae, 0x03, 0xce, 0x83, 0x88, 0x3a, 0xca, 0x79, 0xe9, 0xdc, 0x21, + 0xc9, 0x3a, 0x1f, 0x59, 0x5d, 0xd0, 0x1e, 0x79, 0x80, 0x31, 0x94, 0x05, 0xfb, 0xa0, 0x06, 0x6a, + 0xa3, 0x4e, 0xcd, 0x55, 0x3a, 0xcb, 0x12, 0x12, 0x53, 0xe3, 0x2c, 0xcf, 0x32, 0x6d, 0x3d, 0x80, + 0x36, 0x22, 0x12, 0x1b, 0x70, 0x1e, 0xf3, 0x84, 0x2d, 0xe8, 0x72, 0xdf, 0x28, 0x2c, 0x6e, 0x42, + 0x25, 0x62, 0xef, 0x54, 0xa8, 0x56, 0xc5, 0xcd, 0x8d, 0xf5, 0x0c, 0xb5, 0x31, 0x11, 0x83, 0x84, + 0xc5, 0x24, 0xc2, 0x77, 0x50, 0x25, 0x4a, 0xa9, 0xee, 0xe5, 0x7d, 0xd3, 0xce, 0xd7, 0xb3, 0x8b, + 0xf5, 0xec, 0x41, 0xb2, 0x76, 0xf7, 0xff, 0x60, 0x1d, 0xd0, 0x4a, 0xc1, 0x34, 0x17, 0xad, 0xac, + 0x11, 0xe8, 0x63, 0x22, 0x0e, 0xac, 0x1e, 0x40, 0x48, 0xc4, 0xf4, 0x04, 0x5e, 0x2d, 0x2c, 0x4a, + 0xd6, 0x04, 0x1a, 0x39, 0xe4, 0xc0, 0xe9, 0x43, 0x3d, 0xe3, 0x9c, 0xc8, 0xd2, 0xc3, 0xa3, 0xae, + 0xe5, 0xc1, 0xd5, 0x90, 0xf8, 0x93, 0x34, 0x92, 0xec, 0x85, 0x05, 0x09, 0x91, 0xe9, 0x92, 0x62, + 0x13, 0x40, 0x14, 0x46, 0x18, 0xa8, 0xad, 0x75, 0x74, 0xf7, 0x28, 0xc1, 0xb7, 0xd0, 0x88, 0x49, + 0xc4, 0x66, 0x8c, 0xa7, 0x62, 0x3a, 0x67, 0x34, 0xf2, 0x8d, 0x4a, 0x1b, 0x75, 0x74, 0xb7, 0xfe, + 0x1f, 0x3f, 0x65, 0x69, 0xbf, 0xbc, 0xf9, 0xba, 0x41, 0xc3, 0xf1, 0xf7, 0xd6, 0x44, 0x9b, 0xad, + 0x89, 0x7e, 0xb7, 0x26, 0xfa, 0xdc, 0x99, 0xa5, 0xcd, 0xce, 0x2c, 0xfd, 0xec, 0xcc, 0xd2, 0xab, + 0x1d, 0x30, 0x19, 0xa6, 0x9e, 0x3d, 0xe3, 0xb1, 0x33, 0xe3, 0x22, 0xe6, 0x62, 0xff, 0xe9, 0x0a, + 0x7f, 0xe1, 0x64, 0x87, 0x91, 0x4a, 0x16, 0x39, 0xc5, 0x85, 0x78, 0x55, 0xf5, 0x92, 0xde, 0x5f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x51, 0x62, 0x40, 0x44, 0x02, 0x00, 0x00, +} + +func (m *Dog) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Dog) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Dog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Size_) > 0 { + i -= len(m.Size_) + copy(dAtA[i:], m.Size_) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.Size_))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Cat) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Cat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Cat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Lives != 0 { + i = encodeVarintTestdata(dAtA, i, uint64(m.Lives)) + i-- + dAtA[i] = 0x10 + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HasAnimal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HasAnimal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.X != 0 { + i = encodeVarintTestdata(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x10 + } + if m.Animal != nil { + { + size, err := m.Animal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTestdata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HasHasAnimal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HasHasAnimal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HasAnimal != nil { + { + size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTestdata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HasHasHasAnimal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HasHasHasAnimal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HasHasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HasHasAnimal != nil { + { + size, err := m.HasHasAnimal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTestdata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BadMultiSignature) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BadMultiSignature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BadMultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.MaliciousField) > 0 { + i -= len(m.MaliciousField) + copy(dAtA[i:], m.MaliciousField) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.MaliciousField))) + i-- + dAtA[i] = 0x2a + } + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signatures[iNdEx]) + copy(dAtA[i:], m.Signatures[iNdEx]) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.Signatures[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintTestdata(dAtA []byte, offset int, v uint64) int { + offset -= sovTestdata(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Dog) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Size_) + if l > 0 { + n += 1 + l + sovTestdata(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTestdata(uint64(l)) + } + return n +} + +func (m *Cat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovTestdata(uint64(l)) + } + if m.Lives != 0 { + n += 1 + sovTestdata(uint64(m.Lives)) + } + return n +} + +func (m *HasAnimal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Animal != nil { + l = m.Animal.Size() + n += 1 + l + sovTestdata(uint64(l)) + } + if m.X != 0 { + n += 1 + sovTestdata(uint64(m.X)) + } + return n +} + +func (m *HasHasAnimal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HasAnimal != nil { + l = m.HasAnimal.Size() + n += 1 + l + sovTestdata(uint64(l)) + } + return n +} + +func (m *HasHasHasAnimal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HasHasAnimal != nil { + l = m.HasHasAnimal.Size() + n += 1 + l + sovTestdata(uint64(l)) + } + return n +} + +func (m *BadMultiSignature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Signatures) > 0 { + for _, b := range m.Signatures { + l = len(b) + n += 1 + l + sovTestdata(uint64(l)) + } + } + l = len(m.MaliciousField) + if l > 0 { + n += 1 + l + sovTestdata(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovTestdata(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTestdata(x uint64) (n int) { + return sovTestdata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Dog) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Dog: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Dog: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Size_ = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Cat) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Cat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Cat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Lives", wireType) + } + m.Lives = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Lives |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HasAnimal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HasAnimal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Animal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Animal == nil { + m.Animal = &types.Any{} + } + if err := m.Animal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HasHasAnimal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HasHasAnimal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HasAnimal == nil { + m.HasAnimal = &types.Any{} + } + if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HasHasHasAnimal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HasHasHasAnimal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HasHasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HasHasAnimal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HasHasAnimal == nil { + m.HasHasAnimal = &types.Any{} + } + if err := m.HasHasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BadMultiSignature) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BadMultiSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BadMultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) + copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaliciousField", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MaliciousField = append(m.MaliciousField[:0], dAtA[iNdEx:postIndex]...) + if m.MaliciousField == nil { + m.MaliciousField = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTestdata(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTestdata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTestdata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTestdata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTestdata + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTestdata + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTestdata + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTestdata = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTestdata = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTestdata = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/testdata/testdata.proto b/testutil/testdata/testdata.proto new file mode 100644 index 000000000000..585c2303c139 --- /dev/null +++ b/testutil/testdata/testdata.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package testdata; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata"; + +message Dog { + string size = 1; + string name = 2; +} + +message Cat { + string moniker = 1; + int32 lives = 2; +} + +message HasAnimal { + google.protobuf.Any animal = 1; + int64 x = 2; +} + +message HasHasAnimal { + google.protobuf.Any has_animal = 1; +} + +message HasHasHasAnimal { + google.protobuf.Any has_has_animal = 1; +} + +// bad MultiSignature with extra fields +message BadMultiSignature { + option (gogoproto.goproto_unrecognized) = true; + repeated bytes signatures = 1; + bytes malicious_field = 5; +} diff --git a/testutil/testdata/tx.pb.go b/testutil/testdata/tx.pb.go new file mode 100644 index 000000000000..3b0530fe4617 --- /dev/null +++ b/testutil/testdata/tx.pb.go @@ -0,0 +1,764 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: tx.proto + +package testdata + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgCreateDog struct { + Dog *Dog `protobuf:"bytes,1,opt,name=dog,proto3" json:"dog,omitempty"` +} + +func (m *MsgCreateDog) Reset() { *m = MsgCreateDog{} } +func (m *MsgCreateDog) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDog) ProtoMessage() {} +func (*MsgCreateDog) Descriptor() ([]byte, []int) { + return fileDescriptor_0fd2153dc07d3b5c, []int{0} +} +func (m *MsgCreateDog) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDog.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDog) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDog.Merge(m, src) +} +func (m *MsgCreateDog) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDog) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDog.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDog proto.InternalMessageInfo + +func (m *MsgCreateDog) GetDog() *Dog { + if m != nil { + return m.Dog + } + return nil +} + +type MsgCreateDogResponse struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *MsgCreateDogResponse) Reset() { *m = MsgCreateDogResponse{} } +func (m *MsgCreateDogResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDogResponse) ProtoMessage() {} +func (*MsgCreateDogResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0fd2153dc07d3b5c, []int{1} +} +func (m *MsgCreateDogResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDogResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDogResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDogResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDogResponse.Merge(m, src) +} +func (m *MsgCreateDogResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDogResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDogResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDogResponse proto.InternalMessageInfo + +func (m *MsgCreateDogResponse) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// TestMsg is msg type for testing protobuf message using any, as defined in +// https://github.com/cosmos/cosmos-sdk/issues/6213. +type TestMsg struct { + Signers []string `protobuf:"bytes,1,rep,name=signers,proto3" json:"signers,omitempty"` +} + +func (m *TestMsg) Reset() { *m = TestMsg{} } +func (m *TestMsg) String() string { return proto.CompactTextString(m) } +func (*TestMsg) ProtoMessage() {} +func (*TestMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_0fd2153dc07d3b5c, []int{2} +} +func (m *TestMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestMsg.Merge(m, src) +} +func (m *TestMsg) XXX_Size() int { + return m.Size() +} +func (m *TestMsg) XXX_DiscardUnknown() { + xxx_messageInfo_TestMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_TestMsg proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateDog)(nil), "testdata.MsgCreateDog") + proto.RegisterType((*MsgCreateDogResponse)(nil), "testdata.MsgCreateDogResponse") + proto.RegisterType((*TestMsg)(nil), "testdata.TestMsg") +} + +func init() { proto.RegisterFile("tx.proto", fileDescriptor_0fd2153dc07d3b5c) } + +var fileDescriptor_0fd2153dc07d3b5c = []byte{ + // 258 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x28, 0xa9, 0xd0, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x28, 0x49, 0x2d, 0x2e, 0x49, 0x49, 0x2c, 0x49, 0x94, 0x12, + 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x0b, 0xea, 0x83, 0x58, 0x10, 0x79, 0x29, 0x3e, 0x98, 0x3c, 0x84, + 0xaf, 0xa4, 0xcf, 0xc5, 0xe3, 0x5b, 0x9c, 0xee, 0x5c, 0x94, 0x9a, 0x58, 0x92, 0xea, 0x92, 0x9f, + 0x2e, 0x24, 0xcf, 0xc5, 0x9c, 0x92, 0x9f, 0x2e, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xc4, 0xab, + 0x07, 0x57, 0xed, 0x92, 0x9f, 0x1e, 0x04, 0x92, 0x51, 0xd2, 0xe2, 0x12, 0x41, 0xd6, 0x10, 0x94, + 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0x24, 0xc4, 0xc5, 0x92, 0x97, 0x98, 0x9b, 0x0a, 0xd6, + 0xc9, 0x19, 0x04, 0x66, 0x2b, 0x69, 0x72, 0xb1, 0x87, 0xa4, 0x16, 0x97, 0xf8, 0x16, 0xa7, 0x0b, + 0x49, 0x70, 0xb1, 0x17, 0x67, 0xa6, 0xe7, 0xa5, 0x16, 0x15, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, + 0x06, 0xc1, 0xb8, 0x56, 0x2c, 0x1d, 0x0b, 0xe4, 0x19, 0x8c, 0xbc, 0xb8, 0x98, 0x41, 0xca, 0x9c, + 0xb9, 0x38, 0x11, 0x6e, 0x11, 0x43, 0x58, 0x8f, 0x6c, 0xa5, 0x94, 0x1c, 0x76, 0x71, 0x98, 0x53, + 0x9c, 0x3c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, + 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x2f, 0x3d, 0xb3, + 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x39, 0xbf, 0x38, 0x37, 0xbf, 0x18, 0x4a, + 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x83, 0x4c, 0x2d, 0x2d, 0xc9, 0xcc, 0xd1, 0x87, 0x19, 0x9f, 0xc4, + 0x06, 0x0e, 0x24, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x15, 0x63, 0x9a, 0x1b, 0x60, 0x01, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + CreateDog(ctx context.Context, in *MsgCreateDog, opts ...grpc.CallOption) (*MsgCreateDogResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateDog(ctx context.Context, in *MsgCreateDog, opts ...grpc.CallOption) (*MsgCreateDogResponse, error) { + out := new(MsgCreateDogResponse) + err := c.cc.Invoke(ctx, "/testdata.Msg/CreateDog", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + CreateDog(context.Context, *MsgCreateDog) (*MsgCreateDogResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateDog(ctx context.Context, req *MsgCreateDog) (*MsgCreateDogResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDog not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateDog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateDog) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateDog(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Msg/CreateDog", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateDog(ctx, req.(*MsgCreateDog)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "testdata.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateDog", + Handler: _Msg_CreateDog_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "tx.proto", +} + +func (m *MsgCreateDog) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDog) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Dog != nil { + { + size, err := m.Dog.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateDogResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDogResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDogResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestMsg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signers) > 0 { + for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signers[iNdEx]) + copy(dAtA[i:], m.Signers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signers[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateDog) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Dog != nil { + l = m.Dog.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateDogResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *TestMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Signers) > 0 { + for _, s := range m.Signers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateDog) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateDog: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDog: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dog", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Dog == nil { + m.Dog = &Dog{} + } + if err := m.Dog.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateDogResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateDogResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDogResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/testdata/tx.proto b/testutil/testdata/tx.proto new file mode 100644 index 000000000000..8f670fc50ef5 --- /dev/null +++ b/testutil/testdata/tx.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package testdata; + +import "gogoproto/gogo.proto"; +import "testdata.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata"; + +// Msg tests the Protobuf message service as defined in +// https://github.com/cosmos/cosmos-sdk/issues/7500. +service Msg { + rpc CreateDog(MsgCreateDog) returns (MsgCreateDogResponse); +} + +message MsgCreateDog { + testdata.Dog dog = 1; +} + +message MsgCreateDogResponse { + string name = 1; +} + +// TestMsg is msg type for testing protobuf message using any, as defined in +// https://github.com/cosmos/cosmos-sdk/issues/6213. +message TestMsg { + option (gogoproto.goproto_getters) = false; + repeated string signers = 1; +} diff --git a/testutil/testdata/unknonwnproto.pb.go b/testutil/testdata/unknonwnproto.pb.go new file mode 100644 index 000000000000..b8a5425e873a --- /dev/null +++ b/testutil/testdata/unknonwnproto.pb.go @@ -0,0 +1,13229 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: unknonwnproto.proto + +package testdata + +import ( + encoding_binary "encoding/binary" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + tx "github.com/cosmos/cosmos-sdk/types/tx" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Customer2_City int32 + +const ( + Customer2_Laos Customer2_City = 0 + Customer2_LosAngeles Customer2_City = 1 + Customer2_PaloAlto Customer2_City = 2 + Customer2_Moscow Customer2_City = 3 + Customer2_Nairobi Customer2_City = 4 +) + +var Customer2_City_name = map[int32]string{ + 0: "Laos", + 1: "LosAngeles", + 2: "PaloAlto", + 3: "Moscow", + 4: "Nairobi", +} + +var Customer2_City_value = map[string]int32{ + "Laos": 0, + "LosAngeles": 1, + "PaloAlto": 2, + "Moscow": 3, + "Nairobi": 4, +} + +func (x Customer2_City) String() string { + return proto.EnumName(Customer2_City_name, int32(x)) +} + +func (Customer2_City) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{1, 0} +} + +type Customer1 struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + SubscriptionFee float32 `protobuf:"fixed32,3,opt,name=subscription_fee,json=subscriptionFee,proto3" json:"subscription_fee,omitempty"` + Payment string `protobuf:"bytes,7,opt,name=payment,proto3" json:"payment,omitempty"` +} + +func (m *Customer1) Reset() { *m = Customer1{} } +func (m *Customer1) String() string { return proto.CompactTextString(m) } +func (*Customer1) ProtoMessage() {} +func (*Customer1) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{0} +} +func (m *Customer1) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Customer1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Customer1.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Customer1) XXX_Merge(src proto.Message) { + xxx_messageInfo_Customer1.Merge(m, src) +} +func (m *Customer1) XXX_Size() int { + return m.Size() +} +func (m *Customer1) XXX_DiscardUnknown() { + xxx_messageInfo_Customer1.DiscardUnknown(m) +} + +var xxx_messageInfo_Customer1 proto.InternalMessageInfo + +func (m *Customer1) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Customer1) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Customer1) GetSubscriptionFee() float32 { + if m != nil { + return m.SubscriptionFee + } + return 0 +} + +func (m *Customer1) GetPayment() string { + if m != nil { + return m.Payment + } + return "" +} + +type Customer2 struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Industry int32 `protobuf:"varint,2,opt,name=industry,proto3" json:"industry,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Fewer float32 `protobuf:"fixed32,4,opt,name=fewer,proto3" json:"fewer,omitempty"` + Reserved int64 `protobuf:"varint,1047,opt,name=reserved,proto3" json:"reserved,omitempty"` + City Customer2_City `protobuf:"varint,6,opt,name=city,proto3,enum=testdata.Customer2_City" json:"city,omitempty"` + Miscellaneous *types.Any `protobuf:"bytes,10,opt,name=miscellaneous,proto3" json:"miscellaneous,omitempty"` +} + +func (m *Customer2) Reset() { *m = Customer2{} } +func (m *Customer2) String() string { return proto.CompactTextString(m) } +func (*Customer2) ProtoMessage() {} +func (*Customer2) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{1} +} +func (m *Customer2) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Customer2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Customer2.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Customer2) XXX_Merge(src proto.Message) { + xxx_messageInfo_Customer2.Merge(m, src) +} +func (m *Customer2) XXX_Size() int { + return m.Size() +} +func (m *Customer2) XXX_DiscardUnknown() { + xxx_messageInfo_Customer2.DiscardUnknown(m) +} + +var xxx_messageInfo_Customer2 proto.InternalMessageInfo + +func (m *Customer2) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Customer2) GetIndustry() int32 { + if m != nil { + return m.Industry + } + return 0 +} + +func (m *Customer2) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Customer2) GetFewer() float32 { + if m != nil { + return m.Fewer + } + return 0 +} + +func (m *Customer2) GetReserved() int64 { + if m != nil { + return m.Reserved + } + return 0 +} + +func (m *Customer2) GetCity() Customer2_City { + if m != nil { + return m.City + } + return Customer2_Laos +} + +func (m *Customer2) GetMiscellaneous() *types.Any { + if m != nil { + return m.Miscellaneous + } + return nil +} + +type Nested4A struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *Nested4A) Reset() { *m = Nested4A{} } +func (m *Nested4A) String() string { return proto.CompactTextString(m) } +func (*Nested4A) ProtoMessage() {} +func (*Nested4A) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{2} +} +func (m *Nested4A) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nested4A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nested4A.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Nested4A) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested4A.Merge(m, src) +} +func (m *Nested4A) XXX_Size() int { + return m.Size() +} +func (m *Nested4A) XXX_DiscardUnknown() { + xxx_messageInfo_Nested4A.DiscardUnknown(m) +} + +var xxx_messageInfo_Nested4A proto.InternalMessageInfo + +func (m *Nested4A) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Nested4A) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type Nested3A struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + A4 []*Nested4A `protobuf:"bytes,4,rep,name=a4,proto3" json:"a4,omitempty"` + Index map[int64]*Nested4A `protobuf:"bytes,5,rep,name=index,proto3" json:"index,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *Nested3A) Reset() { *m = Nested3A{} } +func (m *Nested3A) String() string { return proto.CompactTextString(m) } +func (*Nested3A) ProtoMessage() {} +func (*Nested3A) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{3} +} +func (m *Nested3A) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nested3A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nested3A.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Nested3A) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested3A.Merge(m, src) +} +func (m *Nested3A) XXX_Size() int { + return m.Size() +} +func (m *Nested3A) XXX_DiscardUnknown() { + xxx_messageInfo_Nested3A.DiscardUnknown(m) +} + +var xxx_messageInfo_Nested3A proto.InternalMessageInfo + +func (m *Nested3A) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Nested3A) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Nested3A) GetA4() []*Nested4A { + if m != nil { + return m.A4 + } + return nil +} + +func (m *Nested3A) GetIndex() map[int64]*Nested4A { + if m != nil { + return m.Index + } + return nil +} + +type Nested2A struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Nested *Nested3A `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"` +} + +func (m *Nested2A) Reset() { *m = Nested2A{} } +func (m *Nested2A) String() string { return proto.CompactTextString(m) } +func (*Nested2A) ProtoMessage() {} +func (*Nested2A) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{4} +} +func (m *Nested2A) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nested2A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nested2A.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Nested2A) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested2A.Merge(m, src) +} +func (m *Nested2A) XXX_Size() int { + return m.Size() +} +func (m *Nested2A) XXX_DiscardUnknown() { + xxx_messageInfo_Nested2A.DiscardUnknown(m) +} + +var xxx_messageInfo_Nested2A proto.InternalMessageInfo + +func (m *Nested2A) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Nested2A) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Nested2A) GetNested() *Nested3A { + if m != nil { + return m.Nested + } + return nil +} + +type Nested1A struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Nested *Nested2A `protobuf:"bytes,2,opt,name=nested,proto3" json:"nested,omitempty"` +} + +func (m *Nested1A) Reset() { *m = Nested1A{} } +func (m *Nested1A) String() string { return proto.CompactTextString(m) } +func (*Nested1A) ProtoMessage() {} +func (*Nested1A) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{5} +} +func (m *Nested1A) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nested1A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nested1A.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Nested1A) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested1A.Merge(m, src) +} +func (m *Nested1A) XXX_Size() int { + return m.Size() +} +func (m *Nested1A) XXX_DiscardUnknown() { + xxx_messageInfo_Nested1A.DiscardUnknown(m) +} + +var xxx_messageInfo_Nested1A proto.InternalMessageInfo + +func (m *Nested1A) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Nested1A) GetNested() *Nested2A { + if m != nil { + return m.Nested + } + return nil +} + +type Nested4B struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *Nested4B) Reset() { *m = Nested4B{} } +func (m *Nested4B) String() string { return proto.CompactTextString(m) } +func (*Nested4B) ProtoMessage() {} +func (*Nested4B) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{6} +} +func (m *Nested4B) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nested4B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nested4B.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Nested4B) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested4B.Merge(m, src) +} +func (m *Nested4B) XXX_Size() int { + return m.Size() +} +func (m *Nested4B) XXX_DiscardUnknown() { + xxx_messageInfo_Nested4B.DiscardUnknown(m) +} + +var xxx_messageInfo_Nested4B proto.InternalMessageInfo + +func (m *Nested4B) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Nested4B) GetAge() int32 { + if m != nil { + return m.Age + } + return 0 +} + +func (m *Nested4B) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type Nested3B struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + B4 []*Nested4B `protobuf:"bytes,4,rep,name=b4,proto3" json:"b4,omitempty"` +} + +func (m *Nested3B) Reset() { *m = Nested3B{} } +func (m *Nested3B) String() string { return proto.CompactTextString(m) } +func (*Nested3B) ProtoMessage() {} +func (*Nested3B) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{7} +} +func (m *Nested3B) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nested3B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nested3B.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Nested3B) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested3B.Merge(m, src) +} +func (m *Nested3B) XXX_Size() int { + return m.Size() +} +func (m *Nested3B) XXX_DiscardUnknown() { + xxx_messageInfo_Nested3B.DiscardUnknown(m) +} + +var xxx_messageInfo_Nested3B proto.InternalMessageInfo + +func (m *Nested3B) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Nested3B) GetAge() int32 { + if m != nil { + return m.Age + } + return 0 +} + +func (m *Nested3B) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Nested3B) GetB4() []*Nested4B { + if m != nil { + return m.B4 + } + return nil +} + +type Nested2B struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Fee float64 `protobuf:"fixed64,2,opt,name=fee,proto3" json:"fee,omitempty"` + Nested *Nested3B `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"` + Route string `protobuf:"bytes,4,opt,name=route,proto3" json:"route,omitempty"` +} + +func (m *Nested2B) Reset() { *m = Nested2B{} } +func (m *Nested2B) String() string { return proto.CompactTextString(m) } +func (*Nested2B) ProtoMessage() {} +func (*Nested2B) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{8} +} +func (m *Nested2B) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nested2B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nested2B.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Nested2B) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested2B.Merge(m, src) +} +func (m *Nested2B) XXX_Size() int { + return m.Size() +} +func (m *Nested2B) XXX_DiscardUnknown() { + xxx_messageInfo_Nested2B.DiscardUnknown(m) +} + +var xxx_messageInfo_Nested2B proto.InternalMessageInfo + +func (m *Nested2B) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Nested2B) GetFee() float64 { + if m != nil { + return m.Fee + } + return 0 +} + +func (m *Nested2B) GetNested() *Nested3B { + if m != nil { + return m.Nested + } + return nil +} + +func (m *Nested2B) GetRoute() string { + if m != nil { + return m.Route + } + return "" +} + +type Nested1B struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Nested *Nested2B `protobuf:"bytes,2,opt,name=nested,proto3" json:"nested,omitempty"` + Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` +} + +func (m *Nested1B) Reset() { *m = Nested1B{} } +func (m *Nested1B) String() string { return proto.CompactTextString(m) } +func (*Nested1B) ProtoMessage() {} +func (*Nested1B) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{9} +} +func (m *Nested1B) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nested1B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nested1B.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Nested1B) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested1B.Merge(m, src) +} +func (m *Nested1B) XXX_Size() int { + return m.Size() +} +func (m *Nested1B) XXX_DiscardUnknown() { + xxx_messageInfo_Nested1B.DiscardUnknown(m) +} + +var xxx_messageInfo_Nested1B proto.InternalMessageInfo + +func (m *Nested1B) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Nested1B) GetNested() *Nested2B { + if m != nil { + return m.Nested + } + return nil +} + +func (m *Nested1B) GetAge() int32 { + if m != nil { + return m.Age + } + return 0 +} + +type Customer3 struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Sf float32 `protobuf:"fixed32,3,opt,name=sf,proto3" json:"sf,omitempty"` + Surcharge float32 `protobuf:"fixed32,4,opt,name=surcharge,proto3" json:"surcharge,omitempty"` + Destination string `protobuf:"bytes,5,opt,name=destination,proto3" json:"destination,omitempty"` + // Types that are valid to be assigned to Payment: + // *Customer3_CreditCardNo + // *Customer3_ChequeNo + Payment isCustomer3_Payment `protobuf_oneof:"payment"` + Original *Customer1 `protobuf:"bytes,9,opt,name=original,proto3" json:"original,omitempty"` +} + +func (m *Customer3) Reset() { *m = Customer3{} } +func (m *Customer3) String() string { return proto.CompactTextString(m) } +func (*Customer3) ProtoMessage() {} +func (*Customer3) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{10} +} +func (m *Customer3) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Customer3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Customer3.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Customer3) XXX_Merge(src proto.Message) { + xxx_messageInfo_Customer3.Merge(m, src) +} +func (m *Customer3) XXX_Size() int { + return m.Size() +} +func (m *Customer3) XXX_DiscardUnknown() { + xxx_messageInfo_Customer3.DiscardUnknown(m) +} + +var xxx_messageInfo_Customer3 proto.InternalMessageInfo + +type isCustomer3_Payment interface { + isCustomer3_Payment() + MarshalTo([]byte) (int, error) + Size() int +} + +type Customer3_CreditCardNo struct { + CreditCardNo string `protobuf:"bytes,7,opt,name=credit_card_no,json=creditCardNo,proto3,oneof" json:"credit_card_no,omitempty"` +} +type Customer3_ChequeNo struct { + ChequeNo string `protobuf:"bytes,8,opt,name=cheque_no,json=chequeNo,proto3,oneof" json:"cheque_no,omitempty"` +} + +func (*Customer3_CreditCardNo) isCustomer3_Payment() {} +func (*Customer3_ChequeNo) isCustomer3_Payment() {} + +func (m *Customer3) GetPayment() isCustomer3_Payment { + if m != nil { + return m.Payment + } + return nil +} + +func (m *Customer3) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Customer3) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Customer3) GetSf() float32 { + if m != nil { + return m.Sf + } + return 0 +} + +func (m *Customer3) GetSurcharge() float32 { + if m != nil { + return m.Surcharge + } + return 0 +} + +func (m *Customer3) GetDestination() string { + if m != nil { + return m.Destination + } + return "" +} + +func (m *Customer3) GetCreditCardNo() string { + if x, ok := m.GetPayment().(*Customer3_CreditCardNo); ok { + return x.CreditCardNo + } + return "" +} + +func (m *Customer3) GetChequeNo() string { + if x, ok := m.GetPayment().(*Customer3_ChequeNo); ok { + return x.ChequeNo + } + return "" +} + +func (m *Customer3) GetOriginal() *Customer1 { + if m != nil { + return m.Original + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Customer3) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Customer3_CreditCardNo)(nil), + (*Customer3_ChequeNo)(nil), + } +} + +type TestVersion1 struct { + X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` + B *TestVersion1 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` + C []*TestVersion1 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` + D []TestVersion1 `protobuf:"bytes,5,rep,name=d,proto3" json:"d"` + // Types that are valid to be assigned to Sum: + // *TestVersion1_E + // *TestVersion1_F + Sum isTestVersion1_Sum `protobuf_oneof:"sum"` + G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` + // google.protobuf.Timestamp i = 10; + // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; + *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` +} + +func (m *TestVersion1) Reset() { *m = TestVersion1{} } +func (m *TestVersion1) String() string { return proto.CompactTextString(m) } +func (*TestVersion1) ProtoMessage() {} +func (*TestVersion1) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{11} +} +func (m *TestVersion1) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion1.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion1) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion1.Merge(m, src) +} +func (m *TestVersion1) XXX_Size() int { + return m.Size() +} +func (m *TestVersion1) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion1.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion1 proto.InternalMessageInfo + +type isTestVersion1_Sum interface { + isTestVersion1_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type TestVersion1_E struct { + E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` +} +type TestVersion1_F struct { + F *TestVersion1 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` +} + +func (*TestVersion1_E) isTestVersion1_Sum() {} +func (*TestVersion1_F) isTestVersion1_Sum() {} + +func (m *TestVersion1) GetSum() isTestVersion1_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *TestVersion1) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +func (m *TestVersion1) GetA() *TestVersion1 { + if m != nil { + return m.A + } + return nil +} + +func (m *TestVersion1) GetB() *TestVersion1 { + if m != nil { + return m.B + } + return nil +} + +func (m *TestVersion1) GetC() []*TestVersion1 { + if m != nil { + return m.C + } + return nil +} + +func (m *TestVersion1) GetD() []TestVersion1 { + if m != nil { + return m.D + } + return nil +} + +func (m *TestVersion1) GetE() int32 { + if x, ok := m.GetSum().(*TestVersion1_E); ok { + return x.E + } + return 0 +} + +func (m *TestVersion1) GetF() *TestVersion1 { + if x, ok := m.GetSum().(*TestVersion1_F); ok { + return x.F + } + return nil +} + +func (m *TestVersion1) GetG() *types.Any { + if m != nil { + return m.G + } + return nil +} + +func (m *TestVersion1) GetH() []*TestVersion1 { + if m != nil { + return m.H + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion1) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion1_E)(nil), + (*TestVersion1_F)(nil), + } +} + +type TestVersion2 struct { + X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + A *TestVersion2 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` + B *TestVersion2 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` + C []*TestVersion2 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` + D []*TestVersion2 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` + // Types that are valid to be assigned to Sum: + // *TestVersion2_E + // *TestVersion2_F + Sum isTestVersion2_Sum `protobuf_oneof:"sum"` + G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` + // google.protobuf.Timestamp i = 10; + // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; + *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` + NewField uint64 `protobuf:"varint,25,opt,name=new_field,json=newField,proto3" json:"new_field,omitempty"` +} + +func (m *TestVersion2) Reset() { *m = TestVersion2{} } +func (m *TestVersion2) String() string { return proto.CompactTextString(m) } +func (*TestVersion2) ProtoMessage() {} +func (*TestVersion2) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{12} +} +func (m *TestVersion2) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion2.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion2) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion2.Merge(m, src) +} +func (m *TestVersion2) XXX_Size() int { + return m.Size() +} +func (m *TestVersion2) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion2.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion2 proto.InternalMessageInfo + +type isTestVersion2_Sum interface { + isTestVersion2_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type TestVersion2_E struct { + E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` +} +type TestVersion2_F struct { + F *TestVersion2 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` +} + +func (*TestVersion2_E) isTestVersion2_Sum() {} +func (*TestVersion2_F) isTestVersion2_Sum() {} + +func (m *TestVersion2) GetSum() isTestVersion2_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *TestVersion2) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +func (m *TestVersion2) GetA() *TestVersion2 { + if m != nil { + return m.A + } + return nil +} + +func (m *TestVersion2) GetB() *TestVersion2 { + if m != nil { + return m.B + } + return nil +} + +func (m *TestVersion2) GetC() []*TestVersion2 { + if m != nil { + return m.C + } + return nil +} + +func (m *TestVersion2) GetD() []*TestVersion2 { + if m != nil { + return m.D + } + return nil +} + +func (m *TestVersion2) GetE() int32 { + if x, ok := m.GetSum().(*TestVersion2_E); ok { + return x.E + } + return 0 +} + +func (m *TestVersion2) GetF() *TestVersion2 { + if x, ok := m.GetSum().(*TestVersion2_F); ok { + return x.F + } + return nil +} + +func (m *TestVersion2) GetG() *types.Any { + if m != nil { + return m.G + } + return nil +} + +func (m *TestVersion2) GetH() []*TestVersion1 { + if m != nil { + return m.H + } + return nil +} + +func (m *TestVersion2) GetNewField() uint64 { + if m != nil { + return m.NewField + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion2) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion2_E)(nil), + (*TestVersion2_F)(nil), + } +} + +type TestVersion3 struct { + X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + A *TestVersion3 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` + B *TestVersion3 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` + C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` + D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` + // Types that are valid to be assigned to Sum: + // *TestVersion3_E + // *TestVersion3_F + Sum isTestVersion3_Sum `protobuf_oneof:"sum"` + G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` + // google.protobuf.Timestamp i = 10; + // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; + *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` + NonCriticalField string `protobuf:"bytes,1031,opt,name=non_critical_field,json=nonCriticalField,proto3" json:"non_critical_field,omitempty"` +} + +func (m *TestVersion3) Reset() { *m = TestVersion3{} } +func (m *TestVersion3) String() string { return proto.CompactTextString(m) } +func (*TestVersion3) ProtoMessage() {} +func (*TestVersion3) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{13} +} +func (m *TestVersion3) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion3.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion3) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3.Merge(m, src) +} +func (m *TestVersion3) XXX_Size() int { + return m.Size() +} +func (m *TestVersion3) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion3 proto.InternalMessageInfo + +type isTestVersion3_Sum interface { + isTestVersion3_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type TestVersion3_E struct { + E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` +} +type TestVersion3_F struct { + F *TestVersion3 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` +} + +func (*TestVersion3_E) isTestVersion3_Sum() {} +func (*TestVersion3_F) isTestVersion3_Sum() {} + +func (m *TestVersion3) GetSum() isTestVersion3_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *TestVersion3) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +func (m *TestVersion3) GetA() *TestVersion3 { + if m != nil { + return m.A + } + return nil +} + +func (m *TestVersion3) GetB() *TestVersion3 { + if m != nil { + return m.B + } + return nil +} + +func (m *TestVersion3) GetC() []*TestVersion3 { + if m != nil { + return m.C + } + return nil +} + +func (m *TestVersion3) GetD() []*TestVersion3 { + if m != nil { + return m.D + } + return nil +} + +func (m *TestVersion3) GetE() int32 { + if x, ok := m.GetSum().(*TestVersion3_E); ok { + return x.E + } + return 0 +} + +func (m *TestVersion3) GetF() *TestVersion3 { + if x, ok := m.GetSum().(*TestVersion3_F); ok { + return x.F + } + return nil +} + +func (m *TestVersion3) GetG() *types.Any { + if m != nil { + return m.G + } + return nil +} + +func (m *TestVersion3) GetH() []*TestVersion1 { + if m != nil { + return m.H + } + return nil +} + +func (m *TestVersion3) GetNonCriticalField() string { + if m != nil { + return m.NonCriticalField + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion3) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion3_E)(nil), + (*TestVersion3_F)(nil), + } +} + +type TestVersion3LoneOneOfValue struct { + X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + A *TestVersion3 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` + B *TestVersion3 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` + C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` + D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` + // Types that are valid to be assigned to Sum: + // *TestVersion3LoneOneOfValue_E + Sum isTestVersion3LoneOneOfValue_Sum `protobuf_oneof:"sum"` + G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` + // google.protobuf.Timestamp i = 10; + // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; + *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` + NonCriticalField string `protobuf:"bytes,1031,opt,name=non_critical_field,json=nonCriticalField,proto3" json:"non_critical_field,omitempty"` +} + +func (m *TestVersion3LoneOneOfValue) Reset() { *m = TestVersion3LoneOneOfValue{} } +func (m *TestVersion3LoneOneOfValue) String() string { return proto.CompactTextString(m) } +func (*TestVersion3LoneOneOfValue) ProtoMessage() {} +func (*TestVersion3LoneOneOfValue) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{14} +} +func (m *TestVersion3LoneOneOfValue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion3LoneOneOfValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion3LoneOneOfValue.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion3LoneOneOfValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneOneOfValue.Merge(m, src) +} +func (m *TestVersion3LoneOneOfValue) XXX_Size() int { + return m.Size() +} +func (m *TestVersion3LoneOneOfValue) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneOneOfValue.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion3LoneOneOfValue proto.InternalMessageInfo + +type isTestVersion3LoneOneOfValue_Sum interface { + isTestVersion3LoneOneOfValue_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type TestVersion3LoneOneOfValue_E struct { + E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` +} + +func (*TestVersion3LoneOneOfValue_E) isTestVersion3LoneOneOfValue_Sum() {} + +func (m *TestVersion3LoneOneOfValue) GetSum() isTestVersion3LoneOneOfValue_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *TestVersion3LoneOneOfValue) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +func (m *TestVersion3LoneOneOfValue) GetA() *TestVersion3 { + if m != nil { + return m.A + } + return nil +} + +func (m *TestVersion3LoneOneOfValue) GetB() *TestVersion3 { + if m != nil { + return m.B + } + return nil +} + +func (m *TestVersion3LoneOneOfValue) GetC() []*TestVersion3 { + if m != nil { + return m.C + } + return nil +} + +func (m *TestVersion3LoneOneOfValue) GetD() []*TestVersion3 { + if m != nil { + return m.D + } + return nil +} + +func (m *TestVersion3LoneOneOfValue) GetE() int32 { + if x, ok := m.GetSum().(*TestVersion3LoneOneOfValue_E); ok { + return x.E + } + return 0 +} + +func (m *TestVersion3LoneOneOfValue) GetG() *types.Any { + if m != nil { + return m.G + } + return nil +} + +func (m *TestVersion3LoneOneOfValue) GetH() []*TestVersion1 { + if m != nil { + return m.H + } + return nil +} + +func (m *TestVersion3LoneOneOfValue) GetNonCriticalField() string { + if m != nil { + return m.NonCriticalField + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion3LoneOneOfValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion3LoneOneOfValue_E)(nil), + } +} + +type TestVersion3LoneNesting struct { + X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + A *TestVersion3 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` + B *TestVersion3 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` + C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` + D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` + // Types that are valid to be assigned to Sum: + // *TestVersion3LoneNesting_F + Sum isTestVersion3LoneNesting_Sum `protobuf_oneof:"sum"` + G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` + // google.protobuf.Timestamp i = 10; + // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; + *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` + NonCriticalField string `protobuf:"bytes,1031,opt,name=non_critical_field,json=nonCriticalField,proto3" json:"non_critical_field,omitempty"` + Inner1 *TestVersion3LoneNesting_Inner1 `protobuf:"bytes,14,opt,name=inner1,proto3" json:"inner1,omitempty"` + Inner2 *TestVersion3LoneNesting_Inner2 `protobuf:"bytes,15,opt,name=inner2,proto3" json:"inner2,omitempty"` +} + +func (m *TestVersion3LoneNesting) Reset() { *m = TestVersion3LoneNesting{} } +func (m *TestVersion3LoneNesting) String() string { return proto.CompactTextString(m) } +func (*TestVersion3LoneNesting) ProtoMessage() {} +func (*TestVersion3LoneNesting) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{15} +} +func (m *TestVersion3LoneNesting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion3LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion3LoneNesting.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion3LoneNesting) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneNesting.Merge(m, src) +} +func (m *TestVersion3LoneNesting) XXX_Size() int { + return m.Size() +} +func (m *TestVersion3LoneNesting) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneNesting.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion3LoneNesting proto.InternalMessageInfo + +type isTestVersion3LoneNesting_Sum interface { + isTestVersion3LoneNesting_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type TestVersion3LoneNesting_F struct { + F *TestVersion3LoneNesting `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` +} + +func (*TestVersion3LoneNesting_F) isTestVersion3LoneNesting_Sum() {} + +func (m *TestVersion3LoneNesting) GetSum() isTestVersion3LoneNesting_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *TestVersion3LoneNesting) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +func (m *TestVersion3LoneNesting) GetA() *TestVersion3 { + if m != nil { + return m.A + } + return nil +} + +func (m *TestVersion3LoneNesting) GetB() *TestVersion3 { + if m != nil { + return m.B + } + return nil +} + +func (m *TestVersion3LoneNesting) GetC() []*TestVersion3 { + if m != nil { + return m.C + } + return nil +} + +func (m *TestVersion3LoneNesting) GetD() []*TestVersion3 { + if m != nil { + return m.D + } + return nil +} + +func (m *TestVersion3LoneNesting) GetF() *TestVersion3LoneNesting { + if x, ok := m.GetSum().(*TestVersion3LoneNesting_F); ok { + return x.F + } + return nil +} + +func (m *TestVersion3LoneNesting) GetG() *types.Any { + if m != nil { + return m.G + } + return nil +} + +func (m *TestVersion3LoneNesting) GetH() []*TestVersion1 { + if m != nil { + return m.H + } + return nil +} + +func (m *TestVersion3LoneNesting) GetNonCriticalField() string { + if m != nil { + return m.NonCriticalField + } + return "" +} + +func (m *TestVersion3LoneNesting) GetInner1() *TestVersion3LoneNesting_Inner1 { + if m != nil { + return m.Inner1 + } + return nil +} + +func (m *TestVersion3LoneNesting) GetInner2() *TestVersion3LoneNesting_Inner2 { + if m != nil { + return m.Inner2 + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion3LoneNesting) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion3LoneNesting_F)(nil), + } +} + +type TestVersion3LoneNesting_Inner1 struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Inner *TestVersion3LoneNesting_Inner1_InnerInner `protobuf:"bytes,3,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *TestVersion3LoneNesting_Inner1) Reset() { *m = TestVersion3LoneNesting_Inner1{} } +func (m *TestVersion3LoneNesting_Inner1) String() string { return proto.CompactTextString(m) } +func (*TestVersion3LoneNesting_Inner1) ProtoMessage() {} +func (*TestVersion3LoneNesting_Inner1) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{15, 0} +} +func (m *TestVersion3LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion3LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion3LoneNesting_Inner1.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion3LoneNesting_Inner1) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneNesting_Inner1.Merge(m, src) +} +func (m *TestVersion3LoneNesting_Inner1) XXX_Size() int { + return m.Size() +} +func (m *TestVersion3LoneNesting_Inner1) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneNesting_Inner1.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion3LoneNesting_Inner1 proto.InternalMessageInfo + +func (m *TestVersion3LoneNesting_Inner1) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *TestVersion3LoneNesting_Inner1) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TestVersion3LoneNesting_Inner1) GetInner() *TestVersion3LoneNesting_Inner1_InnerInner { + if m != nil { + return m.Inner + } + return nil +} + +type TestVersion3LoneNesting_Inner1_InnerInner struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` +} + +func (m *TestVersion3LoneNesting_Inner1_InnerInner) Reset() { + *m = TestVersion3LoneNesting_Inner1_InnerInner{} +} +func (m *TestVersion3LoneNesting_Inner1_InnerInner) String() string { + return proto.CompactTextString(m) +} +func (*TestVersion3LoneNesting_Inner1_InnerInner) ProtoMessage() {} +func (*TestVersion3LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{15, 0, 0} +} +func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.Merge(m, src) +} +func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Size() int { + return m.Size() +} +func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner proto.InternalMessageInfo + +func (m *TestVersion3LoneNesting_Inner1_InnerInner) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *TestVersion3LoneNesting_Inner1_InnerInner) GetCity() string { + if m != nil { + return m.City + } + return "" +} + +type TestVersion3LoneNesting_Inner2 struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` + Inner *TestVersion3LoneNesting_Inner2_InnerInner `protobuf:"bytes,3,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *TestVersion3LoneNesting_Inner2) Reset() { *m = TestVersion3LoneNesting_Inner2{} } +func (m *TestVersion3LoneNesting_Inner2) String() string { return proto.CompactTextString(m) } +func (*TestVersion3LoneNesting_Inner2) ProtoMessage() {} +func (*TestVersion3LoneNesting_Inner2) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{15, 1} +} +func (m *TestVersion3LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion3LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion3LoneNesting_Inner2.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion3LoneNesting_Inner2) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneNesting_Inner2.Merge(m, src) +} +func (m *TestVersion3LoneNesting_Inner2) XXX_Size() int { + return m.Size() +} +func (m *TestVersion3LoneNesting_Inner2) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneNesting_Inner2.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion3LoneNesting_Inner2 proto.InternalMessageInfo + +func (m *TestVersion3LoneNesting_Inner2) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *TestVersion3LoneNesting_Inner2) GetCountry() string { + if m != nil { + return m.Country + } + return "" +} + +func (m *TestVersion3LoneNesting_Inner2) GetInner() *TestVersion3LoneNesting_Inner2_InnerInner { + if m != nil { + return m.Inner + } + return nil +} + +type TestVersion3LoneNesting_Inner2_InnerInner struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` +} + +func (m *TestVersion3LoneNesting_Inner2_InnerInner) Reset() { + *m = TestVersion3LoneNesting_Inner2_InnerInner{} +} +func (m *TestVersion3LoneNesting_Inner2_InnerInner) String() string { + return proto.CompactTextString(m) +} +func (*TestVersion3LoneNesting_Inner2_InnerInner) ProtoMessage() {} +func (*TestVersion3LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{15, 1, 0} +} +func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion3LoneNesting_Inner2_InnerInner.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneNesting_Inner2_InnerInner.Merge(m, src) +} +func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Size() int { + return m.Size() +} +func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneNesting_Inner2_InnerInner.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion3LoneNesting_Inner2_InnerInner proto.InternalMessageInfo + +func (m *TestVersion3LoneNesting_Inner2_InnerInner) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *TestVersion3LoneNesting_Inner2_InnerInner) GetCity() string { + if m != nil { + return m.City + } + return "" +} + +type TestVersion4LoneNesting struct { + X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + A *TestVersion3 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` + B *TestVersion3 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` + C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` + D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` + // Types that are valid to be assigned to Sum: + // *TestVersion4LoneNesting_F + Sum isTestVersion4LoneNesting_Sum `protobuf_oneof:"sum"` + G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` + // google.protobuf.Timestamp i = 10; + // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; + *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` + NonCriticalField string `protobuf:"bytes,1031,opt,name=non_critical_field,json=nonCriticalField,proto3" json:"non_critical_field,omitempty"` + Inner1 *TestVersion4LoneNesting_Inner1 `protobuf:"bytes,14,opt,name=inner1,proto3" json:"inner1,omitempty"` + Inner2 *TestVersion4LoneNesting_Inner2 `protobuf:"bytes,15,opt,name=inner2,proto3" json:"inner2,omitempty"` +} + +func (m *TestVersion4LoneNesting) Reset() { *m = TestVersion4LoneNesting{} } +func (m *TestVersion4LoneNesting) String() string { return proto.CompactTextString(m) } +func (*TestVersion4LoneNesting) ProtoMessage() {} +func (*TestVersion4LoneNesting) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{16} +} +func (m *TestVersion4LoneNesting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion4LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion4LoneNesting.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion4LoneNesting) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting.Merge(m, src) +} +func (m *TestVersion4LoneNesting) XXX_Size() int { + return m.Size() +} +func (m *TestVersion4LoneNesting) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion4LoneNesting proto.InternalMessageInfo + +type isTestVersion4LoneNesting_Sum interface { + isTestVersion4LoneNesting_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type TestVersion4LoneNesting_F struct { + F *TestVersion3LoneNesting `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` +} + +func (*TestVersion4LoneNesting_F) isTestVersion4LoneNesting_Sum() {} + +func (m *TestVersion4LoneNesting) GetSum() isTestVersion4LoneNesting_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *TestVersion4LoneNesting) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +func (m *TestVersion4LoneNesting) GetA() *TestVersion3 { + if m != nil { + return m.A + } + return nil +} + +func (m *TestVersion4LoneNesting) GetB() *TestVersion3 { + if m != nil { + return m.B + } + return nil +} + +func (m *TestVersion4LoneNesting) GetC() []*TestVersion3 { + if m != nil { + return m.C + } + return nil +} + +func (m *TestVersion4LoneNesting) GetD() []*TestVersion3 { + if m != nil { + return m.D + } + return nil +} + +func (m *TestVersion4LoneNesting) GetF() *TestVersion3LoneNesting { + if x, ok := m.GetSum().(*TestVersion4LoneNesting_F); ok { + return x.F + } + return nil +} + +func (m *TestVersion4LoneNesting) GetG() *types.Any { + if m != nil { + return m.G + } + return nil +} + +func (m *TestVersion4LoneNesting) GetH() []*TestVersion1 { + if m != nil { + return m.H + } + return nil +} + +func (m *TestVersion4LoneNesting) GetNonCriticalField() string { + if m != nil { + return m.NonCriticalField + } + return "" +} + +func (m *TestVersion4LoneNesting) GetInner1() *TestVersion4LoneNesting_Inner1 { + if m != nil { + return m.Inner1 + } + return nil +} + +func (m *TestVersion4LoneNesting) GetInner2() *TestVersion4LoneNesting_Inner2 { + if m != nil { + return m.Inner2 + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion4LoneNesting) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion4LoneNesting_F)(nil), + } +} + +type TestVersion4LoneNesting_Inner1 struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Inner *TestVersion4LoneNesting_Inner1_InnerInner `protobuf:"bytes,3,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *TestVersion4LoneNesting_Inner1) Reset() { *m = TestVersion4LoneNesting_Inner1{} } +func (m *TestVersion4LoneNesting_Inner1) String() string { return proto.CompactTextString(m) } +func (*TestVersion4LoneNesting_Inner1) ProtoMessage() {} +func (*TestVersion4LoneNesting_Inner1) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{16, 0} +} +func (m *TestVersion4LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion4LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion4LoneNesting_Inner1.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion4LoneNesting_Inner1) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting_Inner1.Merge(m, src) +} +func (m *TestVersion4LoneNesting_Inner1) XXX_Size() int { + return m.Size() +} +func (m *TestVersion4LoneNesting_Inner1) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting_Inner1.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion4LoneNesting_Inner1 proto.InternalMessageInfo + +func (m *TestVersion4LoneNesting_Inner1) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *TestVersion4LoneNesting_Inner1) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TestVersion4LoneNesting_Inner1) GetInner() *TestVersion4LoneNesting_Inner1_InnerInner { + if m != nil { + return m.Inner + } + return nil +} + +type TestVersion4LoneNesting_Inner1_InnerInner struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` +} + +func (m *TestVersion4LoneNesting_Inner1_InnerInner) Reset() { + *m = TestVersion4LoneNesting_Inner1_InnerInner{} +} +func (m *TestVersion4LoneNesting_Inner1_InnerInner) String() string { + return proto.CompactTextString(m) +} +func (*TestVersion4LoneNesting_Inner1_InnerInner) ProtoMessage() {} +func (*TestVersion4LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{16, 0, 0} +} +func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.Merge(m, src) +} +func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Size() int { + return m.Size() +} +func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner proto.InternalMessageInfo + +func (m *TestVersion4LoneNesting_Inner1_InnerInner) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *TestVersion4LoneNesting_Inner1_InnerInner) GetCity() string { + if m != nil { + return m.City + } + return "" +} + +type TestVersion4LoneNesting_Inner2 struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` + Inner *TestVersion4LoneNesting_Inner2_InnerInner `protobuf:"bytes,3,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *TestVersion4LoneNesting_Inner2) Reset() { *m = TestVersion4LoneNesting_Inner2{} } +func (m *TestVersion4LoneNesting_Inner2) String() string { return proto.CompactTextString(m) } +func (*TestVersion4LoneNesting_Inner2) ProtoMessage() {} +func (*TestVersion4LoneNesting_Inner2) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{16, 1} +} +func (m *TestVersion4LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion4LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion4LoneNesting_Inner2.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion4LoneNesting_Inner2) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting_Inner2.Merge(m, src) +} +func (m *TestVersion4LoneNesting_Inner2) XXX_Size() int { + return m.Size() +} +func (m *TestVersion4LoneNesting_Inner2) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting_Inner2.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion4LoneNesting_Inner2 proto.InternalMessageInfo + +func (m *TestVersion4LoneNesting_Inner2) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *TestVersion4LoneNesting_Inner2) GetCountry() string { + if m != nil { + return m.Country + } + return "" +} + +func (m *TestVersion4LoneNesting_Inner2) GetInner() *TestVersion4LoneNesting_Inner2_InnerInner { + if m != nil { + return m.Inner + } + return nil +} + +type TestVersion4LoneNesting_Inner2_InnerInner struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *TestVersion4LoneNesting_Inner2_InnerInner) Reset() { + *m = TestVersion4LoneNesting_Inner2_InnerInner{} +} +func (m *TestVersion4LoneNesting_Inner2_InnerInner) String() string { + return proto.CompactTextString(m) +} +func (*TestVersion4LoneNesting_Inner2_InnerInner) ProtoMessage() {} +func (*TestVersion4LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{16, 1, 0} +} +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.Merge(m, src) +} +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Size() int { + return m.Size() +} +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner proto.InternalMessageInfo + +func (m *TestVersion4LoneNesting_Inner2_InnerInner) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *TestVersion4LoneNesting_Inner2_InnerInner) GetValue() int64 { + if m != nil { + return m.Value + } + return 0 +} + +type TestVersionFD1 struct { + X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` + // Types that are valid to be assigned to Sum: + // *TestVersionFD1_E + // *TestVersionFD1_F + Sum isTestVersionFD1_Sum `protobuf_oneof:"sum"` + G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` +} + +func (m *TestVersionFD1) Reset() { *m = TestVersionFD1{} } +func (m *TestVersionFD1) String() string { return proto.CompactTextString(m) } +func (*TestVersionFD1) ProtoMessage() {} +func (*TestVersionFD1) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{17} +} +func (m *TestVersionFD1) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersionFD1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersionFD1.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersionFD1) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersionFD1.Merge(m, src) +} +func (m *TestVersionFD1) XXX_Size() int { + return m.Size() +} +func (m *TestVersionFD1) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersionFD1.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersionFD1 proto.InternalMessageInfo + +type isTestVersionFD1_Sum interface { + isTestVersionFD1_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type TestVersionFD1_E struct { + E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` +} +type TestVersionFD1_F struct { + F *TestVersion1 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` +} + +func (*TestVersionFD1_E) isTestVersionFD1_Sum() {} +func (*TestVersionFD1_F) isTestVersionFD1_Sum() {} + +func (m *TestVersionFD1) GetSum() isTestVersionFD1_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *TestVersionFD1) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +func (m *TestVersionFD1) GetA() *TestVersion1 { + if m != nil { + return m.A + } + return nil +} + +func (m *TestVersionFD1) GetE() int32 { + if x, ok := m.GetSum().(*TestVersionFD1_E); ok { + return x.E + } + return 0 +} + +func (m *TestVersionFD1) GetF() *TestVersion1 { + if x, ok := m.GetSum().(*TestVersionFD1_F); ok { + return x.F + } + return nil +} + +func (m *TestVersionFD1) GetG() *types.Any { + if m != nil { + return m.G + } + return nil +} + +func (m *TestVersionFD1) GetH() []*TestVersion1 { + if m != nil { + return m.H + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersionFD1) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersionFD1_E)(nil), + (*TestVersionFD1_F)(nil), + } +} + +type TestVersionFD1WithExtraAny struct { + X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` + // Types that are valid to be assigned to Sum: + // *TestVersionFD1WithExtraAny_E + // *TestVersionFD1WithExtraAny_F + Sum isTestVersionFD1WithExtraAny_Sum `protobuf_oneof:"sum"` + G *AnyWithExtra `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` +} + +func (m *TestVersionFD1WithExtraAny) Reset() { *m = TestVersionFD1WithExtraAny{} } +func (m *TestVersionFD1WithExtraAny) String() string { return proto.CompactTextString(m) } +func (*TestVersionFD1WithExtraAny) ProtoMessage() {} +func (*TestVersionFD1WithExtraAny) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{18} +} +func (m *TestVersionFD1WithExtraAny) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestVersionFD1WithExtraAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestVersionFD1WithExtraAny.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestVersionFD1WithExtraAny) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersionFD1WithExtraAny.Merge(m, src) +} +func (m *TestVersionFD1WithExtraAny) XXX_Size() int { + return m.Size() +} +func (m *TestVersionFD1WithExtraAny) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersionFD1WithExtraAny.DiscardUnknown(m) +} + +var xxx_messageInfo_TestVersionFD1WithExtraAny proto.InternalMessageInfo + +type isTestVersionFD1WithExtraAny_Sum interface { + isTestVersionFD1WithExtraAny_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type TestVersionFD1WithExtraAny_E struct { + E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` +} +type TestVersionFD1WithExtraAny_F struct { + F *TestVersion1 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` +} + +func (*TestVersionFD1WithExtraAny_E) isTestVersionFD1WithExtraAny_Sum() {} +func (*TestVersionFD1WithExtraAny_F) isTestVersionFD1WithExtraAny_Sum() {} + +func (m *TestVersionFD1WithExtraAny) GetSum() isTestVersionFD1WithExtraAny_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *TestVersionFD1WithExtraAny) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +func (m *TestVersionFD1WithExtraAny) GetA() *TestVersion1 { + if m != nil { + return m.A + } + return nil +} + +func (m *TestVersionFD1WithExtraAny) GetE() int32 { + if x, ok := m.GetSum().(*TestVersionFD1WithExtraAny_E); ok { + return x.E + } + return 0 +} + +func (m *TestVersionFD1WithExtraAny) GetF() *TestVersion1 { + if x, ok := m.GetSum().(*TestVersionFD1WithExtraAny_F); ok { + return x.F + } + return nil +} + +func (m *TestVersionFD1WithExtraAny) GetG() *AnyWithExtra { + if m != nil { + return m.G + } + return nil +} + +func (m *TestVersionFD1WithExtraAny) GetH() []*TestVersion1 { + if m != nil { + return m.H + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersionFD1WithExtraAny) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersionFD1WithExtraAny_E)(nil), + (*TestVersionFD1WithExtraAny_F)(nil), + } +} + +type AnyWithExtra struct { + *types.Any `protobuf:"bytes,1,opt,name=a,proto3,embedded=a" json:"a,omitempty"` + B int64 `protobuf:"varint,3,opt,name=b,proto3" json:"b,omitempty"` + C int64 `protobuf:"varint,4,opt,name=c,proto3" json:"c,omitempty"` +} + +func (m *AnyWithExtra) Reset() { *m = AnyWithExtra{} } +func (m *AnyWithExtra) String() string { return proto.CompactTextString(m) } +func (*AnyWithExtra) ProtoMessage() {} +func (*AnyWithExtra) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{19} +} +func (m *AnyWithExtra) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AnyWithExtra) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AnyWithExtra.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AnyWithExtra) XXX_Merge(src proto.Message) { + xxx_messageInfo_AnyWithExtra.Merge(m, src) +} +func (m *AnyWithExtra) XXX_Size() int { + return m.Size() +} +func (m *AnyWithExtra) XXX_DiscardUnknown() { + xxx_messageInfo_AnyWithExtra.DiscardUnknown(m) +} + +var xxx_messageInfo_AnyWithExtra proto.InternalMessageInfo + +func (m *AnyWithExtra) GetB() int64 { + if m != nil { + return m.B + } + return 0 +} + +func (m *AnyWithExtra) GetC() int64 { + if m != nil { + return m.C + } + return 0 +} + +type TestUpdatedTxRaw struct { + BodyBytes []byte `protobuf:"bytes,1,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"` + AuthInfoBytes []byte `protobuf:"bytes,2,opt,name=auth_info_bytes,json=authInfoBytes,proto3" json:"auth_info_bytes,omitempty"` + Signatures [][]byte `protobuf:"bytes,3,rep,name=signatures,proto3" json:"signatures,omitempty"` + NewField_5 []byte `protobuf:"bytes,5,opt,name=new_field_5,json=newField5,proto3" json:"new_field_5,omitempty"` + NewField_1024 []byte `protobuf:"bytes,1024,opt,name=new_field_1024,json=newField1024,proto3" json:"new_field_1024,omitempty"` +} + +func (m *TestUpdatedTxRaw) Reset() { *m = TestUpdatedTxRaw{} } +func (m *TestUpdatedTxRaw) String() string { return proto.CompactTextString(m) } +func (*TestUpdatedTxRaw) ProtoMessage() {} +func (*TestUpdatedTxRaw) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{20} +} +func (m *TestUpdatedTxRaw) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestUpdatedTxRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestUpdatedTxRaw.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestUpdatedTxRaw) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestUpdatedTxRaw.Merge(m, src) +} +func (m *TestUpdatedTxRaw) XXX_Size() int { + return m.Size() +} +func (m *TestUpdatedTxRaw) XXX_DiscardUnknown() { + xxx_messageInfo_TestUpdatedTxRaw.DiscardUnknown(m) +} + +var xxx_messageInfo_TestUpdatedTxRaw proto.InternalMessageInfo + +func (m *TestUpdatedTxRaw) GetBodyBytes() []byte { + if m != nil { + return m.BodyBytes + } + return nil +} + +func (m *TestUpdatedTxRaw) GetAuthInfoBytes() []byte { + if m != nil { + return m.AuthInfoBytes + } + return nil +} + +func (m *TestUpdatedTxRaw) GetSignatures() [][]byte { + if m != nil { + return m.Signatures + } + return nil +} + +func (m *TestUpdatedTxRaw) GetNewField_5() []byte { + if m != nil { + return m.NewField_5 + } + return nil +} + +func (m *TestUpdatedTxRaw) GetNewField_1024() []byte { + if m != nil { + return m.NewField_1024 + } + return nil +} + +type TestUpdatedTxBody struct { + Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` + TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` + SomeNewField uint64 `protobuf:"varint,4,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` + SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"` + ExtensionOptions []*types.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` + NonCriticalExtensionOptions []*types.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` +} + +func (m *TestUpdatedTxBody) Reset() { *m = TestUpdatedTxBody{} } +func (m *TestUpdatedTxBody) String() string { return proto.CompactTextString(m) } +func (*TestUpdatedTxBody) ProtoMessage() {} +func (*TestUpdatedTxBody) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{21} +} +func (m *TestUpdatedTxBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestUpdatedTxBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestUpdatedTxBody.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestUpdatedTxBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestUpdatedTxBody.Merge(m, src) +} +func (m *TestUpdatedTxBody) XXX_Size() int { + return m.Size() +} +func (m *TestUpdatedTxBody) XXX_DiscardUnknown() { + xxx_messageInfo_TestUpdatedTxBody.DiscardUnknown(m) +} + +var xxx_messageInfo_TestUpdatedTxBody proto.InternalMessageInfo + +func (m *TestUpdatedTxBody) GetMessages() []*types.Any { + if m != nil { + return m.Messages + } + return nil +} + +func (m *TestUpdatedTxBody) GetMemo() string { + if m != nil { + return m.Memo + } + return "" +} + +func (m *TestUpdatedTxBody) GetTimeoutHeight() int64 { + if m != nil { + return m.TimeoutHeight + } + return 0 +} + +func (m *TestUpdatedTxBody) GetSomeNewField() uint64 { + if m != nil { + return m.SomeNewField + } + return 0 +} + +func (m *TestUpdatedTxBody) GetSomeNewFieldNonCriticalField() string { + if m != nil { + return m.SomeNewFieldNonCriticalField + } + return "" +} + +func (m *TestUpdatedTxBody) GetExtensionOptions() []*types.Any { + if m != nil { + return m.ExtensionOptions + } + return nil +} + +func (m *TestUpdatedTxBody) GetNonCriticalExtensionOptions() []*types.Any { + if m != nil { + return m.NonCriticalExtensionOptions + } + return nil +} + +type TestUpdatedAuthInfo struct { + SignerInfos []*tx.SignerInfo `protobuf:"bytes,1,rep,name=signer_infos,json=signerInfos,proto3" json:"signer_infos,omitempty"` + Fee *tx.Fee `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee,omitempty"` + NewField_3 []byte `protobuf:"bytes,3,opt,name=new_field_3,json=newField3,proto3" json:"new_field_3,omitempty"` + NewField_1024 []byte `protobuf:"bytes,1024,opt,name=new_field_1024,json=newField1024,proto3" json:"new_field_1024,omitempty"` +} + +func (m *TestUpdatedAuthInfo) Reset() { *m = TestUpdatedAuthInfo{} } +func (m *TestUpdatedAuthInfo) String() string { return proto.CompactTextString(m) } +func (*TestUpdatedAuthInfo) ProtoMessage() {} +func (*TestUpdatedAuthInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{22} +} +func (m *TestUpdatedAuthInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestUpdatedAuthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestUpdatedAuthInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestUpdatedAuthInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestUpdatedAuthInfo.Merge(m, src) +} +func (m *TestUpdatedAuthInfo) XXX_Size() int { + return m.Size() +} +func (m *TestUpdatedAuthInfo) XXX_DiscardUnknown() { + xxx_messageInfo_TestUpdatedAuthInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_TestUpdatedAuthInfo proto.InternalMessageInfo + +func (m *TestUpdatedAuthInfo) GetSignerInfos() []*tx.SignerInfo { + if m != nil { + return m.SignerInfos + } + return nil +} + +func (m *TestUpdatedAuthInfo) GetFee() *tx.Fee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *TestUpdatedAuthInfo) GetNewField_3() []byte { + if m != nil { + return m.NewField_3 + } + return nil +} + +func (m *TestUpdatedAuthInfo) GetNewField_1024() []byte { + if m != nil { + return m.NewField_1024 + } + return nil +} + +type TestRepeatedUints struct { + Nums []uint64 `protobuf:"varint,1,rep,packed,name=nums,proto3" json:"nums,omitempty"` +} + +func (m *TestRepeatedUints) Reset() { *m = TestRepeatedUints{} } +func (m *TestRepeatedUints) String() string { return proto.CompactTextString(m) } +func (*TestRepeatedUints) ProtoMessage() {} +func (*TestRepeatedUints) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{23} +} +func (m *TestRepeatedUints) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestRepeatedUints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestRepeatedUints.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestRepeatedUints) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestRepeatedUints.Merge(m, src) +} +func (m *TestRepeatedUints) XXX_Size() int { + return m.Size() +} +func (m *TestRepeatedUints) XXX_DiscardUnknown() { + xxx_messageInfo_TestRepeatedUints.DiscardUnknown(m) +} + +var xxx_messageInfo_TestRepeatedUints proto.InternalMessageInfo + +func (m *TestRepeatedUints) GetNums() []uint64 { + if m != nil { + return m.Nums + } + return nil +} + +func init() { + proto.RegisterEnum("testdata.Customer2_City", Customer2_City_name, Customer2_City_value) + proto.RegisterType((*Customer1)(nil), "testdata.Customer1") + proto.RegisterType((*Customer2)(nil), "testdata.Customer2") + proto.RegisterType((*Nested4A)(nil), "testdata.Nested4A") + proto.RegisterType((*Nested3A)(nil), "testdata.Nested3A") + proto.RegisterMapType((map[int64]*Nested4A)(nil), "testdata.Nested3A.IndexEntry") + proto.RegisterType((*Nested2A)(nil), "testdata.Nested2A") + proto.RegisterType((*Nested1A)(nil), "testdata.Nested1A") + proto.RegisterType((*Nested4B)(nil), "testdata.Nested4B") + proto.RegisterType((*Nested3B)(nil), "testdata.Nested3B") + proto.RegisterType((*Nested2B)(nil), "testdata.Nested2B") + proto.RegisterType((*Nested1B)(nil), "testdata.Nested1B") + proto.RegisterType((*Customer3)(nil), "testdata.Customer3") + proto.RegisterType((*TestVersion1)(nil), "testdata.TestVersion1") + proto.RegisterType((*TestVersion2)(nil), "testdata.TestVersion2") + proto.RegisterType((*TestVersion3)(nil), "testdata.TestVersion3") + proto.RegisterType((*TestVersion3LoneOneOfValue)(nil), "testdata.TestVersion3LoneOneOfValue") + proto.RegisterType((*TestVersion3LoneNesting)(nil), "testdata.TestVersion3LoneNesting") + proto.RegisterType((*TestVersion3LoneNesting_Inner1)(nil), "testdata.TestVersion3LoneNesting.Inner1") + proto.RegisterType((*TestVersion3LoneNesting_Inner1_InnerInner)(nil), "testdata.TestVersion3LoneNesting.Inner1.InnerInner") + proto.RegisterType((*TestVersion3LoneNesting_Inner2)(nil), "testdata.TestVersion3LoneNesting.Inner2") + proto.RegisterType((*TestVersion3LoneNesting_Inner2_InnerInner)(nil), "testdata.TestVersion3LoneNesting.Inner2.InnerInner") + proto.RegisterType((*TestVersion4LoneNesting)(nil), "testdata.TestVersion4LoneNesting") + proto.RegisterType((*TestVersion4LoneNesting_Inner1)(nil), "testdata.TestVersion4LoneNesting.Inner1") + proto.RegisterType((*TestVersion4LoneNesting_Inner1_InnerInner)(nil), "testdata.TestVersion4LoneNesting.Inner1.InnerInner") + proto.RegisterType((*TestVersion4LoneNesting_Inner2)(nil), "testdata.TestVersion4LoneNesting.Inner2") + proto.RegisterType((*TestVersion4LoneNesting_Inner2_InnerInner)(nil), "testdata.TestVersion4LoneNesting.Inner2.InnerInner") + proto.RegisterType((*TestVersionFD1)(nil), "testdata.TestVersionFD1") + proto.RegisterType((*TestVersionFD1WithExtraAny)(nil), "testdata.TestVersionFD1WithExtraAny") + proto.RegisterType((*AnyWithExtra)(nil), "testdata.AnyWithExtra") + proto.RegisterType((*TestUpdatedTxRaw)(nil), "testdata.TestUpdatedTxRaw") + proto.RegisterType((*TestUpdatedTxBody)(nil), "testdata.TestUpdatedTxBody") + proto.RegisterType((*TestUpdatedAuthInfo)(nil), "testdata.TestUpdatedAuthInfo") + proto.RegisterType((*TestRepeatedUints)(nil), "testdata.TestRepeatedUints") +} + +func init() { proto.RegisterFile("unknonwnproto.proto", fileDescriptor_448ea787339d1228) } + +var fileDescriptor_448ea787339d1228 = []byte{ + // 1644 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4f, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x70, 0x49, 0x89, 0x7c, 0xa2, 0x69, 0x66, 0x6c, 0xb4, 0x1b, 0x3a, 0x66, 0x98, 0x85, + 0xeb, 0xb0, 0x41, 0x43, 0x9a, 0x4b, 0x06, 0x28, 0x72, 0x32, 0xe9, 0x58, 0x95, 0x01, 0x57, 0x2e, + 0xa6, 0x4e, 0x5a, 0xf8, 0x42, 0x2c, 0xb9, 0x43, 0x72, 0x21, 0x72, 0x46, 0xdd, 0x99, 0xb5, 0xc8, + 0x5b, 0xd1, 0x1e, 0x7a, 0xcd, 0xa5, 0x28, 0xd0, 0x6f, 0xd0, 0x53, 0x91, 0x6f, 0xd0, 0xa3, 0x2f, + 0x05, 0x7c, 0x29, 0x50, 0xa0, 0x40, 0x50, 0xd8, 0xd7, 0x7e, 0x83, 0xa2, 0x48, 0x31, 0xb3, 0x7f, + 0xb8, 0x94, 0x44, 0x85, 0x52, 0xda, 0x18, 0x02, 0x72, 0x11, 0x67, 0xde, 0xfe, 0xe6, 0xcd, 0x7b, + 0xbf, 0xf7, 0x67, 0x77, 0x46, 0x70, 0x23, 0x60, 0x87, 0x8c, 0xb3, 0x63, 0x76, 0xe4, 0x73, 0xc9, + 0x1b, 0xfa, 0x2f, 0xce, 0x4b, 0x2a, 0xa4, 0xeb, 0x48, 0xa7, 0x72, 0x73, 0xcc, 0xc7, 0x5c, 0x0b, + 0x9b, 0x6a, 0x14, 0x3e, 0xaf, 0xbc, 0x3d, 0xe6, 0x7c, 0x3c, 0xa5, 0x4d, 0x3d, 0x1b, 0x04, 0xa3, + 0xa6, 0xc3, 0x16, 0xd1, 0xa3, 0xca, 0x90, 0x8b, 0x19, 0x17, 0x4d, 0x39, 0x6f, 0x3e, 0x6f, 0x0d, + 0xa8, 0x74, 0x5a, 0x4d, 0x39, 0x0f, 0x9f, 0x59, 0x12, 0x0a, 0x0f, 0x02, 0x21, 0xf9, 0x8c, 0xfa, + 0x2d, 0x5c, 0x82, 0x8c, 0xe7, 0x9a, 0xa8, 0x86, 0xea, 0x39, 0x92, 0xf1, 0x5c, 0x8c, 0x21, 0xcb, + 0x9c, 0x19, 0x35, 0x33, 0x35, 0x54, 0x2f, 0x10, 0x3d, 0xc6, 0x3f, 0x84, 0xb2, 0x08, 0x06, 0x62, + 0xe8, 0x7b, 0x47, 0xd2, 0xe3, 0xac, 0x3f, 0xa2, 0xd4, 0x34, 0x6a, 0xa8, 0x9e, 0x21, 0xd7, 0xd3, + 0xf2, 0x3d, 0x4a, 0xb1, 0x09, 0x3b, 0x47, 0xce, 0x62, 0x46, 0x99, 0x34, 0x77, 0xb4, 0x86, 0x78, + 0x6a, 0x7d, 0x91, 0x59, 0x6e, 0x6b, 0x9f, 0xda, 0xb6, 0x02, 0x79, 0x8f, 0xb9, 0x81, 0x90, 0xfe, + 0x42, 0x6f, 0x9d, 0x23, 0xc9, 0x3c, 0x31, 0xc9, 0x48, 0x99, 0x74, 0x13, 0x72, 0x23, 0x7a, 0x4c, + 0x7d, 0x33, 0xab, 0xed, 0x08, 0x27, 0xf8, 0x16, 0xe4, 0x7d, 0x2a, 0xa8, 0xff, 0x9c, 0xba, 0xe6, + 0x1f, 0xf2, 0x35, 0x54, 0x37, 0x48, 0x22, 0xc0, 0x3f, 0x82, 0xec, 0xd0, 0x93, 0x0b, 0x73, 0xbb, + 0x86, 0xea, 0x25, 0xdb, 0x6c, 0xc4, 0xe4, 0x36, 0x12, 0xab, 0x1a, 0x0f, 0x3c, 0xb9, 0x20, 0x1a, + 0x85, 0x3f, 0x86, 0x6b, 0x33, 0x4f, 0x0c, 0xe9, 0x74, 0xea, 0x30, 0xca, 0x03, 0x61, 0x42, 0x0d, + 0xd5, 0x77, 0xed, 0x9b, 0x8d, 0x90, 0xf3, 0x46, 0xcc, 0x79, 0xa3, 0xcb, 0x16, 0x64, 0x15, 0x6a, + 0xfd, 0x04, 0xb2, 0x4a, 0x13, 0xce, 0x43, 0xf6, 0xb1, 0xc3, 0x45, 0x79, 0x0b, 0x97, 0x00, 0x1e, + 0x73, 0xd1, 0x65, 0x63, 0x3a, 0xa5, 0xa2, 0x8c, 0x70, 0x11, 0xf2, 0x3f, 0x73, 0xa6, 0xbc, 0x3b, + 0x95, 0xbc, 0x9c, 0xc1, 0x00, 0xdb, 0x3f, 0xe5, 0x62, 0xc8, 0x8f, 0xcb, 0x06, 0xde, 0x85, 0x9d, + 0x03, 0xc7, 0xf3, 0xf9, 0xc0, 0x2b, 0x67, 0xad, 0x06, 0xe4, 0x0f, 0xa8, 0x90, 0xd4, 0xed, 0x74, + 0x37, 0x09, 0x94, 0xf5, 0x37, 0x14, 0x2f, 0x68, 0x6f, 0xb4, 0x00, 0x5b, 0x90, 0x71, 0x3a, 0x66, + 0xb6, 0x66, 0xd4, 0x77, 0x6d, 0xbc, 0x64, 0x24, 0xde, 0x94, 0x64, 0x9c, 0x0e, 0x6e, 0x43, 0xce, + 0x63, 0x2e, 0x9d, 0x9b, 0x39, 0x0d, 0xbb, 0x7d, 0x12, 0xd6, 0xee, 0x36, 0x1e, 0xa9, 0xe7, 0x0f, + 0x99, 0xf4, 0x17, 0x24, 0xc4, 0x56, 0x1e, 0x03, 0x2c, 0x85, 0xb8, 0x0c, 0xc6, 0x21, 0x5d, 0x68, + 0x5b, 0x0c, 0xa2, 0x86, 0xb8, 0x0e, 0xb9, 0xe7, 0xce, 0x34, 0x08, 0xad, 0x39, 0x7b, 0xef, 0x10, + 0xf0, 0x71, 0xe6, 0xc7, 0xc8, 0x7a, 0x16, 0xbb, 0x65, 0x6f, 0xe6, 0xd6, 0x07, 0xb0, 0xcd, 0x34, + 0x5e, 0xe7, 0xcc, 0x19, 0xea, 0xdb, 0x5d, 0x12, 0x21, 0xac, 0xbd, 0x58, 0x77, 0xeb, 0xb4, 0xee, + 0xa5, 0x9e, 0x35, 0x66, 0xda, 0x4b, 0x3d, 0xf7, 0x93, 0x58, 0xf5, 0x4e, 0xe9, 0x29, 0x83, 0xe1, + 0x8c, 0x69, 0x94, 0xd8, 0x6a, 0x78, 0x56, 0x4e, 0x5b, 0x6e, 0x12, 0xbc, 0x4b, 0x6a, 0x50, 0xe1, + 0x1c, 0xac, 0x0f, 0x67, 0x8f, 0x64, 0x06, 0x1d, 0x8b, 0x25, 0x5c, 0x9e, 0xb9, 0x8b, 0xaa, 0x6d, + 0xb5, 0x0b, 0x22, 0x6a, 0xb8, 0x01, 0x93, 0xbd, 0x98, 0x01, 0x55, 0x93, 0x3e, 0x0f, 0x24, 0xd5, + 0x35, 0x59, 0x20, 0xe1, 0xc4, 0xfa, 0x65, 0xc2, 0x6f, 0xef, 0x12, 0xfc, 0x2e, 0xb5, 0x47, 0x0c, + 0x18, 0x09, 0x03, 0xd6, 0x6f, 0x52, 0x1d, 0xa5, 0xbd, 0x51, 0x5e, 0x94, 0x20, 0x23, 0x46, 0x51, + 0xeb, 0xca, 0x88, 0x11, 0x7e, 0x07, 0x0a, 0x22, 0xf0, 0x87, 0x13, 0xc7, 0x1f, 0xd3, 0xa8, 0x93, + 0x2c, 0x05, 0xb8, 0x06, 0xbb, 0x2e, 0x15, 0xd2, 0x63, 0x8e, 0xea, 0x6e, 0x66, 0x4e, 0x2b, 0x4a, + 0x8b, 0xf0, 0x5d, 0x28, 0x0d, 0x7d, 0xea, 0x7a, 0xb2, 0x3f, 0x74, 0x7c, 0xb7, 0xcf, 0x78, 0xd8, + 0xf4, 0xf6, 0xb7, 0x48, 0x31, 0x94, 0x3f, 0x70, 0x7c, 0xf7, 0x80, 0xe3, 0xdb, 0x50, 0x18, 0x4e, + 0xe8, 0xaf, 0x02, 0xaa, 0x20, 0xf9, 0x08, 0x92, 0x0f, 0x45, 0x07, 0x1c, 0x37, 0x21, 0xcf, 0x7d, + 0x6f, 0xec, 0x31, 0x67, 0x6a, 0x16, 0x34, 0x11, 0x37, 0x4e, 0x77, 0xa7, 0x16, 0x49, 0x40, 0xbd, + 0x42, 0xd2, 0x65, 0xad, 0x7f, 0x65, 0xa0, 0xf8, 0x94, 0x0a, 0xf9, 0x19, 0xf5, 0x85, 0xc7, 0x59, + 0x0b, 0x17, 0x01, 0xcd, 0xa3, 0x4a, 0x43, 0x73, 0x7c, 0x07, 0x90, 0x13, 0x91, 0xfb, 0xbd, 0xa5, + 0xce, 0xf4, 0x02, 0x82, 0x1c, 0x85, 0x1a, 0x44, 0x01, 0x5e, 0x8b, 0x1a, 0x28, 0xd4, 0x30, 0x4a, + 0xae, 0xb5, 0xa8, 0x21, 0xfe, 0x00, 0x90, 0x1b, 0xb5, 0x8a, 0x35, 0xa8, 0x5e, 0xf6, 0xc5, 0x97, + 0xef, 0x6e, 0x11, 0xe4, 0xe2, 0x12, 0x20, 0xaa, 0xfb, 0x71, 0x6e, 0x7f, 0x8b, 0x20, 0x8a, 0xef, + 0x02, 0x1a, 0x69, 0x0a, 0xd7, 0xae, 0x55, 0xb8, 0x11, 0xb6, 0x00, 0x8d, 0x35, 0x8f, 0xeb, 0x1a, + 0x32, 0x1a, 0x2b, 0x6b, 0x27, 0x66, 0xe1, 0x7c, 0x6b, 0x27, 0xf8, 0x7d, 0x40, 0x87, 0x66, 0x71, + 0x2d, 0xe7, 0xbd, 0xec, 0xcb, 0x2f, 0xdf, 0x45, 0x04, 0x1d, 0xf6, 0x72, 0x60, 0x88, 0x60, 0x66, + 0xfd, 0xd6, 0x58, 0xa1, 0xdb, 0xbe, 0x28, 0xdd, 0xf6, 0x46, 0x74, 0xdb, 0x1b, 0xd1, 0x6d, 0x2b, + 0xba, 0xef, 0x7c, 0x1d, 0xdd, 0xf6, 0xa5, 0x88, 0xb6, 0xdf, 0x14, 0xd1, 0xf8, 0x16, 0x14, 0x18, + 0x3d, 0xee, 0x8f, 0x3c, 0x3a, 0x75, 0xcd, 0xb7, 0x6b, 0xa8, 0x9e, 0x25, 0x79, 0x46, 0x8f, 0xf7, + 0xd4, 0x3c, 0x8e, 0xc2, 0xef, 0x57, 0xa3, 0xd0, 0xbe, 0x68, 0x14, 0xda, 0x1b, 0x45, 0xa1, 0xbd, + 0x51, 0x14, 0xda, 0x1b, 0x45, 0xa1, 0x7d, 0xa9, 0x28, 0xb4, 0xdf, 0x58, 0x14, 0x3e, 0x04, 0xcc, + 0x38, 0xeb, 0x0f, 0x7d, 0x4f, 0x7a, 0x43, 0x67, 0x1a, 0x85, 0xe3, 0x77, 0xba, 0x77, 0x91, 0x32, + 0xe3, 0xec, 0x41, 0xf4, 0x64, 0x25, 0x2e, 0xff, 0xce, 0x40, 0x25, 0x6d, 0xfe, 0x63, 0xce, 0xe8, + 0x13, 0x46, 0x9f, 0x8c, 0x3e, 0x53, 0xaf, 0xf2, 0x2b, 0x1a, 0xa5, 0x2b, 0xc3, 0xfe, 0x7f, 0xb6, + 0xe1, 0xfb, 0x27, 0xd9, 0x3f, 0xd0, 0x6f, 0xab, 0xf1, 0x15, 0xa1, 0xbe, 0xb5, 0x2c, 0x88, 0xf7, + 0xce, 0x46, 0xa5, 0x7c, 0xba, 0x22, 0xb5, 0x81, 0xef, 0xc3, 0xb6, 0xc7, 0x18, 0xf5, 0x5b, 0x66, + 0x49, 0x2b, 0xaf, 0x7f, 0xad, 0x67, 0x8d, 0x47, 0x1a, 0x4f, 0xa2, 0x75, 0x89, 0x06, 0xdb, 0xbc, + 0x7e, 0x21, 0x0d, 0x76, 0xa4, 0xc1, 0xae, 0xfc, 0x09, 0xc1, 0x76, 0xa8, 0x34, 0xf5, 0x9d, 0x64, + 0xac, 0xfd, 0x4e, 0x7a, 0xa4, 0x3e, 0xf9, 0x19, 0xf5, 0xa3, 0xe8, 0xb7, 0x37, 0xb5, 0x38, 0xfc, + 0xd1, 0x7f, 0x48, 0xa8, 0xa1, 0x72, 0x4f, 0x1d, 0x04, 0x62, 0x61, 0x6a, 0xf3, 0x42, 0xbc, 0xb9, + 0x3e, 0x93, 0x45, 0x9b, 0xab, 0x71, 0xe5, 0xcf, 0xb1, 0xad, 0xf6, 0x29, 0xb8, 0x09, 0x3b, 0x43, + 0x1e, 0xb0, 0xf8, 0x90, 0x58, 0x20, 0xf1, 0xf4, 0xb2, 0x16, 0xdb, 0xff, 0x0b, 0x8b, 0xe3, 0xfa, + 0xfb, 0x6a, 0xb5, 0xfe, 0x3a, 0xdf, 0xd5, 0xdf, 0x15, 0xaa, 0xbf, 0xce, 0x37, 0xae, 0xbf, 0xce, + 0xb7, 0x5c, 0x7f, 0x9d, 0x6f, 0x54, 0x7f, 0xc6, 0xda, 0xfa, 0xfb, 0xe2, 0xff, 0x56, 0x7f, 0x9d, + 0x8d, 0xea, 0xcf, 0x3e, 0xb7, 0xfe, 0x6e, 0xa6, 0x2f, 0x0e, 0x8c, 0xe8, 0x92, 0x20, 0xae, 0xc0, + 0xbf, 0x22, 0x28, 0xa5, 0xf6, 0xdb, 0xfb, 0xe4, 0x72, 0xc7, 0xa1, 0x37, 0x7e, 0x2c, 0x89, 0xfd, + 0xf9, 0x07, 0x5a, 0xf9, 0x9e, 0xda, 0xfb, 0xa4, 0xf5, 0x0b, 0x4f, 0x4e, 0x1e, 0xce, 0xa5, 0xef, + 0x74, 0xd9, 0xe2, 0x5b, 0xf5, 0xed, 0xce, 0xd2, 0xb7, 0x14, 0xae, 0xcb, 0x16, 0x89, 0x45, 0x17, + 0xf6, 0xee, 0x29, 0x14, 0xd3, 0xeb, 0x71, 0x5d, 0x39, 0x80, 0xd6, 0xd3, 0x17, 0x77, 0x00, 0x47, + 0x39, 0x1e, 0x76, 0x46, 0x43, 0x75, 0xc0, 0x62, 0xd8, 0x01, 0xf5, 0x6c, 0x68, 0xfd, 0x05, 0x41, + 0x59, 0x6d, 0xf8, 0xe9, 0x91, 0xeb, 0x48, 0xea, 0x3e, 0x9d, 0x13, 0xe7, 0x18, 0xdf, 0x06, 0x18, + 0x70, 0x77, 0xd1, 0x1f, 0x2c, 0x24, 0x15, 0x7a, 0x8f, 0x22, 0x29, 0x28, 0x49, 0x4f, 0x09, 0xf0, + 0x5d, 0xb8, 0xee, 0x04, 0x72, 0xd2, 0xf7, 0xd8, 0x88, 0x47, 0x98, 0x8c, 0xc6, 0x5c, 0x53, 0xe2, + 0x47, 0x6c, 0xc4, 0x43, 0x5c, 0x15, 0x40, 0x78, 0x63, 0xe6, 0xc8, 0xc0, 0xa7, 0xc2, 0x34, 0x6a, + 0x46, 0xbd, 0x48, 0x52, 0x12, 0x5c, 0x85, 0xdd, 0xe4, 0xec, 0xd2, 0xff, 0x48, 0xdf, 0x18, 0x14, + 0x49, 0x21, 0x3e, 0xbd, 0x7c, 0x84, 0x7f, 0x00, 0xa5, 0xe5, 0xf3, 0xd6, 0x3d, 0xbb, 0x63, 0xfe, + 0x3a, 0xaf, 0x31, 0xc5, 0x18, 0xa3, 0x84, 0xd6, 0xe7, 0x06, 0xbc, 0xb5, 0xe2, 0x42, 0x8f, 0xbb, + 0x0b, 0x7c, 0x0f, 0xf2, 0x33, 0x2a, 0x84, 0x33, 0xd6, 0x1e, 0x18, 0x6b, 0x93, 0x2c, 0x41, 0xa9, + 0xea, 0x9e, 0xd1, 0x19, 0x8f, 0xab, 0x5b, 0x8d, 0x95, 0x09, 0xd2, 0x9b, 0x51, 0x1e, 0xc8, 0xfe, + 0x84, 0x7a, 0xe3, 0x89, 0x8c, 0x78, 0xbc, 0x16, 0x49, 0xf7, 0xb5, 0x10, 0xdf, 0x81, 0x92, 0xe0, + 0x33, 0xda, 0x5f, 0x1e, 0xc5, 0xb2, 0xfa, 0x28, 0x56, 0x54, 0xd2, 0x83, 0xc8, 0x58, 0xbc, 0x0f, + 0xef, 0xad, 0xa2, 0xfa, 0x67, 0x34, 0xe6, 0x3f, 0x86, 0x8d, 0xf9, 0x9d, 0xf4, 0xca, 0x83, 0x93, + 0x4d, 0xba, 0x07, 0x6f, 0xd1, 0xb9, 0xa4, 0x4c, 0xe5, 0x48, 0x9f, 0xeb, 0xeb, 0x64, 0x61, 0x7e, + 0xb5, 0x73, 0x8e, 0x9b, 0xe5, 0x04, 0xff, 0x24, 0x84, 0xe3, 0x67, 0x50, 0x5d, 0xd9, 0xfe, 0x0c, + 0x85, 0xd7, 0xcf, 0x51, 0x78, 0x2b, 0xf5, 0xe6, 0x78, 0x78, 0x42, 0xb7, 0xf5, 0x02, 0xc1, 0x8d, + 0x54, 0x48, 0xba, 0x51, 0x5a, 0xe0, 0xfb, 0x50, 0x54, 0xf1, 0xa7, 0xbe, 0xce, 0x9d, 0x38, 0x30, + 0xb7, 0x1b, 0xe1, 0xf5, 0x7b, 0x43, 0xce, 0x1b, 0xd1, 0xf5, 0x7b, 0xe3, 0xe7, 0x1a, 0xa6, 0x16, + 0x91, 0x5d, 0x91, 0x8c, 0x05, 0xae, 0x2f, 0xef, 0xdc, 0x54, 0xd1, 0x9c, 0x5e, 0xb8, 0x47, 0x69, + 0x78, 0x17, 0xb7, 0x92, 0x5d, 0x6d, 0x1d, 0xb7, 0x54, 0x76, 0xb5, 0x37, 0xcd, 0xae, 0xf7, 0xc3, + 0xe4, 0x22, 0xf4, 0x88, 0x2a, 0x57, 0x3e, 0xf5, 0x98, 0xd4, 0xa9, 0xc2, 0x82, 0x59, 0x68, 0x7f, + 0x96, 0xe8, 0x71, 0x6f, 0xff, 0xc5, 0xab, 0x2a, 0x7a, 0xf9, 0xaa, 0x8a, 0xfe, 0xf9, 0xaa, 0x8a, + 0x3e, 0x7f, 0x5d, 0xdd, 0x7a, 0xf9, 0xba, 0xba, 0xf5, 0xf7, 0xd7, 0xd5, 0xad, 0x67, 0x8d, 0xb1, + 0x27, 0x27, 0xc1, 0xa0, 0x31, 0xe4, 0xb3, 0x66, 0xf4, 0x8f, 0x86, 0xf0, 0xe7, 0x43, 0xe1, 0x1e, + 0x36, 0x55, 0xdd, 0x07, 0xd2, 0x9b, 0x36, 0xe3, 0x06, 0x30, 0xd8, 0xd6, 0x44, 0xb7, 0xff, 0x1b, + 0x00, 0x00, 0xff, 0xff, 0xa6, 0x69, 0x10, 0x33, 0xe6, 0x18, 0x00, 0x00, +} + +func (m *Customer1) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Customer1) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Customer1) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payment) > 0 { + i -= len(m.Payment) + copy(dAtA[i:], m.Payment) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Payment))) + i-- + dAtA[i] = 0x3a + } + if m.SubscriptionFee != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.SubscriptionFee)))) + i-- + dAtA[i] = 0x1d + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Customer2) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Customer2) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Customer2) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Reserved != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Reserved)) + i-- + dAtA[i] = 0x41 + i-- + dAtA[i] = 0xb8 + } + if m.Miscellaneous != nil { + { + size, err := m.Miscellaneous.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.City != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.City)) + i-- + dAtA[i] = 0x30 + } + if m.Fewer != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Fewer)))) + i-- + dAtA[i] = 0x25 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if m.Industry != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Industry)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Nested4A) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nested4A) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nested4A) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Nested3A) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nested3A) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nested3A) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Index) > 0 { + for k := range m.Index { + v := m.Index[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i = encodeVarintUnknonwnproto(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = encodeVarintUnknonwnproto(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.A4) > 0 { + for iNdEx := len(m.A4) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.A4[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Nested2A) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nested2A) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nested2A) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Nested != nil { + { + size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Nested1A) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nested1A) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nested1A) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Nested != nil { + { + size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Nested4B) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nested4B) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nested4B) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if m.Age != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Age)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Nested3B) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nested3B) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nested3B) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.B4) > 0 { + for iNdEx := len(m.B4) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.B4[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if m.Age != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Age)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Nested2B) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nested2B) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nested2B) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Route) > 0 { + i -= len(m.Route) + copy(dAtA[i:], m.Route) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Route))) + i-- + dAtA[i] = 0x22 + } + if m.Nested != nil { + { + size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Fee != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Fee)))) + i-- + dAtA[i] = 0x11 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Nested1B) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nested1B) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nested1B) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Age != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Age)) + i-- + dAtA[i] = 0x18 + } + if m.Nested != nil { + { + size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Customer3) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Customer3) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Customer3) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Original != nil { + { + size, err := m.Original.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Payment != nil { + { + size := m.Payment.Size() + i -= size + if _, err := m.Payment.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Destination) > 0 { + i -= len(m.Destination) + copy(dAtA[i:], m.Destination) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Destination))) + i-- + dAtA[i] = 0x2a + } + if m.Surcharge != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Surcharge)))) + i-- + dAtA[i] = 0x25 + } + if m.Sf != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Sf)))) + i-- + dAtA[i] = 0x1d + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Customer3_CreditCardNo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Customer3_CreditCardNo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.CreditCardNo) + copy(dAtA[i:], m.CreditCardNo) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.CreditCardNo))) + i-- + dAtA[i] = 0x3a + return len(dAtA) - i, nil +} +func (m *Customer3_ChequeNo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Customer3_ChequeNo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ChequeNo) + copy(dAtA[i:], m.ChequeNo) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.ChequeNo))) + i-- + dAtA[i] = 0x42 + return len(dAtA) - i, nil +} +func (m *TestVersion1) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion1) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Customer1 != nil { + { + size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.G != nil { + { + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.D) > 0 { + for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.C) > 0 { + for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.B != nil { + { + size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.A != nil { + { + size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion1_E) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion1_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *TestVersion1_F) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion1_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.F != nil { + { + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *TestVersion2) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion2) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NewField != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.NewField)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc8 + } + if m.Customer1 != nil { + { + size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.G != nil { + { + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.D) > 0 { + for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.C) > 0 { + for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.B != nil { + { + size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.A != nil { + { + size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion2_E) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion2_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *TestVersion2_F) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion2_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.F != nil { + { + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *TestVersion3) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion3) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NonCriticalField) > 0 { + i -= len(m.NonCriticalField) + copy(dAtA[i:], m.NonCriticalField) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NonCriticalField))) + i-- + dAtA[i] = 0x40 + i-- + dAtA[i] = 0xba + } + if m.Customer1 != nil { + { + size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.G != nil { + { + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.D) > 0 { + for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.C) > 0 { + for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.B != nil { + { + size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.A != nil { + { + size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion3_E) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *TestVersion3_F) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.F != nil { + { + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *TestVersion3LoneOneOfValue) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion3LoneOneOfValue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NonCriticalField) > 0 { + i -= len(m.NonCriticalField) + copy(dAtA[i:], m.NonCriticalField) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NonCriticalField))) + i-- + dAtA[i] = 0x40 + i-- + dAtA[i] = 0xba + } + if m.Customer1 != nil { + { + size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.G != nil { + { + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.D) > 0 { + for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.C) > 0 { + for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.B != nil { + { + size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.A != nil { + { + size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion3LoneOneOfValue_E) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3LoneOneOfValue_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *TestVersion3LoneNesting) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion3LoneNesting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NonCriticalField) > 0 { + i -= len(m.NonCriticalField) + copy(dAtA[i:], m.NonCriticalField) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NonCriticalField))) + i-- + dAtA[i] = 0x40 + i-- + dAtA[i] = 0xba + } + if m.Inner2 != nil { + { + size, err := m.Inner2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.Inner1 != nil { + { + size, err := m.Inner1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.Customer1 != nil { + { + size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.G != nil { + { + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.D) > 0 { + for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.C) > 0 { + for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.B != nil { + { + size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.A != nil { + { + size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion3LoneNesting_F) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.F != nil { + { + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *TestVersion3LoneNesting_Inner1) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion3LoneNesting_Inner1) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Inner != nil { + { + size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion3LoneNesting_Inner1_InnerInner) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion3LoneNesting_Inner1_InnerInner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3LoneNesting_Inner1_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.City) > 0 { + i -= len(m.City) + copy(dAtA[i:], m.City) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.City))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestVersion3LoneNesting_Inner2) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion3LoneNesting_Inner2) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Inner != nil { + { + size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Country) > 0 { + i -= len(m.Country) + copy(dAtA[i:], m.Country) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Country))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestVersion3LoneNesting_Inner2_InnerInner) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion3LoneNesting_Inner2_InnerInner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion3LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.City) > 0 { + i -= len(m.City) + copy(dAtA[i:], m.City) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.City))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestVersion4LoneNesting) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion4LoneNesting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NonCriticalField) > 0 { + i -= len(m.NonCriticalField) + copy(dAtA[i:], m.NonCriticalField) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NonCriticalField))) + i-- + dAtA[i] = 0x40 + i-- + dAtA[i] = 0xba + } + if m.Inner2 != nil { + { + size, err := m.Inner2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.Inner1 != nil { + { + size, err := m.Inner1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.Customer1 != nil { + { + size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.G != nil { + { + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.D) > 0 { + for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.C) > 0 { + for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.B != nil { + { + size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.A != nil { + { + size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion4LoneNesting_F) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion4LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.F != nil { + { + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *TestVersion4LoneNesting_Inner1) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion4LoneNesting_Inner1) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion4LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Inner != nil { + { + size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion4LoneNesting_Inner1_InnerInner) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion4LoneNesting_Inner1_InnerInner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion4LoneNesting_Inner1_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.City) > 0 { + i -= len(m.City) + copy(dAtA[i:], m.City) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.City))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersion4LoneNesting_Inner2) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion4LoneNesting_Inner2) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion4LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Inner != nil { + { + size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Country) > 0 { + i -= len(m.Country) + copy(dAtA[i:], m.Country) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Country))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestVersion4LoneNesting_Inner2_InnerInner) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersion4LoneNesting_Inner2_InnerInner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersion4LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestVersionFD1) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersionFD1) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersionFD1) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.G != nil { + { + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.A != nil { + { + size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersionFD1_E) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersionFD1_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *TestVersionFD1_F) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersionFD1_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.F != nil { + { + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *TestVersionFD1WithExtraAny) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestVersionFD1WithExtraAny) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersionFD1WithExtraAny) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.G != nil { + { + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.A != nil { + { + size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TestVersionFD1WithExtraAny_E) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersionFD1WithExtraAny_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *TestVersionFD1WithExtraAny_F) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestVersionFD1WithExtraAny_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.F != nil { + { + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *AnyWithExtra) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AnyWithExtra) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AnyWithExtra) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.C != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.C)) + i-- + dAtA[i] = 0x20 + } + if m.B != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.B)) + i-- + dAtA[i] = 0x18 + } + if m.Any != nil { + { + size, err := m.Any.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestUpdatedTxRaw) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestUpdatedTxRaw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestUpdatedTxRaw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewField_1024) > 0 { + i -= len(m.NewField_1024) + copy(dAtA[i:], m.NewField_1024) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NewField_1024))) + i-- + dAtA[i] = 0x40 + i-- + dAtA[i] = 0x82 + } + if len(m.NewField_5) > 0 { + i -= len(m.NewField_5) + copy(dAtA[i:], m.NewField_5) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NewField_5))) + i-- + dAtA[i] = 0x2a + } + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signatures[iNdEx]) + copy(dAtA[i:], m.Signatures[iNdEx]) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Signatures[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.AuthInfoBytes) > 0 { + i -= len(m.AuthInfoBytes) + copy(dAtA[i:], m.AuthInfoBytes) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.AuthInfoBytes))) + i-- + dAtA[i] = 0x12 + } + if len(m.BodyBytes) > 0 { + i -= len(m.BodyBytes) + copy(dAtA[i:], m.BodyBytes) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.BodyBytes))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestUpdatedTxBody) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestUpdatedTxBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NonCriticalExtensionOptions) > 0 { + for iNdEx := len(m.NonCriticalExtensionOptions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NonCriticalExtensionOptions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7f + i-- + dAtA[i] = 0xfa + } + } + if len(m.SomeNewFieldNonCriticalField) > 0 { + i -= len(m.SomeNewFieldNonCriticalField) + copy(dAtA[i:], m.SomeNewFieldNonCriticalField) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.SomeNewFieldNonCriticalField))) + i-- + dAtA[i] = 0x41 + i-- + dAtA[i] = 0xd2 + } + if len(m.ExtensionOptions) > 0 { + for iNdEx := len(m.ExtensionOptions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExtensionOptions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3f + i-- + dAtA[i] = 0xfa + } + } + if m.SomeNewField != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.SomeNewField)) + i-- + dAtA[i] = 0x20 + } + if m.TimeoutHeight != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.TimeoutHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.Memo) > 0 { + i -= len(m.Memo) + copy(dAtA[i:], m.Memo) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Memo))) + i-- + dAtA[i] = 0x12 + } + if len(m.Messages) > 0 { + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TestUpdatedAuthInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestUpdatedAuthInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestUpdatedAuthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewField_1024) > 0 { + i -= len(m.NewField_1024) + copy(dAtA[i:], m.NewField_1024) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NewField_1024))) + i-- + dAtA[i] = 0x40 + i-- + dAtA[i] = 0x82 + } + if len(m.NewField_3) > 0 { + i -= len(m.NewField_3) + copy(dAtA[i:], m.NewField_3) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NewField_3))) + i-- + dAtA[i] = 0x1a + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SignerInfos) > 0 { + for iNdEx := len(m.SignerInfos) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SignerInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TestRepeatedUints) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestRepeatedUints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestRepeatedUints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Nums) > 0 { + dAtA54 := make([]byte, len(m.Nums)*10) + var j53 int + for _, num := range m.Nums { + for num >= 1<<7 { + dAtA54[j53] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j53++ + } + dAtA54[j53] = uint8(num) + j53++ + } + i -= j53 + copy(dAtA[i:], dAtA54[:j53]) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(j53)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintUnknonwnproto(dAtA []byte, offset int, v uint64) int { + offset -= sovUnknonwnproto(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Customer1) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.SubscriptionFee != 0 { + n += 5 + } + l = len(m.Payment) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *Customer2) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + if m.Industry != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Industry)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Fewer != 0 { + n += 5 + } + if m.City != 0 { + n += 1 + sovUnknonwnproto(uint64(m.City)) + } + if m.Miscellaneous != nil { + l = m.Miscellaneous.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Reserved != 0 { + n += 2 + sovUnknonwnproto(uint64(m.Reserved)) + } + return n +} + +func (m *Nested4A) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *Nested3A) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.A4) > 0 { + for _, e := range m.A4 { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if len(m.Index) > 0 { + for k, v := range m.Index { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovUnknonwnproto(uint64(l)) + } + mapEntrySize := 1 + sovUnknonwnproto(uint64(k)) + l + n += mapEntrySize + 1 + sovUnknonwnproto(uint64(mapEntrySize)) + } + } + return n +} + +func (m *Nested2A) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Nested != nil { + l = m.Nested.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *Nested1A) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + if m.Nested != nil { + l = m.Nested.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *Nested4B) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + if m.Age != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Age)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *Nested3B) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + if m.Age != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Age)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.B4) > 0 { + for _, e := range m.B4 { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + return n +} + +func (m *Nested2B) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + if m.Fee != 0 { + n += 9 + } + if m.Nested != nil { + l = m.Nested.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.Route) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *Nested1B) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + if m.Nested != nil { + l = m.Nested.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Age != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Age)) + } + return n +} + +func (m *Customer3) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Sf != 0 { + n += 5 + } + if m.Surcharge != 0 { + n += 5 + } + l = len(m.Destination) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Payment != nil { + n += m.Payment.Size() + } + if m.Original != nil { + l = m.Original.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *Customer3_CreditCardNo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CreditCardNo) + n += 1 + l + sovUnknonwnproto(uint64(l)) + return n +} +func (m *Customer3_ChequeNo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChequeNo) + n += 1 + l + sovUnknonwnproto(uint64(l)) + return n +} +func (m *TestVersion1) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) + } + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.B != nil { + l = m.B.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.C) > 0 { + for _, e := range m.C { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Sum != nil { + n += m.Sum.Size() + } + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion1_E) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovUnknonwnproto(uint64(m.E)) + return n +} +func (m *TestVersion1_F) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} +func (m *TestVersion2) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) + } + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.B != nil { + l = m.B.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.C) > 0 { + for _, e := range m.C { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Sum != nil { + n += m.Sum.Size() + } + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.NewField != 0 { + n += 2 + sovUnknonwnproto(uint64(m.NewField)) + } + return n +} + +func (m *TestVersion2_E) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovUnknonwnproto(uint64(m.E)) + return n +} +func (m *TestVersion2_F) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} +func (m *TestVersion3) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) + } + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.B != nil { + l = m.B.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.C) > 0 { + for _, e := range m.C { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Sum != nil { + n += m.Sum.Size() + } + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.NonCriticalField) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion3_E) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovUnknonwnproto(uint64(m.E)) + return n +} +func (m *TestVersion3_F) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} +func (m *TestVersion3LoneOneOfValue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) + } + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.B != nil { + l = m.B.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.C) > 0 { + for _, e := range m.C { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Sum != nil { + n += m.Sum.Size() + } + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.NonCriticalField) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion3LoneOneOfValue_E) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovUnknonwnproto(uint64(m.E)) + return n +} +func (m *TestVersion3LoneNesting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) + } + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.B != nil { + l = m.B.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.C) > 0 { + for _, e := range m.C { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Sum != nil { + n += m.Sum.Size() + } + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Inner1 != nil { + l = m.Inner1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Inner2 != nil { + l = m.Inner2.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.NonCriticalField) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion3LoneNesting_F) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} +func (m *TestVersion3LoneNesting_Inner1) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Inner != nil { + l = m.Inner.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion3LoneNesting_Inner1_InnerInner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.City) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion3LoneNesting_Inner2) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.Country) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Inner != nil { + l = m.Inner.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion3LoneNesting_Inner2_InnerInner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.City) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion4LoneNesting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) + } + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.B != nil { + l = m.B.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.C) > 0 { + for _, e := range m.C { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Sum != nil { + n += m.Sum.Size() + } + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Inner1 != nil { + l = m.Inner1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Inner2 != nil { + l = m.Inner2.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.NonCriticalField) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion4LoneNesting_F) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} +func (m *TestVersion4LoneNesting_Inner1) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Inner != nil { + l = m.Inner.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion4LoneNesting_Inner1_InnerInner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) + } + l = len(m.City) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion4LoneNesting_Inner2) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.Country) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Inner != nil { + l = m.Inner.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestVersion4LoneNesting_Inner2_InnerInner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Value != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Value)) + } + return n +} + +func (m *TestVersionFD1) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) + } + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Sum != nil { + n += m.Sum.Size() + } + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + return n +} + +func (m *TestVersionFD1_E) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovUnknonwnproto(uint64(m.E)) + return n +} +func (m *TestVersionFD1_F) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} +func (m *TestVersionFD1WithExtraAny) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) + } + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.Sum != nil { + n += m.Sum.Size() + } + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + return n +} + +func (m *TestVersionFD1WithExtraAny_E) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovUnknonwnproto(uint64(m.E)) + return n +} +func (m *TestVersionFD1WithExtraAny_F) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n +} +func (m *AnyWithExtra) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Any != nil { + l = m.Any.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.B != 0 { + n += 1 + sovUnknonwnproto(uint64(m.B)) + } + if m.C != 0 { + n += 1 + sovUnknonwnproto(uint64(m.C)) + } + return n +} + +func (m *TestUpdatedTxRaw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BodyBytes) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.AuthInfoBytes) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.Signatures) > 0 { + for _, b := range m.Signatures { + l = len(b) + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + l = len(m.NewField_5) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.NewField_1024) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestUpdatedTxBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Messages) > 0 { + for _, e := range m.Messages { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + l = len(m.Memo) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + if m.TimeoutHeight != 0 { + n += 1 + sovUnknonwnproto(uint64(m.TimeoutHeight)) + } + if m.SomeNewField != 0 { + n += 1 + sovUnknonwnproto(uint64(m.SomeNewField)) + } + if len(m.ExtensionOptions) > 0 { + for _, e := range m.ExtensionOptions { + l = e.Size() + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + } + l = len(m.SomeNewFieldNonCriticalField) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + if len(m.NonCriticalExtensionOptions) > 0 { + for _, e := range m.NonCriticalExtensionOptions { + l = e.Size() + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + } + return n +} + +func (m *TestUpdatedAuthInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SignerInfos) > 0 { + for _, e := range m.SignerInfos { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.NewField_3) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + l = len(m.NewField_1024) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) + } + return n +} + +func (m *TestRepeatedUints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Nums) > 0 { + l = 0 + for _, e := range m.Nums { + l += sovUnknonwnproto(uint64(e)) + } + n += 1 + sovUnknonwnproto(uint64(l)) + l + } + return n +} + +func sovUnknonwnproto(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozUnknonwnproto(x uint64) (n int) { + return sovUnknonwnproto(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Customer1) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Customer1: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Customer1: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionFee", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.SubscriptionFee = float32(math.Float32frombits(v)) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payment", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payment = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Customer2) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Customer2: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Customer2: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Industry", wireType) + } + m.Industry = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Industry |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Fewer", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Fewer = float32(math.Float32frombits(v)) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) + } + m.City = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.City |= Customer2_City(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Miscellaneous", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Miscellaneous == nil { + m.Miscellaneous = &types.Any{} + } + if err := m.Miscellaneous.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1047: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reserved", wireType) + } + m.Reserved = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Reserved |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nested4A) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nested4A: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nested4A: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nested3A) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nested3A: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nested3A: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A4", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.A4 = append(m.A4, &Nested4A{}) + if err := m.A4[len(m.A4)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Index == nil { + m.Index = make(map[int64]*Nested4A) + } + var mapkey int64 + var mapvalue *Nested4A + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Nested4A{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Index[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nested2A) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nested2A: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nested2A: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nested", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nested == nil { + m.Nested = &Nested3A{} + } + if err := m.Nested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nested1A) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nested1A: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nested1A: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nested", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nested == nil { + m.Nested = &Nested2A{} + } + if err := m.Nested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nested4B) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nested4B: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nested4B: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) + } + m.Age = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Age |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nested3B) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nested3B: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nested3B: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) + } + m.Age = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Age |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field B4", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.B4 = append(m.B4, &Nested4B{}) + if err := m.B4[len(m.B4)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nested2B) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nested2B: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nested2B: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Fee = float64(math.Float64frombits(v)) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nested", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nested == nil { + m.Nested = &Nested3B{} + } + if err := m.Nested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Route = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nested1B) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nested1B: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nested1B: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nested", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nested == nil { + m.Nested = &Nested2B{} + } + if err := m.Nested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) + } + m.Age = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Age |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Customer3) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Customer3: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Customer3: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Sf", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Sf = float32(math.Float32frombits(v)) + case 4: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Surcharge", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Surcharge = float32(math.Float32frombits(v)) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Destination", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Destination = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreditCardNo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payment = &Customer3_CreditCardNo{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChequeNo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payment = &Customer3_ChequeNo{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Original", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Original == nil { + m.Original = &Customer1{} + } + if err := m.Original.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion1) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestVersion1: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestVersion1: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.A == nil { + m.A = &TestVersion1{} + } + if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.B == nil { + m.B = &TestVersion1{} + } + if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.C = append(m.C, &TestVersion1{}) + if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.D = append(m.D, TestVersion1{}) + if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &TestVersion1_E{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TestVersion1{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &TestVersion1_F{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.G == nil { + m.G = &types.Any{} + } + if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.H = append(m.H, &TestVersion1{}) + if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Customer1 == nil { + m.Customer1 = &Customer1{} + } + if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion2) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestVersion2: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestVersion2: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.A == nil { + m.A = &TestVersion2{} + } + if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.B == nil { + m.B = &TestVersion2{} + } + if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.C = append(m.C, &TestVersion2{}) + if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.D = append(m.D, &TestVersion2{}) + if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &TestVersion2_E{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TestVersion2{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &TestVersion2_F{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.G == nil { + m.G = &types.Any{} + } + if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.H = append(m.H, &TestVersion1{}) + if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Customer1 == nil { + m.Customer1 = &Customer1{} + } + if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 25: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewField", wireType) + } + m.NewField = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NewField |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion3) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestVersion3: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestVersion3: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.A == nil { + m.A = &TestVersion3{} + } + if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.B == nil { + m.B = &TestVersion3{} + } + if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.C = append(m.C, &TestVersion3{}) + if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.D = append(m.D, &TestVersion3{}) + if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &TestVersion3_E{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TestVersion3{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &TestVersion3_F{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.G == nil { + m.G = &types.Any{} + } + if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.H = append(m.H, &TestVersion1{}) + if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Customer1 == nil { + m.Customer1 = &Customer1{} + } + if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1031: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalField", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NonCriticalField = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestVersion3LoneOneOfValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestVersion3LoneOneOfValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.A == nil { + m.A = &TestVersion3{} + } + if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.B == nil { + m.B = &TestVersion3{} + } + if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.C = append(m.C, &TestVersion3{}) + if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.D = append(m.D, &TestVersion3{}) + if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &TestVersion3LoneOneOfValue_E{v} + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.G == nil { + m.G = &types.Any{} + } + if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.H = append(m.H, &TestVersion1{}) + if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Customer1 == nil { + m.Customer1 = &Customer1{} + } + if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1031: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalField", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NonCriticalField = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestVersion3LoneNesting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestVersion3LoneNesting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.A == nil { + m.A = &TestVersion3{} + } + if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.B == nil { + m.B = &TestVersion3{} + } + if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.C = append(m.C, &TestVersion3{}) + if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.D = append(m.D, &TestVersion3{}) + if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TestVersion3LoneNesting{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &TestVersion3LoneNesting_F{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.G == nil { + m.G = &types.Any{} + } + if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.H = append(m.H, &TestVersion1{}) + if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Customer1 == nil { + m.Customer1 = &Customer1{} + } + if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Inner1 == nil { + m.Inner1 = &TestVersion3LoneNesting_Inner1{} + } + if err := m.Inner1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Inner2 == nil { + m.Inner2 = &TestVersion3LoneNesting_Inner2{} + } + if err := m.Inner2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1031: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalField", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NonCriticalField = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Inner1: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Inner1: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Inner == nil { + m.Inner = &TestVersion3LoneNesting_Inner1_InnerInner{} + } + if err := m.Inner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InnerInner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InnerInner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.City = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Inner2: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Inner2: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Country", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Country = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Inner == nil { + m.Inner = &TestVersion3LoneNesting_Inner2_InnerInner{} + } + if err := m.Inner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InnerInner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InnerInner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.City = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestVersion4LoneNesting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestVersion4LoneNesting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.A == nil { + m.A = &TestVersion3{} + } + if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.B == nil { + m.B = &TestVersion3{} + } + if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.C = append(m.C, &TestVersion3{}) + if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.D = append(m.D, &TestVersion3{}) + if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TestVersion3LoneNesting{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &TestVersion4LoneNesting_F{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.G == nil { + m.G = &types.Any{} + } + if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.H = append(m.H, &TestVersion1{}) + if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Customer1 == nil { + m.Customer1 = &Customer1{} + } + if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Inner1 == nil { + m.Inner1 = &TestVersion4LoneNesting_Inner1{} + } + if err := m.Inner1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Inner2 == nil { + m.Inner2 = &TestVersion4LoneNesting_Inner2{} + } + if err := m.Inner2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1031: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalField", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NonCriticalField = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Inner1: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Inner1: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Inner == nil { + m.Inner = &TestVersion4LoneNesting_Inner1_InnerInner{} + } + if err := m.Inner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InnerInner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InnerInner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.City = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Inner2: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Inner2: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Country", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Country = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Inner == nil { + m.Inner = &TestVersion4LoneNesting_Inner2_InnerInner{} + } + if err := m.Inner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InnerInner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InnerInner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestVersionFD1: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestVersionFD1: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.A == nil { + m.A = &TestVersion1{} + } + if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &TestVersionFD1_E{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TestVersion1{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &TestVersionFD1_F{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.G == nil { + m.G = &types.Any{} + } + if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.H = append(m.H, &TestVersion1{}) + if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestVersionFD1WithExtraAny: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestVersionFD1WithExtraAny: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.A == nil { + m.A = &TestVersion1{} + } + if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &TestVersionFD1WithExtraAny_E{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TestVersion1{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &TestVersionFD1WithExtraAny_F{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.G == nil { + m.G = &AnyWithExtra{} + } + if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.H = append(m.H, &TestVersion1{}) + if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AnyWithExtra: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AnyWithExtra: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Any", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Any == nil { + m.Any = &types.Any{} + } + if err := m.Any.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + } + m.B = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.B |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) + } + m.C = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.C |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestUpdatedTxRaw: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestUpdatedTxRaw: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BodyBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BodyBytes = append(m.BodyBytes[:0], dAtA[iNdEx:postIndex]...) + if m.BodyBytes == nil { + m.BodyBytes = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthInfoBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuthInfoBytes = append(m.AuthInfoBytes[:0], dAtA[iNdEx:postIndex]...) + if m.AuthInfoBytes == nil { + m.AuthInfoBytes = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) + copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewField_5", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewField_5 = append(m.NewField_5[:0], dAtA[iNdEx:postIndex]...) + if m.NewField_5 == nil { + m.NewField_5 = []byte{} + } + iNdEx = postIndex + case 1024: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewField_1024", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewField_1024 = append(m.NewField_1024[:0], dAtA[iNdEx:postIndex]...) + if m.NewField_1024 == nil { + m.NewField_1024 = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestUpdatedTxBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestUpdatedTxBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Messages = append(m.Messages, &types.Any{}) + if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Memo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Memo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + m.TimeoutHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SomeNewField", wireType) + } + m.SomeNewField = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SomeNewField |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 1023: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtensionOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtensionOptions = append(m.ExtensionOptions, &types.Any{}) + if err := m.ExtensionOptions[len(m.ExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1050: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SomeNewFieldNonCriticalField", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SomeNewFieldNonCriticalField = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2047: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalExtensionOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &types.Any{}) + if err := m.NonCriticalExtensionOptions[len(m.NonCriticalExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestUpdatedAuthInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestUpdatedAuthInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignerInfos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SignerInfos = append(m.SignerInfos, &tx.SignerInfo{}) + if err := m.SignerInfos[len(m.SignerInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &tx.Fee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewField_3", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewField_3 = append(m.NewField_3[:0], dAtA[iNdEx:postIndex]...) + if m.NewField_3 == nil { + m.NewField_3 = []byte{} + } + iNdEx = postIndex + case 1024: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewField_1024", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewField_1024 = append(m.NewField_1024[:0], dAtA[iNdEx:postIndex]...) + if m.NewField_1024 == nil { + m.NewField_1024 = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestRepeatedUints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestRepeatedUints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Nums = append(m.Nums, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthUnknonwnproto + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthUnknonwnproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Nums) == 0 { + m.Nums = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Nums = append(m.Nums, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Nums", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUnknonwnproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipUnknonwnproto(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowUnknonwnproto + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthUnknonwnproto + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupUnknonwnproto + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthUnknonwnproto + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthUnknonwnproto = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowUnknonwnproto = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupUnknonwnproto = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/testdata/proto.proto b/testutil/testdata/unknonwnproto.proto similarity index 87% rename from testutil/testdata/proto.proto rename to testutil/testdata/unknonwnproto.proto index 154bd92be85f..a11773f92e0e 100644 --- a/testutil/testdata/proto.proto +++ b/testutil/testdata/unknonwnproto.proto @@ -7,72 +7,6 @@ import "cosmos/tx/v1beta1/tx.proto"; option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata"; -message Dog { - string size = 1; - string name = 2; -} - -message Cat { - string moniker = 1; - int32 lives = 2; -} - -message HasAnimal { - google.protobuf.Any animal = 1; - int64 x = 2; -} - -message HasHasAnimal { - google.protobuf.Any has_animal = 1; -} - -message HasHasHasAnimal { - google.protobuf.Any has_has_animal = 1; -} - -service TestService { - rpc Echo(EchoRequest) returns (EchoResponse); - rpc SayHello(SayHelloRequest) returns (SayHelloResponse); - rpc TestAny(TestAnyRequest) returns (TestAnyResponse); -} - -message EchoRequest { - string message = 1; -} - -message EchoResponse { - string message = 1; -} - -message SayHelloRequest { - string name = 1; -} - -message SayHelloResponse { - string greeting = 1; -} - -message TestAnyRequest { - google.protobuf.Any any_animal = 1; -} - -message TestAnyResponse { - HasAnimal has_animal = 1; -} - -// msg type for testing -message TestMsg { - option (gogoproto.goproto_getters) = false; - repeated string signers = 1; -} - -// bad MultiSignature with extra fields -message BadMultiSignature { - option (gogoproto.goproto_unrecognized) = true; - repeated bytes signatures = 1; - bytes malicious_field = 5; -} - message Customer1 { int32 id = 1; string name = 2; diff --git a/types/msg_service.go b/types/msg_service.go new file mode 100644 index 000000000000..26a20d9ddf5e --- /dev/null +++ b/types/msg_service.go @@ -0,0 +1,22 @@ +package types + +import ( + "github.com/gogo/protobuf/proto" +) + +// MsgRequest is the interface a transaction message, defined as a proto +// service method, must fulfill. +type MsgRequest interface { + proto.Message + ValidateBasic() error + GetSigners() []AccAddress +} + +// ServiceMsg is the struct into which an Any whose typeUrl matches a service +// method format (ex. `/cosmos.gov.Msg/SubmitProposal`) unpacks. +type ServiceMsg struct { + // MethodName is the fully-qualified service method name. + MethodName string + // Request is the request payload. + Request MsgRequest +} From 889025bf16b2b29e3e4b94b4d44db01fc5aa7a9b Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 12 Oct 2020 12:09:49 -0400 Subject: [PATCH 03/51] Fix tests --- simapp/app.go | 2 +- types/module/configurator.go | 6 ++++++ types/module/module.go | 6 ++---- types/module/module_test.go | 11 ++++++----- x/ibc/testing/mock/mock.go | 2 +- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index cbb477b9d362..d209aafb7bbb 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -359,7 +359,7 @@ func NewSimApp( app.mm.RegisterInvariants(&app.CrisisKeeper) app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - app.mm.RegisterServices(app.GRPCQueryRouter()) + app.mm.RegisterServices(module.NewConfigurator(app.GRPCQueryRouter())) // add test gRPC service for testing gRPC queries in isolation testdata.RegisterTestServiceServer(app.GRPCQueryRouter(), testdata.TestServiceImpl{}) diff --git a/types/module/configurator.go b/types/module/configurator.go index e720aff240af..efa83607de14 100644 --- a/types/module/configurator.go +++ b/types/module/configurator.go @@ -2,6 +2,10 @@ package module import "github.com/gogo/protobuf/grpc" +// Configurator provides the hooks to allow modules to configure and register +// their services in the RegisterServices method. It is designed to eventually +// support module object capabilities isolation as described in +// https://github.com/cosmos/cosmos-sdk/issues/7093 type Configurator interface { QueryServer() grpc.Server } @@ -10,12 +14,14 @@ type configurator struct { queryServer grpc.Server } +// NewConfigurator returns a new Configurator instance func NewConfigurator(queryServer grpc.Server) Configurator { return configurator{queryServer: queryServer} } var _ Configurator = configurator{} +// QueryServer implements the Configurator.QueryServer method func (c configurator) QueryServer() grpc.Server { return c.queryServer } diff --git a/types/module/module.go b/types/module/module.go index f610bb0dee9c..ec9c1c77b5d3 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -31,7 +31,6 @@ package module import ( "encoding/json" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -207,7 +206,7 @@ func (GenesisOnlyAppModule) QuerierRoute() string { return "" } // LegacyQuerierHandler returns an empty module querier func (gam GenesisOnlyAppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers all gRPC query services. +// RegisterServices registers all services. func (gam GenesisOnlyAppModule) RegisterServices(Configurator) {} // BeginBlock returns an empty module begin-block @@ -289,8 +288,7 @@ func (m *Manager) RegisterRoutes(router sdk.Router, queryRouter sdk.QueryRouter, } // RegisterServices registers all module services -func (m *Manager) RegisterServices(queryRouter grpc.Server) { - cfg := NewConfigurator(queryRouter) +func (m *Manager) RegisterServices(cfg Configurator) { for _, module := range m.Modules { module.RegisterServices(cfg) } diff --git a/types/module/module_test.go b/types/module/module_test.go index 4b265646e596..67eac1695587 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -162,10 +162,10 @@ func TestManager_RegisterRoutes(t *testing.T) { mockAppModule1.EXPECT().QuerierRoute().Times(2).Return("querierRoute1") mockAppModule2.EXPECT().QuerierRoute().Times(1).Return("") handler3 := sdk.Querier(nil) - mockAppModule1.EXPECT().NewQuerierHandler().Times(1).Return(handler3) + amino := codec.NewLegacyAmino() + mockAppModule1.EXPECT().LegacyQuerierHandler(amino).Times(1).Return(handler3) queryRouter.EXPECT().AddRoute(gomock.Eq("querierRoute1"), gomock.Eq(handler3)).Times(1) - amino := codec.NewLegacyAmino() mm.RegisterRoutes(router, queryRouter, amino) } @@ -182,10 +182,11 @@ func TestManager_RegisterQueryServices(t *testing.T) { require.Equal(t, 2, len(mm.Modules)) queryRouter := mocks.NewMockServer(mockCtrl) - mockAppModule1.EXPECT().RegisterServices(queryRouter).Times(1) - mockAppModule2.EXPECT().RegisterServices(queryRouter).Times(1) + cfg := module.NewConfigurator(queryRouter) + mockAppModule1.EXPECT().RegisterServices(cfg).Times(1) + mockAppModule2.EXPECT().RegisterServices(cfg).Times(1) - mm.RegisterServices(queryRouter) + mm.RegisterServices(cfg) } func TestManager_InitGenesis(t *testing.T) { diff --git a/x/ibc/testing/mock/mock.go b/x/ibc/testing/mock/mock.go index f984009e8a74..89ed2a4dd468 100644 --- a/x/ibc/testing/mock/mock.go +++ b/x/ibc/testing/mock/mock.go @@ -103,7 +103,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { } // RegisterQueryService implements the AppModule interface. -func (am AppModule) RegisterServices(server module.Configurator) {} +func (am AppModule) RegisterServices(module.Configurator) {} // InitGenesis implements the AppModule interface. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { From e1482f27db2b0e47f7147c8da3f5d0e2d58d6ec2 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 18:18:57 +0200 Subject: [PATCH 04/51] Add MsgServer --- baseapp/msg_service.go | 8 ++++ baseapp/msg_service_test.go | 46 +++++++++++++++++++ .../testdata/{test_helper.go => codec.go} | 0 testutil/testdata/grpc_query.go | 4 +- testutil/testdata/msg_service.go | 14 ++++-- testutil/testdata/{test_tx.go => tx.go} | 0 types/module/configurator.go | 18 ++++++-- 7 files changed, 80 insertions(+), 10 deletions(-) create mode 100644 baseapp/msg_service.go create mode 100644 baseapp/msg_service_test.go rename testutil/testdata/{test_helper.go => codec.go} (100%) rename testutil/testdata/{test_tx.go => tx.go} (100%) diff --git a/baseapp/msg_service.go b/baseapp/msg_service.go new file mode 100644 index 000000000000..091449fa9640 --- /dev/null +++ b/baseapp/msg_service.go @@ -0,0 +1,8 @@ +package baseapp + +// NewMsgServiceRouter creates a new MsgServiceRouter. +func NewMsgServiceRouter() *GRPCQueryRouter { + return &GRPCQueryRouter{ + routes: map[string]GRPCQueryHandler{}, + } +} diff --git a/baseapp/msg_service_test.go b/baseapp/msg_service_test.go new file mode 100644 index 000000000000..8bb3e0e88226 --- /dev/null +++ b/baseapp/msg_service_test.go @@ -0,0 +1,46 @@ +package baseapp + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func TestMessageService(t *testing.T) { + qr := NewGRPCQueryRouter() + interfaceRegistry := testdata.NewTestInterfaceRegistry() + qr.SetInterfaceRegistry(interfaceRegistry) + testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) + helper := &QueryServiceTestHelper{ + GRPCQueryRouter: qr, + ctx: sdk.Context{}.WithContext(context.Background()), + } + client := testdata.NewQueryClient(helper) + + res, err := client.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) + require.Nil(t, err) + require.NotNil(t, res) + require.Equal(t, "hello", res.Message) + + require.Panics(t, func() { + _, _ = client.Echo(context.Background(), nil) + }) + + res2, err := client.SayHello(context.Background(), &testdata.SayHelloRequest{Name: "Foo"}) + require.Nil(t, err) + require.NotNil(t, res) + require.Equal(t, "Hello Foo!", res2.Greeting) + + spot := &testdata.Dog{Name: "Spot", Size_: "big"} + any, err := types.NewAnyWithValue(spot) + require.NoError(t, err) + res3, err := client.TestAny(context.Background(), &testdata.TestAnyRequest{AnyAnimal: any}) + require.NoError(t, err) + require.NotNil(t, res3) + require.Equal(t, spot, res3.HasAnimal.Animal.GetCachedValue()) +} diff --git a/testutil/testdata/test_helper.go b/testutil/testdata/codec.go similarity index 100% rename from testutil/testdata/test_helper.go rename to testutil/testdata/codec.go diff --git a/testutil/testdata/grpc_query.go b/testutil/testdata/grpc_query.go index c80a61594f9b..4e517026c80f 100644 --- a/testutil/testdata/grpc_query.go +++ b/testutil/testdata/grpc_query.go @@ -11,6 +11,8 @@ import ( type QueryImpl struct{} +var _ QueryServer = QueryImpl + func (e QueryImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) { animal, ok := request.AnyAnimal.GetCachedValue().(Animal) if !ok { @@ -37,8 +39,6 @@ func (e QueryImpl) SayHello(_ context.Context, request *SayHelloRequest) (*SayHe return &SayHelloResponse{Greeting: greeting}, nil } -var _ QueryServer = QueryImpl{} - var _ types.UnpackInterfacesMessage = &TestAnyRequest{} func (m *TestAnyRequest) UnpackInterfaces(unpacker types.AnyUnpacker) error { diff --git a/testutil/testdata/msg_service.go b/testutil/testdata/msg_service.go index c63067481660..17115ab5ad5b 100644 --- a/testutil/testdata/msg_service.go +++ b/testutil/testdata/msg_service.go @@ -2,9 +2,15 @@ package testdata import ( "context" - "fmt" +) - "github.com/gogo/protobuf/proto" +type MsgImpl struct{} - "github.com/cosmos/cosmos-sdk/codec/types" -) +var _ MsgServer = MsgImpl + +// CreateDog implements the MsgServer interface. +func (m MsgImpl) CreateDog(_ context.Context, msg *MsgCreateDog) (*MsgCreateDogResponse, error) { + return &MsgCreateDogResponse{ + Name: msg.Dog.Name, + } +} diff --git a/testutil/testdata/test_tx.go b/testutil/testdata/tx.go similarity index 100% rename from testutil/testdata/test_tx.go rename to testutil/testdata/tx.go diff --git a/types/module/configurator.go b/types/module/configurator.go index efa83607de14..5f35cfede57f 100644 --- a/types/module/configurator.go +++ b/types/module/configurator.go @@ -8,20 +8,30 @@ import "github.com/gogo/protobuf/grpc" // https://github.com/cosmos/cosmos-sdk/issues/7093 type Configurator interface { QueryServer() grpc.Server + MsgServer() grpc.Server } type configurator struct { queryServer grpc.Server + msgServer grpc.Server } -// NewConfigurator returns a new Configurator instance -func NewConfigurator(queryServer grpc.Server) Configurator { - return configurator{queryServer: queryServer} +// NewConfigurator returns a new Configurator instance. +func NewConfigurator(queryServer grpc.Server, msgServer grpc.Server) Configurator { + return configurator{ + queryServer: queryServer, + msgServer: msgServer, + } } var _ Configurator = configurator{} -// QueryServer implements the Configurator.QueryServer method +// QueryServer implements the Configurator.QueryServer method. func (c configurator) QueryServer() grpc.Server { return c.queryServer } + +// QueryServer implements the Configurator.MsgServer method. +func (c configurator) MsgServer() grpc.Server { + return c.msgServer +} From 6c77f06da78f14403eac8b1b1b7001c12db45edb Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 18:27:17 +0200 Subject: [PATCH 05/51] Fix lint --- baseapp/msg_service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/baseapp/msg_service.go b/baseapp/msg_service.go index 091449fa9640..c46c00ae97bd 100644 --- a/baseapp/msg_service.go +++ b/baseapp/msg_service.go @@ -1,8 +1,8 @@ package baseapp +type MsgServiceRouter struct{} + // NewMsgServiceRouter creates a new MsgServiceRouter. -func NewMsgServiceRouter() *GRPCQueryRouter { - return &GRPCQueryRouter{ - routes: map[string]GRPCQueryHandler{}, - } +func NewMsgServiceRouter() *MsgServiceRouter { + return &MsgServiceRouter{} } From c746a2b477c404c91af305d02bd15ea7b6aab0ed Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 18:30:41 +0200 Subject: [PATCH 06/51] Remove MsgServer from configurator for now --- baseapp/msg_service_test.go | 39 +----------------------------------- types/module/configurator.go | 18 ++++------------- 2 files changed, 5 insertions(+), 52 deletions(-) diff --git a/baseapp/msg_service_test.go b/baseapp/msg_service_test.go index 8bb3e0e88226..693946491010 100644 --- a/baseapp/msg_service_test.go +++ b/baseapp/msg_service_test.go @@ -1,46 +1,9 @@ package baseapp import ( - "context" "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" ) func TestMessageService(t *testing.T) { - qr := NewGRPCQueryRouter() - interfaceRegistry := testdata.NewTestInterfaceRegistry() - qr.SetInterfaceRegistry(interfaceRegistry) - testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) - helper := &QueryServiceTestHelper{ - GRPCQueryRouter: qr, - ctx: sdk.Context{}.WithContext(context.Background()), - } - client := testdata.NewQueryClient(helper) - - res, err := client.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) - require.Nil(t, err) - require.NotNil(t, res) - require.Equal(t, "hello", res.Message) - - require.Panics(t, func() { - _, _ = client.Echo(context.Background(), nil) - }) - - res2, err := client.SayHello(context.Background(), &testdata.SayHelloRequest{Name: "Foo"}) - require.Nil(t, err) - require.NotNil(t, res) - require.Equal(t, "Hello Foo!", res2.Greeting) - - spot := &testdata.Dog{Name: "Spot", Size_: "big"} - any, err := types.NewAnyWithValue(spot) - require.NoError(t, err) - res3, err := client.TestAny(context.Background(), &testdata.TestAnyRequest{AnyAnimal: any}) - require.NoError(t, err) - require.NotNil(t, res3) - require.Equal(t, spot, res3.HasAnimal.Animal.GetCachedValue()) + // TODO } diff --git a/types/module/configurator.go b/types/module/configurator.go index 5f35cfede57f..efa83607de14 100644 --- a/types/module/configurator.go +++ b/types/module/configurator.go @@ -8,30 +8,20 @@ import "github.com/gogo/protobuf/grpc" // https://github.com/cosmos/cosmos-sdk/issues/7093 type Configurator interface { QueryServer() grpc.Server - MsgServer() grpc.Server } type configurator struct { queryServer grpc.Server - msgServer grpc.Server } -// NewConfigurator returns a new Configurator instance. -func NewConfigurator(queryServer grpc.Server, msgServer grpc.Server) Configurator { - return configurator{ - queryServer: queryServer, - msgServer: msgServer, - } +// NewConfigurator returns a new Configurator instance +func NewConfigurator(queryServer grpc.Server) Configurator { + return configurator{queryServer: queryServer} } var _ Configurator = configurator{} -// QueryServer implements the Configurator.QueryServer method. +// QueryServer implements the Configurator.QueryServer method func (c configurator) QueryServer() grpc.Server { return c.queryServer } - -// QueryServer implements the Configurator.MsgServer method. -func (c configurator) MsgServer() grpc.Server { - return c.msgServer -} From 59ebc3b4785c962c4688b67583aa674daad55d59 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 18:36:07 +0200 Subject: [PATCH 07/51] Remove useless file --- testutil/testdata/proto.pb.go | 14664 -------------------------------- 1 file changed, 14664 deletions(-) delete mode 100644 testutil/testdata/proto.pb.go diff --git a/testutil/testdata/proto.pb.go b/testutil/testdata/proto.pb.go deleted file mode 100644 index a43d6b6e8f67..000000000000 --- a/testutil/testdata/proto.pb.go +++ /dev/null @@ -1,14664 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: proto.proto - -package testdata - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" - tx "github.com/cosmos/cosmos-sdk/types/tx" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Customer2_City int32 - -const ( - Customer2_Laos Customer2_City = 0 - Customer2_LosAngeles Customer2_City = 1 - Customer2_PaloAlto Customer2_City = 2 - Customer2_Moscow Customer2_City = 3 - Customer2_Nairobi Customer2_City = 4 -) - -var Customer2_City_name = map[int32]string{ - 0: "Laos", - 1: "LosAngeles", - 2: "PaloAlto", - 3: "Moscow", - 4: "Nairobi", -} - -var Customer2_City_value = map[string]int32{ - "Laos": 0, - "LosAngeles": 1, - "PaloAlto": 2, - "Moscow": 3, - "Nairobi": 4, -} - -func (x Customer2_City) String() string { - return proto.EnumName(Customer2_City_name, int32(x)) -} - -func (Customer2_City) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{8, 0} -} - -type Dog struct { - Size_ string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *Dog) Reset() { *m = Dog{} } -func (m *Dog) String() string { return proto.CompactTextString(m) } -func (*Dog) ProtoMessage() {} -func (*Dog) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{0} -} -func (m *Dog) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Dog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Dog.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Dog) XXX_Merge(src proto.Message) { - xxx_messageInfo_Dog.Merge(m, src) -} -func (m *Dog) XXX_Size() int { - return m.Size() -} -func (m *Dog) XXX_DiscardUnknown() { - xxx_messageInfo_Dog.DiscardUnknown(m) -} - -var xxx_messageInfo_Dog proto.InternalMessageInfo - -func (m *Dog) GetSize_() string { - if m != nil { - return m.Size_ - } - return "" -} - -func (m *Dog) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Cat struct { - Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` - Lives int32 `protobuf:"varint,2,opt,name=lives,proto3" json:"lives,omitempty"` -} - -func (m *Cat) Reset() { *m = Cat{} } -func (m *Cat) String() string { return proto.CompactTextString(m) } -func (*Cat) ProtoMessage() {} -func (*Cat) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{1} -} -func (m *Cat) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Cat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Cat.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Cat) XXX_Merge(src proto.Message) { - xxx_messageInfo_Cat.Merge(m, src) -} -func (m *Cat) XXX_Size() int { - return m.Size() -} -func (m *Cat) XXX_DiscardUnknown() { - xxx_messageInfo_Cat.DiscardUnknown(m) -} - -var xxx_messageInfo_Cat proto.InternalMessageInfo - -func (m *Cat) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *Cat) GetLives() int32 { - if m != nil { - return m.Lives - } - return 0 -} - -type HasAnimal struct { - Animal *types.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"` - X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` -} - -func (m *HasAnimal) Reset() { *m = HasAnimal{} } -func (m *HasAnimal) String() string { return proto.CompactTextString(m) } -func (*HasAnimal) ProtoMessage() {} -func (*HasAnimal) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{2} -} -func (m *HasAnimal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HasAnimal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HasAnimal) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasAnimal.Merge(m, src) -} -func (m *HasAnimal) XXX_Size() int { - return m.Size() -} -func (m *HasAnimal) XXX_DiscardUnknown() { - xxx_messageInfo_HasAnimal.DiscardUnknown(m) -} - -var xxx_messageInfo_HasAnimal proto.InternalMessageInfo - -func (m *HasAnimal) GetAnimal() *types.Any { - if m != nil { - return m.Animal - } - return nil -} - -func (m *HasAnimal) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -type HasHasAnimal struct { - HasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` -} - -func (m *HasHasAnimal) Reset() { *m = HasHasAnimal{} } -func (m *HasHasAnimal) String() string { return proto.CompactTextString(m) } -func (*HasHasAnimal) ProtoMessage() {} -func (*HasHasAnimal) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{3} -} -func (m *HasHasAnimal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HasHasAnimal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HasHasAnimal) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasHasAnimal.Merge(m, src) -} -func (m *HasHasAnimal) XXX_Size() int { - return m.Size() -} -func (m *HasHasAnimal) XXX_DiscardUnknown() { - xxx_messageInfo_HasHasAnimal.DiscardUnknown(m) -} - -var xxx_messageInfo_HasHasAnimal proto.InternalMessageInfo - -func (m *HasHasAnimal) GetHasAnimal() *types.Any { - if m != nil { - return m.HasAnimal - } - return nil -} - -type HasHasHasAnimal struct { - HasHasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` -} - -func (m *HasHasHasAnimal) Reset() { *m = HasHasHasAnimal{} } -func (m *HasHasHasAnimal) String() string { return proto.CompactTextString(m) } -func (*HasHasHasAnimal) ProtoMessage() {} -func (*HasHasHasAnimal) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{4} -} -func (m *HasHasHasAnimal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HasHasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HasHasHasAnimal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HasHasHasAnimal) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasHasHasAnimal.Merge(m, src) -} -func (m *HasHasHasAnimal) XXX_Size() int { - return m.Size() -} -func (m *HasHasHasAnimal) XXX_DiscardUnknown() { - xxx_messageInfo_HasHasHasAnimal.DiscardUnknown(m) -} - -var xxx_messageInfo_HasHasHasAnimal proto.InternalMessageInfo - -func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any { - if m != nil { - return m.HasHasAnimal - } - return nil -} - -// msg type for testing -type TestMsg struct { - Signers []string `protobuf:"bytes,1,rep,name=signers,proto3" json:"signers,omitempty"` -} - -func (m *TestMsg) Reset() { *m = TestMsg{} } -func (m *TestMsg) String() string { return proto.CompactTextString(m) } -func (*TestMsg) ProtoMessage() {} -func (*TestMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{5} -} -func (m *TestMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestMsg.Merge(m, src) -} -func (m *TestMsg) XXX_Size() int { - return m.Size() -} -func (m *TestMsg) XXX_DiscardUnknown() { - xxx_messageInfo_TestMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_TestMsg proto.InternalMessageInfo - -// bad MultiSignature with extra fields -type BadMultiSignature struct { - Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` - MaliciousField []byte `protobuf:"bytes,5,opt,name=malicious_field,json=maliciousField,proto3" json:"malicious_field,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *BadMultiSignature) Reset() { *m = BadMultiSignature{} } -func (m *BadMultiSignature) String() string { return proto.CompactTextString(m) } -func (*BadMultiSignature) ProtoMessage() {} -func (*BadMultiSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{6} -} -func (m *BadMultiSignature) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BadMultiSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BadMultiSignature.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BadMultiSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_BadMultiSignature.Merge(m, src) -} -func (m *BadMultiSignature) XXX_Size() int { - return m.Size() -} -func (m *BadMultiSignature) XXX_DiscardUnknown() { - xxx_messageInfo_BadMultiSignature.DiscardUnknown(m) -} - -var xxx_messageInfo_BadMultiSignature proto.InternalMessageInfo - -func (m *BadMultiSignature) GetSignatures() [][]byte { - if m != nil { - return m.Signatures - } - return nil -} - -func (m *BadMultiSignature) GetMaliciousField() []byte { - if m != nil { - return m.MaliciousField - } - return nil -} - -type Customer1 struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - SubscriptionFee float32 `protobuf:"fixed32,3,opt,name=subscription_fee,json=subscriptionFee,proto3" json:"subscription_fee,omitempty"` - Payment string `protobuf:"bytes,7,opt,name=payment,proto3" json:"payment,omitempty"` -} - -func (m *Customer1) Reset() { *m = Customer1{} } -func (m *Customer1) String() string { return proto.CompactTextString(m) } -func (*Customer1) ProtoMessage() {} -func (*Customer1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{7} -} -func (m *Customer1) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Customer1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Customer1.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Customer1) XXX_Merge(src proto.Message) { - xxx_messageInfo_Customer1.Merge(m, src) -} -func (m *Customer1) XXX_Size() int { - return m.Size() -} -func (m *Customer1) XXX_DiscardUnknown() { - xxx_messageInfo_Customer1.DiscardUnknown(m) -} - -var xxx_messageInfo_Customer1 proto.InternalMessageInfo - -func (m *Customer1) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Customer1) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Customer1) GetSubscriptionFee() float32 { - if m != nil { - return m.SubscriptionFee - } - return 0 -} - -func (m *Customer1) GetPayment() string { - if m != nil { - return m.Payment - } - return "" -} - -type Customer2 struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Industry int32 `protobuf:"varint,2,opt,name=industry,proto3" json:"industry,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Fewer float32 `protobuf:"fixed32,4,opt,name=fewer,proto3" json:"fewer,omitempty"` - Reserved int64 `protobuf:"varint,1047,opt,name=reserved,proto3" json:"reserved,omitempty"` - City Customer2_City `protobuf:"varint,6,opt,name=city,proto3,enum=testdata.Customer2_City" json:"city,omitempty"` - Miscellaneous *types.Any `protobuf:"bytes,10,opt,name=miscellaneous,proto3" json:"miscellaneous,omitempty"` -} - -func (m *Customer2) Reset() { *m = Customer2{} } -func (m *Customer2) String() string { return proto.CompactTextString(m) } -func (*Customer2) ProtoMessage() {} -func (*Customer2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{8} -} -func (m *Customer2) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Customer2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Customer2.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Customer2) XXX_Merge(src proto.Message) { - xxx_messageInfo_Customer2.Merge(m, src) -} -func (m *Customer2) XXX_Size() int { - return m.Size() -} -func (m *Customer2) XXX_DiscardUnknown() { - xxx_messageInfo_Customer2.DiscardUnknown(m) -} - -var xxx_messageInfo_Customer2 proto.InternalMessageInfo - -func (m *Customer2) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Customer2) GetIndustry() int32 { - if m != nil { - return m.Industry - } - return 0 -} - -func (m *Customer2) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Customer2) GetFewer() float32 { - if m != nil { - return m.Fewer - } - return 0 -} - -func (m *Customer2) GetReserved() int64 { - if m != nil { - return m.Reserved - } - return 0 -} - -func (m *Customer2) GetCity() Customer2_City { - if m != nil { - return m.City - } - return Customer2_Laos -} - -func (m *Customer2) GetMiscellaneous() *types.Any { - if m != nil { - return m.Miscellaneous - } - return nil -} - -type Nested4A struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *Nested4A) Reset() { *m = Nested4A{} } -func (m *Nested4A) String() string { return proto.CompactTextString(m) } -func (*Nested4A) ProtoMessage() {} -func (*Nested4A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{9} -} -func (m *Nested4A) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Nested4A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Nested4A.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Nested4A) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested4A.Merge(m, src) -} -func (m *Nested4A) XXX_Size() int { - return m.Size() -} -func (m *Nested4A) XXX_DiscardUnknown() { - xxx_messageInfo_Nested4A.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested4A proto.InternalMessageInfo - -func (m *Nested4A) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Nested4A) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Nested3A struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - A4 []*Nested4A `protobuf:"bytes,4,rep,name=a4,proto3" json:"a4,omitempty"` - Index map[int64]*Nested4A `protobuf:"bytes,5,rep,name=index,proto3" json:"index,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *Nested3A) Reset() { *m = Nested3A{} } -func (m *Nested3A) String() string { return proto.CompactTextString(m) } -func (*Nested3A) ProtoMessage() {} -func (*Nested3A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{10} -} -func (m *Nested3A) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Nested3A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Nested3A.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Nested3A) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested3A.Merge(m, src) -} -func (m *Nested3A) XXX_Size() int { - return m.Size() -} -func (m *Nested3A) XXX_DiscardUnknown() { - xxx_messageInfo_Nested3A.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested3A proto.InternalMessageInfo - -func (m *Nested3A) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Nested3A) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Nested3A) GetA4() []*Nested4A { - if m != nil { - return m.A4 - } - return nil -} - -func (m *Nested3A) GetIndex() map[int64]*Nested4A { - if m != nil { - return m.Index - } - return nil -} - -type Nested2A struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Nested *Nested3A `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"` -} - -func (m *Nested2A) Reset() { *m = Nested2A{} } -func (m *Nested2A) String() string { return proto.CompactTextString(m) } -func (*Nested2A) ProtoMessage() {} -func (*Nested2A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{11} -} -func (m *Nested2A) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Nested2A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Nested2A.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Nested2A) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested2A.Merge(m, src) -} -func (m *Nested2A) XXX_Size() int { - return m.Size() -} -func (m *Nested2A) XXX_DiscardUnknown() { - xxx_messageInfo_Nested2A.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested2A proto.InternalMessageInfo - -func (m *Nested2A) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Nested2A) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Nested2A) GetNested() *Nested3A { - if m != nil { - return m.Nested - } - return nil -} - -type Nested1A struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Nested *Nested2A `protobuf:"bytes,2,opt,name=nested,proto3" json:"nested,omitempty"` -} - -func (m *Nested1A) Reset() { *m = Nested1A{} } -func (m *Nested1A) String() string { return proto.CompactTextString(m) } -func (*Nested1A) ProtoMessage() {} -func (*Nested1A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{12} -} -func (m *Nested1A) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Nested1A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Nested1A.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Nested1A) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested1A.Merge(m, src) -} -func (m *Nested1A) XXX_Size() int { - return m.Size() -} -func (m *Nested1A) XXX_DiscardUnknown() { - xxx_messageInfo_Nested1A.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested1A proto.InternalMessageInfo - -func (m *Nested1A) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Nested1A) GetNested() *Nested2A { - if m != nil { - return m.Nested - } - return nil -} - -type Nested4B struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *Nested4B) Reset() { *m = Nested4B{} } -func (m *Nested4B) String() string { return proto.CompactTextString(m) } -func (*Nested4B) ProtoMessage() {} -func (*Nested4B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{13} -} -func (m *Nested4B) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Nested4B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Nested4B.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Nested4B) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested4B.Merge(m, src) -} -func (m *Nested4B) XXX_Size() int { - return m.Size() -} -func (m *Nested4B) XXX_DiscardUnknown() { - xxx_messageInfo_Nested4B.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested4B proto.InternalMessageInfo - -func (m *Nested4B) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Nested4B) GetAge() int32 { - if m != nil { - return m.Age - } - return 0 -} - -func (m *Nested4B) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Nested3B struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - B4 []*Nested4B `protobuf:"bytes,4,rep,name=b4,proto3" json:"b4,omitempty"` -} - -func (m *Nested3B) Reset() { *m = Nested3B{} } -func (m *Nested3B) String() string { return proto.CompactTextString(m) } -func (*Nested3B) ProtoMessage() {} -func (*Nested3B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{14} -} -func (m *Nested3B) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Nested3B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Nested3B.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Nested3B) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested3B.Merge(m, src) -} -func (m *Nested3B) XXX_Size() int { - return m.Size() -} -func (m *Nested3B) XXX_DiscardUnknown() { - xxx_messageInfo_Nested3B.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested3B proto.InternalMessageInfo - -func (m *Nested3B) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Nested3B) GetAge() int32 { - if m != nil { - return m.Age - } - return 0 -} - -func (m *Nested3B) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Nested3B) GetB4() []*Nested4B { - if m != nil { - return m.B4 - } - return nil -} - -type Nested2B struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Fee float64 `protobuf:"fixed64,2,opt,name=fee,proto3" json:"fee,omitempty"` - Nested *Nested3B `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"` - Route string `protobuf:"bytes,4,opt,name=route,proto3" json:"route,omitempty"` -} - -func (m *Nested2B) Reset() { *m = Nested2B{} } -func (m *Nested2B) String() string { return proto.CompactTextString(m) } -func (*Nested2B) ProtoMessage() {} -func (*Nested2B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{15} -} -func (m *Nested2B) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Nested2B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Nested2B.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Nested2B) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested2B.Merge(m, src) -} -func (m *Nested2B) XXX_Size() int { - return m.Size() -} -func (m *Nested2B) XXX_DiscardUnknown() { - xxx_messageInfo_Nested2B.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested2B proto.InternalMessageInfo - -func (m *Nested2B) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Nested2B) GetFee() float64 { - if m != nil { - return m.Fee - } - return 0 -} - -func (m *Nested2B) GetNested() *Nested3B { - if m != nil { - return m.Nested - } - return nil -} - -func (m *Nested2B) GetRoute() string { - if m != nil { - return m.Route - } - return "" -} - -type Nested1B struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Nested *Nested2B `protobuf:"bytes,2,opt,name=nested,proto3" json:"nested,omitempty"` - Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` -} - -func (m *Nested1B) Reset() { *m = Nested1B{} } -func (m *Nested1B) String() string { return proto.CompactTextString(m) } -func (*Nested1B) ProtoMessage() {} -func (*Nested1B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{16} -} -func (m *Nested1B) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Nested1B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Nested1B.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Nested1B) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested1B.Merge(m, src) -} -func (m *Nested1B) XXX_Size() int { - return m.Size() -} -func (m *Nested1B) XXX_DiscardUnknown() { - xxx_messageInfo_Nested1B.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested1B proto.InternalMessageInfo - -func (m *Nested1B) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Nested1B) GetNested() *Nested2B { - if m != nil { - return m.Nested - } - return nil -} - -func (m *Nested1B) GetAge() int32 { - if m != nil { - return m.Age - } - return 0 -} - -type Customer3 struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Sf float32 `protobuf:"fixed32,3,opt,name=sf,proto3" json:"sf,omitempty"` - Surcharge float32 `protobuf:"fixed32,4,opt,name=surcharge,proto3" json:"surcharge,omitempty"` - Destination string `protobuf:"bytes,5,opt,name=destination,proto3" json:"destination,omitempty"` - // Types that are valid to be assigned to Payment: - // *Customer3_CreditCardNo - // *Customer3_ChequeNo - Payment isCustomer3_Payment `protobuf_oneof:"payment"` - Original *Customer1 `protobuf:"bytes,9,opt,name=original,proto3" json:"original,omitempty"` -} - -func (m *Customer3) Reset() { *m = Customer3{} } -func (m *Customer3) String() string { return proto.CompactTextString(m) } -func (*Customer3) ProtoMessage() {} -func (*Customer3) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{17} -} -func (m *Customer3) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Customer3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Customer3.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Customer3) XXX_Merge(src proto.Message) { - xxx_messageInfo_Customer3.Merge(m, src) -} -func (m *Customer3) XXX_Size() int { - return m.Size() -} -func (m *Customer3) XXX_DiscardUnknown() { - xxx_messageInfo_Customer3.DiscardUnknown(m) -} - -var xxx_messageInfo_Customer3 proto.InternalMessageInfo - -type isCustomer3_Payment interface { - isCustomer3_Payment() - MarshalTo([]byte) (int, error) - Size() int -} - -type Customer3_CreditCardNo struct { - CreditCardNo string `protobuf:"bytes,7,opt,name=credit_card_no,json=creditCardNo,proto3,oneof" json:"credit_card_no,omitempty"` -} -type Customer3_ChequeNo struct { - ChequeNo string `protobuf:"bytes,8,opt,name=cheque_no,json=chequeNo,proto3,oneof" json:"cheque_no,omitempty"` -} - -func (*Customer3_CreditCardNo) isCustomer3_Payment() {} -func (*Customer3_ChequeNo) isCustomer3_Payment() {} - -func (m *Customer3) GetPayment() isCustomer3_Payment { - if m != nil { - return m.Payment - } - return nil -} - -func (m *Customer3) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Customer3) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Customer3) GetSf() float32 { - if m != nil { - return m.Sf - } - return 0 -} - -func (m *Customer3) GetSurcharge() float32 { - if m != nil { - return m.Surcharge - } - return 0 -} - -func (m *Customer3) GetDestination() string { - if m != nil { - return m.Destination - } - return "" -} - -func (m *Customer3) GetCreditCardNo() string { - if x, ok := m.GetPayment().(*Customer3_CreditCardNo); ok { - return x.CreditCardNo - } - return "" -} - -func (m *Customer3) GetChequeNo() string { - if x, ok := m.GetPayment().(*Customer3_ChequeNo); ok { - return x.ChequeNo - } - return "" -} - -func (m *Customer3) GetOriginal() *Customer1 { - if m != nil { - return m.Original - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Customer3) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Customer3_CreditCardNo)(nil), - (*Customer3_ChequeNo)(nil), - } -} - -type TestVersion1 struct { - X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` - B *TestVersion1 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` - C []*TestVersion1 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` - D []TestVersion1 `protobuf:"bytes,5,rep,name=d,proto3" json:"d"` - // Types that are valid to be assigned to Sum: - // *TestVersion1_E - // *TestVersion1_F - Sum isTestVersion1_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` - H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` - // google.protobuf.Timestamp i = 10; - // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; - *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` -} - -func (m *TestVersion1) Reset() { *m = TestVersion1{} } -func (m *TestVersion1) String() string { return proto.CompactTextString(m) } -func (*TestVersion1) ProtoMessage() {} -func (*TestVersion1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{18} -} -func (m *TestVersion1) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion1.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion1) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion1.Merge(m, src) -} -func (m *TestVersion1) XXX_Size() int { - return m.Size() -} -func (m *TestVersion1) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion1.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion1 proto.InternalMessageInfo - -type isTestVersion1_Sum interface { - isTestVersion1_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type TestVersion1_E struct { - E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` -} -type TestVersion1_F struct { - F *TestVersion1 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` -} - -func (*TestVersion1_E) isTestVersion1_Sum() {} -func (*TestVersion1_F) isTestVersion1_Sum() {} - -func (m *TestVersion1) GetSum() isTestVersion1_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *TestVersion1) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersion1) GetA() *TestVersion1 { - if m != nil { - return m.A - } - return nil -} - -func (m *TestVersion1) GetB() *TestVersion1 { - if m != nil { - return m.B - } - return nil -} - -func (m *TestVersion1) GetC() []*TestVersion1 { - if m != nil { - return m.C - } - return nil -} - -func (m *TestVersion1) GetD() []TestVersion1 { - if m != nil { - return m.D - } - return nil -} - -func (m *TestVersion1) GetE() int32 { - if x, ok := m.GetSum().(*TestVersion1_E); ok { - return x.E - } - return 0 -} - -func (m *TestVersion1) GetF() *TestVersion1 { - if x, ok := m.GetSum().(*TestVersion1_F); ok { - return x.F - } - return nil -} - -func (m *TestVersion1) GetG() *types.Any { - if m != nil { - return m.G - } - return nil -} - -func (m *TestVersion1) GetH() []*TestVersion1 { - if m != nil { - return m.H - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersion1) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersion1_E)(nil), - (*TestVersion1_F)(nil), - } -} - -type TestVersion2 struct { - X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - A *TestVersion2 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` - B *TestVersion2 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` - C []*TestVersion2 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` - D []*TestVersion2 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` - // Types that are valid to be assigned to Sum: - // *TestVersion2_E - // *TestVersion2_F - Sum isTestVersion2_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` - H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` - // google.protobuf.Timestamp i = 10; - // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; - *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` - NewField uint64 `protobuf:"varint,25,opt,name=new_field,json=newField,proto3" json:"new_field,omitempty"` -} - -func (m *TestVersion2) Reset() { *m = TestVersion2{} } -func (m *TestVersion2) String() string { return proto.CompactTextString(m) } -func (*TestVersion2) ProtoMessage() {} -func (*TestVersion2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{19} -} -func (m *TestVersion2) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion2.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion2) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion2.Merge(m, src) -} -func (m *TestVersion2) XXX_Size() int { - return m.Size() -} -func (m *TestVersion2) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion2.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion2 proto.InternalMessageInfo - -type isTestVersion2_Sum interface { - isTestVersion2_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type TestVersion2_E struct { - E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` -} -type TestVersion2_F struct { - F *TestVersion2 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` -} - -func (*TestVersion2_E) isTestVersion2_Sum() {} -func (*TestVersion2_F) isTestVersion2_Sum() {} - -func (m *TestVersion2) GetSum() isTestVersion2_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *TestVersion2) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersion2) GetA() *TestVersion2 { - if m != nil { - return m.A - } - return nil -} - -func (m *TestVersion2) GetB() *TestVersion2 { - if m != nil { - return m.B - } - return nil -} - -func (m *TestVersion2) GetC() []*TestVersion2 { - if m != nil { - return m.C - } - return nil -} - -func (m *TestVersion2) GetD() []*TestVersion2 { - if m != nil { - return m.D - } - return nil -} - -func (m *TestVersion2) GetE() int32 { - if x, ok := m.GetSum().(*TestVersion2_E); ok { - return x.E - } - return 0 -} - -func (m *TestVersion2) GetF() *TestVersion2 { - if x, ok := m.GetSum().(*TestVersion2_F); ok { - return x.F - } - return nil -} - -func (m *TestVersion2) GetG() *types.Any { - if m != nil { - return m.G - } - return nil -} - -func (m *TestVersion2) GetH() []*TestVersion1 { - if m != nil { - return m.H - } - return nil -} - -func (m *TestVersion2) GetNewField() uint64 { - if m != nil { - return m.NewField - } - return 0 -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersion2) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersion2_E)(nil), - (*TestVersion2_F)(nil), - } -} - -type TestVersion3 struct { - X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - A *TestVersion3 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` - B *TestVersion3 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` - C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` - D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` - // Types that are valid to be assigned to Sum: - // *TestVersion3_E - // *TestVersion3_F - Sum isTestVersion3_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` - H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` - // google.protobuf.Timestamp i = 10; - // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; - *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` - NonCriticalField string `protobuf:"bytes,1031,opt,name=non_critical_field,json=nonCriticalField,proto3" json:"non_critical_field,omitempty"` -} - -func (m *TestVersion3) Reset() { *m = TestVersion3{} } -func (m *TestVersion3) String() string { return proto.CompactTextString(m) } -func (*TestVersion3) ProtoMessage() {} -func (*TestVersion3) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{20} -} -func (m *TestVersion3) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion3.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion3) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3.Merge(m, src) -} -func (m *TestVersion3) XXX_Size() int { - return m.Size() -} -func (m *TestVersion3) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion3 proto.InternalMessageInfo - -type isTestVersion3_Sum interface { - isTestVersion3_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type TestVersion3_E struct { - E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` -} -type TestVersion3_F struct { - F *TestVersion3 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` -} - -func (*TestVersion3_E) isTestVersion3_Sum() {} -func (*TestVersion3_F) isTestVersion3_Sum() {} - -func (m *TestVersion3) GetSum() isTestVersion3_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *TestVersion3) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersion3) GetA() *TestVersion3 { - if m != nil { - return m.A - } - return nil -} - -func (m *TestVersion3) GetB() *TestVersion3 { - if m != nil { - return m.B - } - return nil -} - -func (m *TestVersion3) GetC() []*TestVersion3 { - if m != nil { - return m.C - } - return nil -} - -func (m *TestVersion3) GetD() []*TestVersion3 { - if m != nil { - return m.D - } - return nil -} - -func (m *TestVersion3) GetE() int32 { - if x, ok := m.GetSum().(*TestVersion3_E); ok { - return x.E - } - return 0 -} - -func (m *TestVersion3) GetF() *TestVersion3 { - if x, ok := m.GetSum().(*TestVersion3_F); ok { - return x.F - } - return nil -} - -func (m *TestVersion3) GetG() *types.Any { - if m != nil { - return m.G - } - return nil -} - -func (m *TestVersion3) GetH() []*TestVersion1 { - if m != nil { - return m.H - } - return nil -} - -func (m *TestVersion3) GetNonCriticalField() string { - if m != nil { - return m.NonCriticalField - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersion3) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersion3_E)(nil), - (*TestVersion3_F)(nil), - } -} - -type TestVersion3LoneOneOfValue struct { - X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - A *TestVersion3 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` - B *TestVersion3 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` - C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` - D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` - // Types that are valid to be assigned to Sum: - // *TestVersion3LoneOneOfValue_E - Sum isTestVersion3LoneOneOfValue_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` - H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` - // google.protobuf.Timestamp i = 10; - // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; - *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` - NonCriticalField string `protobuf:"bytes,1031,opt,name=non_critical_field,json=nonCriticalField,proto3" json:"non_critical_field,omitempty"` -} - -func (m *TestVersion3LoneOneOfValue) Reset() { *m = TestVersion3LoneOneOfValue{} } -func (m *TestVersion3LoneOneOfValue) String() string { return proto.CompactTextString(m) } -func (*TestVersion3LoneOneOfValue) ProtoMessage() {} -func (*TestVersion3LoneOneOfValue) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{21} -} -func (m *TestVersion3LoneOneOfValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion3LoneOneOfValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion3LoneOneOfValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion3LoneOneOfValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneOneOfValue.Merge(m, src) -} -func (m *TestVersion3LoneOneOfValue) XXX_Size() int { - return m.Size() -} -func (m *TestVersion3LoneOneOfValue) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneOneOfValue.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion3LoneOneOfValue proto.InternalMessageInfo - -type isTestVersion3LoneOneOfValue_Sum interface { - isTestVersion3LoneOneOfValue_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type TestVersion3LoneOneOfValue_E struct { - E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` -} - -func (*TestVersion3LoneOneOfValue_E) isTestVersion3LoneOneOfValue_Sum() {} - -func (m *TestVersion3LoneOneOfValue) GetSum() isTestVersion3LoneOneOfValue_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *TestVersion3LoneOneOfValue) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersion3LoneOneOfValue) GetA() *TestVersion3 { - if m != nil { - return m.A - } - return nil -} - -func (m *TestVersion3LoneOneOfValue) GetB() *TestVersion3 { - if m != nil { - return m.B - } - return nil -} - -func (m *TestVersion3LoneOneOfValue) GetC() []*TestVersion3 { - if m != nil { - return m.C - } - return nil -} - -func (m *TestVersion3LoneOneOfValue) GetD() []*TestVersion3 { - if m != nil { - return m.D - } - return nil -} - -func (m *TestVersion3LoneOneOfValue) GetE() int32 { - if x, ok := m.GetSum().(*TestVersion3LoneOneOfValue_E); ok { - return x.E - } - return 0 -} - -func (m *TestVersion3LoneOneOfValue) GetG() *types.Any { - if m != nil { - return m.G - } - return nil -} - -func (m *TestVersion3LoneOneOfValue) GetH() []*TestVersion1 { - if m != nil { - return m.H - } - return nil -} - -func (m *TestVersion3LoneOneOfValue) GetNonCriticalField() string { - if m != nil { - return m.NonCriticalField - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersion3LoneOneOfValue) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersion3LoneOneOfValue_E)(nil), - } -} - -type TestVersion3LoneNesting struct { - X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - A *TestVersion3 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` - B *TestVersion3 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` - C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` - D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` - // Types that are valid to be assigned to Sum: - // *TestVersion3LoneNesting_F - Sum isTestVersion3LoneNesting_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` - H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` - // google.protobuf.Timestamp i = 10; - // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; - *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` - NonCriticalField string `protobuf:"bytes,1031,opt,name=non_critical_field,json=nonCriticalField,proto3" json:"non_critical_field,omitempty"` - Inner1 *TestVersion3LoneNesting_Inner1 `protobuf:"bytes,14,opt,name=inner1,proto3" json:"inner1,omitempty"` - Inner2 *TestVersion3LoneNesting_Inner2 `protobuf:"bytes,15,opt,name=inner2,proto3" json:"inner2,omitempty"` -} - -func (m *TestVersion3LoneNesting) Reset() { *m = TestVersion3LoneNesting{} } -func (m *TestVersion3LoneNesting) String() string { return proto.CompactTextString(m) } -func (*TestVersion3LoneNesting) ProtoMessage() {} -func (*TestVersion3LoneNesting) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{22} -} -func (m *TestVersion3LoneNesting) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion3LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion3LoneNesting) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting.Merge(m, src) -} -func (m *TestVersion3LoneNesting) XXX_Size() int { - return m.Size() -} -func (m *TestVersion3LoneNesting) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneNesting.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion3LoneNesting proto.InternalMessageInfo - -type isTestVersion3LoneNesting_Sum interface { - isTestVersion3LoneNesting_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type TestVersion3LoneNesting_F struct { - F *TestVersion3LoneNesting `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` -} - -func (*TestVersion3LoneNesting_F) isTestVersion3LoneNesting_Sum() {} - -func (m *TestVersion3LoneNesting) GetSum() isTestVersion3LoneNesting_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *TestVersion3LoneNesting) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersion3LoneNesting) GetA() *TestVersion3 { - if m != nil { - return m.A - } - return nil -} - -func (m *TestVersion3LoneNesting) GetB() *TestVersion3 { - if m != nil { - return m.B - } - return nil -} - -func (m *TestVersion3LoneNesting) GetC() []*TestVersion3 { - if m != nil { - return m.C - } - return nil -} - -func (m *TestVersion3LoneNesting) GetD() []*TestVersion3 { - if m != nil { - return m.D - } - return nil -} - -func (m *TestVersion3LoneNesting) GetF() *TestVersion3LoneNesting { - if x, ok := m.GetSum().(*TestVersion3LoneNesting_F); ok { - return x.F - } - return nil -} - -func (m *TestVersion3LoneNesting) GetG() *types.Any { - if m != nil { - return m.G - } - return nil -} - -func (m *TestVersion3LoneNesting) GetH() []*TestVersion1 { - if m != nil { - return m.H - } - return nil -} - -func (m *TestVersion3LoneNesting) GetNonCriticalField() string { - if m != nil { - return m.NonCriticalField - } - return "" -} - -func (m *TestVersion3LoneNesting) GetInner1() *TestVersion3LoneNesting_Inner1 { - if m != nil { - return m.Inner1 - } - return nil -} - -func (m *TestVersion3LoneNesting) GetInner2() *TestVersion3LoneNesting_Inner2 { - if m != nil { - return m.Inner2 - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersion3LoneNesting) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersion3LoneNesting_F)(nil), - } -} - -type TestVersion3LoneNesting_Inner1 struct { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Inner *TestVersion3LoneNesting_Inner1_InnerInner `protobuf:"bytes,3,opt,name=inner,proto3" json:"inner,omitempty"` -} - -func (m *TestVersion3LoneNesting_Inner1) Reset() { *m = TestVersion3LoneNesting_Inner1{} } -func (m *TestVersion3LoneNesting_Inner1) String() string { return proto.CompactTextString(m) } -func (*TestVersion3LoneNesting_Inner1) ProtoMessage() {} -func (*TestVersion3LoneNesting_Inner1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{22, 0} -} -func (m *TestVersion3LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion3LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting_Inner1.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion3LoneNesting_Inner1) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting_Inner1.Merge(m, src) -} -func (m *TestVersion3LoneNesting_Inner1) XXX_Size() int { - return m.Size() -} -func (m *TestVersion3LoneNesting_Inner1) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneNesting_Inner1.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion3LoneNesting_Inner1 proto.InternalMessageInfo - -func (m *TestVersion3LoneNesting_Inner1) GetId() int64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *TestVersion3LoneNesting_Inner1) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TestVersion3LoneNesting_Inner1) GetInner() *TestVersion3LoneNesting_Inner1_InnerInner { - if m != nil { - return m.Inner - } - return nil -} - -type TestVersion3LoneNesting_Inner1_InnerInner struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` -} - -func (m *TestVersion3LoneNesting_Inner1_InnerInner) Reset() { - *m = TestVersion3LoneNesting_Inner1_InnerInner{} -} -func (m *TestVersion3LoneNesting_Inner1_InnerInner) String() string { - return proto.CompactTextString(m) -} -func (*TestVersion3LoneNesting_Inner1_InnerInner) ProtoMessage() {} -func (*TestVersion3LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{22, 0, 0} -} -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.Merge(m, src) -} -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Size() int { - return m.Size() -} -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner proto.InternalMessageInfo - -func (m *TestVersion3LoneNesting_Inner1_InnerInner) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *TestVersion3LoneNesting_Inner1_InnerInner) GetCity() string { - if m != nil { - return m.City - } - return "" -} - -type TestVersion3LoneNesting_Inner2 struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` - Inner *TestVersion3LoneNesting_Inner2_InnerInner `protobuf:"bytes,3,opt,name=inner,proto3" json:"inner,omitempty"` -} - -func (m *TestVersion3LoneNesting_Inner2) Reset() { *m = TestVersion3LoneNesting_Inner2{} } -func (m *TestVersion3LoneNesting_Inner2) String() string { return proto.CompactTextString(m) } -func (*TestVersion3LoneNesting_Inner2) ProtoMessage() {} -func (*TestVersion3LoneNesting_Inner2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{22, 1} -} -func (m *TestVersion3LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion3LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting_Inner2.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion3LoneNesting_Inner2) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting_Inner2.Merge(m, src) -} -func (m *TestVersion3LoneNesting_Inner2) XXX_Size() int { - return m.Size() -} -func (m *TestVersion3LoneNesting_Inner2) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneNesting_Inner2.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion3LoneNesting_Inner2 proto.InternalMessageInfo - -func (m *TestVersion3LoneNesting_Inner2) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *TestVersion3LoneNesting_Inner2) GetCountry() string { - if m != nil { - return m.Country - } - return "" -} - -func (m *TestVersion3LoneNesting_Inner2) GetInner() *TestVersion3LoneNesting_Inner2_InnerInner { - if m != nil { - return m.Inner - } - return nil -} - -type TestVersion3LoneNesting_Inner2_InnerInner struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` -} - -func (m *TestVersion3LoneNesting_Inner2_InnerInner) Reset() { - *m = TestVersion3LoneNesting_Inner2_InnerInner{} -} -func (m *TestVersion3LoneNesting_Inner2_InnerInner) String() string { - return proto.CompactTextString(m) -} -func (*TestVersion3LoneNesting_Inner2_InnerInner) ProtoMessage() {} -func (*TestVersion3LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{22, 1, 0} -} -func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting_Inner2_InnerInner.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting_Inner2_InnerInner.Merge(m, src) -} -func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Size() int { - return m.Size() -} -func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneNesting_Inner2_InnerInner.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion3LoneNesting_Inner2_InnerInner proto.InternalMessageInfo - -func (m *TestVersion3LoneNesting_Inner2_InnerInner) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *TestVersion3LoneNesting_Inner2_InnerInner) GetCity() string { - if m != nil { - return m.City - } - return "" -} - -type TestVersion4LoneNesting struct { - X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - A *TestVersion3 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` - B *TestVersion3 `protobuf:"bytes,3,opt,name=b,proto3" json:"b,omitempty"` - C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` - D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` - // Types that are valid to be assigned to Sum: - // *TestVersion4LoneNesting_F - Sum isTestVersion4LoneNesting_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` - H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` - // google.protobuf.Timestamp i = 10; - // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; - *Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"` - NonCriticalField string `protobuf:"bytes,1031,opt,name=non_critical_field,json=nonCriticalField,proto3" json:"non_critical_field,omitempty"` - Inner1 *TestVersion4LoneNesting_Inner1 `protobuf:"bytes,14,opt,name=inner1,proto3" json:"inner1,omitempty"` - Inner2 *TestVersion4LoneNesting_Inner2 `protobuf:"bytes,15,opt,name=inner2,proto3" json:"inner2,omitempty"` -} - -func (m *TestVersion4LoneNesting) Reset() { *m = TestVersion4LoneNesting{} } -func (m *TestVersion4LoneNesting) String() string { return proto.CompactTextString(m) } -func (*TestVersion4LoneNesting) ProtoMessage() {} -func (*TestVersion4LoneNesting) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{23} -} -func (m *TestVersion4LoneNesting) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion4LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion4LoneNesting) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting.Merge(m, src) -} -func (m *TestVersion4LoneNesting) XXX_Size() int { - return m.Size() -} -func (m *TestVersion4LoneNesting) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion4LoneNesting proto.InternalMessageInfo - -type isTestVersion4LoneNesting_Sum interface { - isTestVersion4LoneNesting_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type TestVersion4LoneNesting_F struct { - F *TestVersion3LoneNesting `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` -} - -func (*TestVersion4LoneNesting_F) isTestVersion4LoneNesting_Sum() {} - -func (m *TestVersion4LoneNesting) GetSum() isTestVersion4LoneNesting_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *TestVersion4LoneNesting) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersion4LoneNesting) GetA() *TestVersion3 { - if m != nil { - return m.A - } - return nil -} - -func (m *TestVersion4LoneNesting) GetB() *TestVersion3 { - if m != nil { - return m.B - } - return nil -} - -func (m *TestVersion4LoneNesting) GetC() []*TestVersion3 { - if m != nil { - return m.C - } - return nil -} - -func (m *TestVersion4LoneNesting) GetD() []*TestVersion3 { - if m != nil { - return m.D - } - return nil -} - -func (m *TestVersion4LoneNesting) GetF() *TestVersion3LoneNesting { - if x, ok := m.GetSum().(*TestVersion4LoneNesting_F); ok { - return x.F - } - return nil -} - -func (m *TestVersion4LoneNesting) GetG() *types.Any { - if m != nil { - return m.G - } - return nil -} - -func (m *TestVersion4LoneNesting) GetH() []*TestVersion1 { - if m != nil { - return m.H - } - return nil -} - -func (m *TestVersion4LoneNesting) GetNonCriticalField() string { - if m != nil { - return m.NonCriticalField - } - return "" -} - -func (m *TestVersion4LoneNesting) GetInner1() *TestVersion4LoneNesting_Inner1 { - if m != nil { - return m.Inner1 - } - return nil -} - -func (m *TestVersion4LoneNesting) GetInner2() *TestVersion4LoneNesting_Inner2 { - if m != nil { - return m.Inner2 - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersion4LoneNesting) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersion4LoneNesting_F)(nil), - } -} - -type TestVersion4LoneNesting_Inner1 struct { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Inner *TestVersion4LoneNesting_Inner1_InnerInner `protobuf:"bytes,3,opt,name=inner,proto3" json:"inner,omitempty"` -} - -func (m *TestVersion4LoneNesting_Inner1) Reset() { *m = TestVersion4LoneNesting_Inner1{} } -func (m *TestVersion4LoneNesting_Inner1) String() string { return proto.CompactTextString(m) } -func (*TestVersion4LoneNesting_Inner1) ProtoMessage() {} -func (*TestVersion4LoneNesting_Inner1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{23, 0} -} -func (m *TestVersion4LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion4LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting_Inner1.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion4LoneNesting_Inner1) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting_Inner1.Merge(m, src) -} -func (m *TestVersion4LoneNesting_Inner1) XXX_Size() int { - return m.Size() -} -func (m *TestVersion4LoneNesting_Inner1) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting_Inner1.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion4LoneNesting_Inner1 proto.InternalMessageInfo - -func (m *TestVersion4LoneNesting_Inner1) GetId() int64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *TestVersion4LoneNesting_Inner1) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TestVersion4LoneNesting_Inner1) GetInner() *TestVersion4LoneNesting_Inner1_InnerInner { - if m != nil { - return m.Inner - } - return nil -} - -type TestVersion4LoneNesting_Inner1_InnerInner struct { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` -} - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) Reset() { - *m = TestVersion4LoneNesting_Inner1_InnerInner{} -} -func (m *TestVersion4LoneNesting_Inner1_InnerInner) String() string { - return proto.CompactTextString(m) -} -func (*TestVersion4LoneNesting_Inner1_InnerInner) ProtoMessage() {} -func (*TestVersion4LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{23, 0, 0} -} -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.Merge(m, src) -} -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Size() int { - return m.Size() -} -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner proto.InternalMessageInfo - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) GetId() int64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) GetCity() string { - if m != nil { - return m.City - } - return "" -} - -type TestVersion4LoneNesting_Inner2 struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` - Inner *TestVersion4LoneNesting_Inner2_InnerInner `protobuf:"bytes,3,opt,name=inner,proto3" json:"inner,omitempty"` -} - -func (m *TestVersion4LoneNesting_Inner2) Reset() { *m = TestVersion4LoneNesting_Inner2{} } -func (m *TestVersion4LoneNesting_Inner2) String() string { return proto.CompactTextString(m) } -func (*TestVersion4LoneNesting_Inner2) ProtoMessage() {} -func (*TestVersion4LoneNesting_Inner2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{23, 1} -} -func (m *TestVersion4LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion4LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting_Inner2.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion4LoneNesting_Inner2) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting_Inner2.Merge(m, src) -} -func (m *TestVersion4LoneNesting_Inner2) XXX_Size() int { - return m.Size() -} -func (m *TestVersion4LoneNesting_Inner2) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting_Inner2.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion4LoneNesting_Inner2 proto.InternalMessageInfo - -func (m *TestVersion4LoneNesting_Inner2) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *TestVersion4LoneNesting_Inner2) GetCountry() string { - if m != nil { - return m.Country - } - return "" -} - -func (m *TestVersion4LoneNesting_Inner2) GetInner() *TestVersion4LoneNesting_Inner2_InnerInner { - if m != nil { - return m.Inner - } - return nil -} - -type TestVersion4LoneNesting_Inner2_InnerInner struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *TestVersion4LoneNesting_Inner2_InnerInner) Reset() { - *m = TestVersion4LoneNesting_Inner2_InnerInner{} -} -func (m *TestVersion4LoneNesting_Inner2_InnerInner) String() string { - return proto.CompactTextString(m) -} -func (*TestVersion4LoneNesting_Inner2_InnerInner) ProtoMessage() {} -func (*TestVersion4LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{23, 1, 0} -} -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.Merge(m, src) -} -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Size() int { - return m.Size() -} -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner proto.InternalMessageInfo - -func (m *TestVersion4LoneNesting_Inner2_InnerInner) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *TestVersion4LoneNesting_Inner2_InnerInner) GetValue() int64 { - if m != nil { - return m.Value - } - return 0 -} - -type TestVersionFD1 struct { - X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` - // Types that are valid to be assigned to Sum: - // *TestVersionFD1_E - // *TestVersionFD1_F - Sum isTestVersionFD1_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` - H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` -} - -func (m *TestVersionFD1) Reset() { *m = TestVersionFD1{} } -func (m *TestVersionFD1) String() string { return proto.CompactTextString(m) } -func (*TestVersionFD1) ProtoMessage() {} -func (*TestVersionFD1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{24} -} -func (m *TestVersionFD1) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersionFD1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersionFD1.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersionFD1) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersionFD1.Merge(m, src) -} -func (m *TestVersionFD1) XXX_Size() int { - return m.Size() -} -func (m *TestVersionFD1) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersionFD1.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersionFD1 proto.InternalMessageInfo - -type isTestVersionFD1_Sum interface { - isTestVersionFD1_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type TestVersionFD1_E struct { - E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` -} -type TestVersionFD1_F struct { - F *TestVersion1 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` -} - -func (*TestVersionFD1_E) isTestVersionFD1_Sum() {} -func (*TestVersionFD1_F) isTestVersionFD1_Sum() {} - -func (m *TestVersionFD1) GetSum() isTestVersionFD1_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *TestVersionFD1) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersionFD1) GetA() *TestVersion1 { - if m != nil { - return m.A - } - return nil -} - -func (m *TestVersionFD1) GetE() int32 { - if x, ok := m.GetSum().(*TestVersionFD1_E); ok { - return x.E - } - return 0 -} - -func (m *TestVersionFD1) GetF() *TestVersion1 { - if x, ok := m.GetSum().(*TestVersionFD1_F); ok { - return x.F - } - return nil -} - -func (m *TestVersionFD1) GetG() *types.Any { - if m != nil { - return m.G - } - return nil -} - -func (m *TestVersionFD1) GetH() []*TestVersion1 { - if m != nil { - return m.H - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersionFD1) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersionFD1_E)(nil), - (*TestVersionFD1_F)(nil), - } -} - -type TestVersionFD1WithExtraAny struct { - X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` - // Types that are valid to be assigned to Sum: - // *TestVersionFD1WithExtraAny_E - // *TestVersionFD1WithExtraAny_F - Sum isTestVersionFD1WithExtraAny_Sum `protobuf_oneof:"sum"` - G *AnyWithExtra `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` - H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` -} - -func (m *TestVersionFD1WithExtraAny) Reset() { *m = TestVersionFD1WithExtraAny{} } -func (m *TestVersionFD1WithExtraAny) String() string { return proto.CompactTextString(m) } -func (*TestVersionFD1WithExtraAny) ProtoMessage() {} -func (*TestVersionFD1WithExtraAny) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{25} -} -func (m *TestVersionFD1WithExtraAny) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestVersionFD1WithExtraAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestVersionFD1WithExtraAny.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestVersionFD1WithExtraAny) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersionFD1WithExtraAny.Merge(m, src) -} -func (m *TestVersionFD1WithExtraAny) XXX_Size() int { - return m.Size() -} -func (m *TestVersionFD1WithExtraAny) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersionFD1WithExtraAny.DiscardUnknown(m) -} - -var xxx_messageInfo_TestVersionFD1WithExtraAny proto.InternalMessageInfo - -type isTestVersionFD1WithExtraAny_Sum interface { - isTestVersionFD1WithExtraAny_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type TestVersionFD1WithExtraAny_E struct { - E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` -} -type TestVersionFD1WithExtraAny_F struct { - F *TestVersion1 `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` -} - -func (*TestVersionFD1WithExtraAny_E) isTestVersionFD1WithExtraAny_Sum() {} -func (*TestVersionFD1WithExtraAny_F) isTestVersionFD1WithExtraAny_Sum() {} - -func (m *TestVersionFD1WithExtraAny) GetSum() isTestVersionFD1WithExtraAny_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *TestVersionFD1WithExtraAny) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersionFD1WithExtraAny) GetA() *TestVersion1 { - if m != nil { - return m.A - } - return nil -} - -func (m *TestVersionFD1WithExtraAny) GetE() int32 { - if x, ok := m.GetSum().(*TestVersionFD1WithExtraAny_E); ok { - return x.E - } - return 0 -} - -func (m *TestVersionFD1WithExtraAny) GetF() *TestVersion1 { - if x, ok := m.GetSum().(*TestVersionFD1WithExtraAny_F); ok { - return x.F - } - return nil -} - -func (m *TestVersionFD1WithExtraAny) GetG() *AnyWithExtra { - if m != nil { - return m.G - } - return nil -} - -func (m *TestVersionFD1WithExtraAny) GetH() []*TestVersion1 { - if m != nil { - return m.H - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersionFD1WithExtraAny) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersionFD1WithExtraAny_E)(nil), - (*TestVersionFD1WithExtraAny_F)(nil), - } -} - -type AnyWithExtra struct { - *types.Any `protobuf:"bytes,1,opt,name=a,proto3,embedded=a" json:"a,omitempty"` - B int64 `protobuf:"varint,3,opt,name=b,proto3" json:"b,omitempty"` - C int64 `protobuf:"varint,4,opt,name=c,proto3" json:"c,omitempty"` -} - -func (m *AnyWithExtra) Reset() { *m = AnyWithExtra{} } -func (m *AnyWithExtra) String() string { return proto.CompactTextString(m) } -func (*AnyWithExtra) ProtoMessage() {} -func (*AnyWithExtra) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{26} -} -func (m *AnyWithExtra) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AnyWithExtra) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AnyWithExtra.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AnyWithExtra) XXX_Merge(src proto.Message) { - xxx_messageInfo_AnyWithExtra.Merge(m, src) -} -func (m *AnyWithExtra) XXX_Size() int { - return m.Size() -} -func (m *AnyWithExtra) XXX_DiscardUnknown() { - xxx_messageInfo_AnyWithExtra.DiscardUnknown(m) -} - -var xxx_messageInfo_AnyWithExtra proto.InternalMessageInfo - -func (m *AnyWithExtra) GetB() int64 { - if m != nil { - return m.B - } - return 0 -} - -func (m *AnyWithExtra) GetC() int64 { - if m != nil { - return m.C - } - return 0 -} - -type TestUpdatedTxRaw struct { - BodyBytes []byte `protobuf:"bytes,1,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"` - AuthInfoBytes []byte `protobuf:"bytes,2,opt,name=auth_info_bytes,json=authInfoBytes,proto3" json:"auth_info_bytes,omitempty"` - Signatures [][]byte `protobuf:"bytes,3,rep,name=signatures,proto3" json:"signatures,omitempty"` - NewField_5 []byte `protobuf:"bytes,5,opt,name=new_field_5,json=newField5,proto3" json:"new_field_5,omitempty"` - NewField_1024 []byte `protobuf:"bytes,1024,opt,name=new_field_1024,json=newField1024,proto3" json:"new_field_1024,omitempty"` -} - -func (m *TestUpdatedTxRaw) Reset() { *m = TestUpdatedTxRaw{} } -func (m *TestUpdatedTxRaw) String() string { return proto.CompactTextString(m) } -func (*TestUpdatedTxRaw) ProtoMessage() {} -func (*TestUpdatedTxRaw) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{27} -} -func (m *TestUpdatedTxRaw) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestUpdatedTxRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestUpdatedTxRaw.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestUpdatedTxRaw) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestUpdatedTxRaw.Merge(m, src) -} -func (m *TestUpdatedTxRaw) XXX_Size() int { - return m.Size() -} -func (m *TestUpdatedTxRaw) XXX_DiscardUnknown() { - xxx_messageInfo_TestUpdatedTxRaw.DiscardUnknown(m) -} - -var xxx_messageInfo_TestUpdatedTxRaw proto.InternalMessageInfo - -func (m *TestUpdatedTxRaw) GetBodyBytes() []byte { - if m != nil { - return m.BodyBytes - } - return nil -} - -func (m *TestUpdatedTxRaw) GetAuthInfoBytes() []byte { - if m != nil { - return m.AuthInfoBytes - } - return nil -} - -func (m *TestUpdatedTxRaw) GetSignatures() [][]byte { - if m != nil { - return m.Signatures - } - return nil -} - -func (m *TestUpdatedTxRaw) GetNewField_5() []byte { - if m != nil { - return m.NewField_5 - } - return nil -} - -func (m *TestUpdatedTxRaw) GetNewField_1024() []byte { - if m != nil { - return m.NewField_1024 - } - return nil -} - -type TestUpdatedTxBody struct { - Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` - Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` - TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` - SomeNewField uint64 `protobuf:"varint,4,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` - SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"` - ExtensionOptions []*types.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` - NonCriticalExtensionOptions []*types.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` -} - -func (m *TestUpdatedTxBody) Reset() { *m = TestUpdatedTxBody{} } -func (m *TestUpdatedTxBody) String() string { return proto.CompactTextString(m) } -func (*TestUpdatedTxBody) ProtoMessage() {} -func (*TestUpdatedTxBody) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28} -} -func (m *TestUpdatedTxBody) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestUpdatedTxBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestUpdatedTxBody.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestUpdatedTxBody) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestUpdatedTxBody.Merge(m, src) -} -func (m *TestUpdatedTxBody) XXX_Size() int { - return m.Size() -} -func (m *TestUpdatedTxBody) XXX_DiscardUnknown() { - xxx_messageInfo_TestUpdatedTxBody.DiscardUnknown(m) -} - -var xxx_messageInfo_TestUpdatedTxBody proto.InternalMessageInfo - -func (m *TestUpdatedTxBody) GetMessages() []*types.Any { - if m != nil { - return m.Messages - } - return nil -} - -func (m *TestUpdatedTxBody) GetMemo() string { - if m != nil { - return m.Memo - } - return "" -} - -func (m *TestUpdatedTxBody) GetTimeoutHeight() int64 { - if m != nil { - return m.TimeoutHeight - } - return 0 -} - -func (m *TestUpdatedTxBody) GetSomeNewField() uint64 { - if m != nil { - return m.SomeNewField - } - return 0 -} - -func (m *TestUpdatedTxBody) GetSomeNewFieldNonCriticalField() string { - if m != nil { - return m.SomeNewFieldNonCriticalField - } - return "" -} - -func (m *TestUpdatedTxBody) GetExtensionOptions() []*types.Any { - if m != nil { - return m.ExtensionOptions - } - return nil -} - -func (m *TestUpdatedTxBody) GetNonCriticalExtensionOptions() []*types.Any { - if m != nil { - return m.NonCriticalExtensionOptions - } - return nil -} - -type TestUpdatedAuthInfo struct { - SignerInfos []*tx.SignerInfo `protobuf:"bytes,1,rep,name=signer_infos,json=signerInfos,proto3" json:"signer_infos,omitempty"` - Fee *tx.Fee `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee,omitempty"` - NewField_3 []byte `protobuf:"bytes,3,opt,name=new_field_3,json=newField3,proto3" json:"new_field_3,omitempty"` - NewField_1024 []byte `protobuf:"bytes,1024,opt,name=new_field_1024,json=newField1024,proto3" json:"new_field_1024,omitempty"` -} - -func (m *TestUpdatedAuthInfo) Reset() { *m = TestUpdatedAuthInfo{} } -func (m *TestUpdatedAuthInfo) String() string { return proto.CompactTextString(m) } -func (*TestUpdatedAuthInfo) ProtoMessage() {} -func (*TestUpdatedAuthInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29} -} -func (m *TestUpdatedAuthInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestUpdatedAuthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestUpdatedAuthInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestUpdatedAuthInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestUpdatedAuthInfo.Merge(m, src) -} -func (m *TestUpdatedAuthInfo) XXX_Size() int { - return m.Size() -} -func (m *TestUpdatedAuthInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TestUpdatedAuthInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TestUpdatedAuthInfo proto.InternalMessageInfo - -func (m *TestUpdatedAuthInfo) GetSignerInfos() []*tx.SignerInfo { - if m != nil { - return m.SignerInfos - } - return nil -} - -func (m *TestUpdatedAuthInfo) GetFee() *tx.Fee { - if m != nil { - return m.Fee - } - return nil -} - -func (m *TestUpdatedAuthInfo) GetNewField_3() []byte { - if m != nil { - return m.NewField_3 - } - return nil -} - -func (m *TestUpdatedAuthInfo) GetNewField_1024() []byte { - if m != nil { - return m.NewField_1024 - } - return nil -} - -type TestRepeatedUints struct { - Nums []uint64 `protobuf:"varint,1,rep,packed,name=nums,proto3" json:"nums,omitempty"` -} - -func (m *TestRepeatedUints) Reset() { *m = TestRepeatedUints{} } -func (m *TestRepeatedUints) String() string { return proto.CompactTextString(m) } -func (*TestRepeatedUints) ProtoMessage() {} -func (*TestRepeatedUints) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{30} -} -func (m *TestRepeatedUints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestRepeatedUints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestRepeatedUints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestRepeatedUints) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestRepeatedUints.Merge(m, src) -} -func (m *TestRepeatedUints) XXX_Size() int { - return m.Size() -} -func (m *TestRepeatedUints) XXX_DiscardUnknown() { - xxx_messageInfo_TestRepeatedUints.DiscardUnknown(m) -} - -var xxx_messageInfo_TestRepeatedUints proto.InternalMessageInfo - -func (m *TestRepeatedUints) GetNums() []uint64 { - if m != nil { - return m.Nums - } - return nil -} - -func init() { - proto.RegisterEnum("testdata.Customer2_City", Customer2_City_name, Customer2_City_value) - proto.RegisterType((*Dog)(nil), "testdata.Dog") - proto.RegisterType((*Cat)(nil), "testdata.Cat") - proto.RegisterType((*HasAnimal)(nil), "testdata.HasAnimal") - proto.RegisterType((*HasHasAnimal)(nil), "testdata.HasHasAnimal") - proto.RegisterType((*HasHasHasAnimal)(nil), "testdata.HasHasHasAnimal") - proto.RegisterType((*TestMsg)(nil), "testdata.TestMsg") - proto.RegisterType((*BadMultiSignature)(nil), "testdata.BadMultiSignature") - proto.RegisterType((*Customer1)(nil), "testdata.Customer1") - proto.RegisterType((*Customer2)(nil), "testdata.Customer2") - proto.RegisterType((*Nested4A)(nil), "testdata.Nested4A") - proto.RegisterType((*Nested3A)(nil), "testdata.Nested3A") - proto.RegisterMapType((map[int64]*Nested4A)(nil), "testdata.Nested3A.IndexEntry") - proto.RegisterType((*Nested2A)(nil), "testdata.Nested2A") - proto.RegisterType((*Nested1A)(nil), "testdata.Nested1A") - proto.RegisterType((*Nested4B)(nil), "testdata.Nested4B") - proto.RegisterType((*Nested3B)(nil), "testdata.Nested3B") - proto.RegisterType((*Nested2B)(nil), "testdata.Nested2B") - proto.RegisterType((*Nested1B)(nil), "testdata.Nested1B") - proto.RegisterType((*Customer3)(nil), "testdata.Customer3") - proto.RegisterType((*TestVersion1)(nil), "testdata.TestVersion1") - proto.RegisterType((*TestVersion2)(nil), "testdata.TestVersion2") - proto.RegisterType((*TestVersion3)(nil), "testdata.TestVersion3") - proto.RegisterType((*TestVersion3LoneOneOfValue)(nil), "testdata.TestVersion3LoneOneOfValue") - proto.RegisterType((*TestVersion3LoneNesting)(nil), "testdata.TestVersion3LoneNesting") - proto.RegisterType((*TestVersion3LoneNesting_Inner1)(nil), "testdata.TestVersion3LoneNesting.Inner1") - proto.RegisterType((*TestVersion3LoneNesting_Inner1_InnerInner)(nil), "testdata.TestVersion3LoneNesting.Inner1.InnerInner") - proto.RegisterType((*TestVersion3LoneNesting_Inner2)(nil), "testdata.TestVersion3LoneNesting.Inner2") - proto.RegisterType((*TestVersion3LoneNesting_Inner2_InnerInner)(nil), "testdata.TestVersion3LoneNesting.Inner2.InnerInner") - proto.RegisterType((*TestVersion4LoneNesting)(nil), "testdata.TestVersion4LoneNesting") - proto.RegisterType((*TestVersion4LoneNesting_Inner1)(nil), "testdata.TestVersion4LoneNesting.Inner1") - proto.RegisterType((*TestVersion4LoneNesting_Inner1_InnerInner)(nil), "testdata.TestVersion4LoneNesting.Inner1.InnerInner") - proto.RegisterType((*TestVersion4LoneNesting_Inner2)(nil), "testdata.TestVersion4LoneNesting.Inner2") - proto.RegisterType((*TestVersion4LoneNesting_Inner2_InnerInner)(nil), "testdata.TestVersion4LoneNesting.Inner2.InnerInner") - proto.RegisterType((*TestVersionFD1)(nil), "testdata.TestVersionFD1") - proto.RegisterType((*TestVersionFD1WithExtraAny)(nil), "testdata.TestVersionFD1WithExtraAny") - proto.RegisterType((*AnyWithExtra)(nil), "testdata.AnyWithExtra") - proto.RegisterType((*TestUpdatedTxRaw)(nil), "testdata.TestUpdatedTxRaw") - proto.RegisterType((*TestUpdatedTxBody)(nil), "testdata.TestUpdatedTxBody") - proto.RegisterType((*TestUpdatedAuthInfo)(nil), "testdata.TestUpdatedAuthInfo") - proto.RegisterType((*TestRepeatedUints)(nil), "testdata.TestRepeatedUints") -} - -func init() { proto.RegisterFile("proto.proto", fileDescriptor_2fcc84b9998d60d8) } - -var fileDescriptor_2fcc84b9998d60d8 = []byte{ - // 1820 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4f, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x72, 0x49, 0x89, 0x7c, 0xa2, 0x29, 0x7a, 0x22, 0xb4, 0x1b, 0x39, 0x96, 0x95, 0x85, - 0x6b, 0x33, 0x41, 0x4c, 0x9a, 0x4b, 0x1a, 0x28, 0x74, 0x32, 0x29, 0x5b, 0x91, 0x01, 0x5b, 0x2e, - 0x36, 0x4e, 0x5a, 0xf8, 0x42, 0x0c, 0xb9, 0x43, 0x72, 0x20, 0x72, 0x46, 0xdd, 0x99, 0xb5, 0xc4, - 0x9e, 0x8a, 0xf6, 0xd0, 0x1e, 0x73, 0x29, 0x0a, 0xf4, 0xd4, 0x1e, 0x7b, 0x2a, 0xf2, 0x0d, 0x7a, - 0xf4, 0xa5, 0x80, 0x2f, 0x05, 0x0a, 0x14, 0x08, 0x0a, 0xfb, 0xda, 0x6f, 0x50, 0x14, 0x29, 0x66, - 0xf6, 0x0f, 0x97, 0x96, 0xa8, 0xd0, 0x4a, 0x6b, 0x43, 0x40, 0x2f, 0xd2, 0xcc, 0xdb, 0xdf, 0xbc, - 0x79, 0xef, 0xf7, 0xfe, 0xec, 0xce, 0x10, 0x56, 0x0f, 0x7d, 0x2e, 0x79, 0x55, 0xff, 0x45, 0x79, - 0x49, 0x84, 0xf4, 0xb0, 0xc4, 0x1b, 0xeb, 0x03, 0x3e, 0xe0, 0x5a, 0x58, 0x53, 0xa3, 0xf0, 0xf9, - 0xc6, 0xfb, 0x03, 0xce, 0x07, 0x23, 0x52, 0xd3, 0xb3, 0x6e, 0xd0, 0xaf, 0x61, 0x36, 0x89, 0x1e, - 0x6d, 0xf4, 0xb8, 0x18, 0x73, 0x51, 0x93, 0xc7, 0xb5, 0x67, 0xf5, 0x2e, 0x91, 0xb8, 0x5e, 0x93, - 0xc7, 0xe1, 0x33, 0xfb, 0x16, 0x98, 0xf7, 0xf8, 0x00, 0x21, 0xc8, 0x0a, 0xfa, 0x33, 0x62, 0x19, - 0x5b, 0x46, 0xa5, 0xe0, 0xea, 0xb1, 0x92, 0x31, 0x3c, 0x26, 0x56, 0x26, 0x94, 0xa9, 0xb1, 0x7d, - 0x07, 0xcc, 0x1d, 0x2c, 0x91, 0x05, 0x2b, 0x63, 0xce, 0xe8, 0x01, 0xf1, 0xa3, 0x15, 0xf1, 0x14, - 0xad, 0x43, 0x6e, 0x44, 0x9f, 0x11, 0xa1, 0x57, 0xe5, 0xdc, 0x70, 0x62, 0x7f, 0x0a, 0x85, 0x3d, - 0x2c, 0x5a, 0x8c, 0x8e, 0xf1, 0x08, 0x7d, 0x02, 0xcb, 0x58, 0x8f, 0xf4, 0xda, 0x55, 0x67, 0xbd, - 0x1a, 0x9a, 0x5e, 0x8d, 0x4d, 0xaf, 0xb6, 0xd8, 0xc4, 0x8d, 0x30, 0xa8, 0x08, 0xc6, 0xb1, 0x56, - 0x66, 0xba, 0xc6, 0xb1, 0xbd, 0x03, 0xc5, 0x3d, 0x2c, 0xa6, 0xba, 0x1a, 0x00, 0x43, 0x2c, 0x3a, - 0x0b, 0xe8, 0x2b, 0x0c, 0xe3, 0x45, 0xf6, 0x23, 0x58, 0x0b, 0x95, 0x4c, 0xf5, 0x6c, 0x43, 0x49, - 0xe9, 0x59, 0x50, 0x57, 0x71, 0x98, 0x5a, 0x6b, 0x7f, 0x04, 0x2b, 0x4f, 0x88, 0x90, 0x8f, 0xc4, - 0x40, 0xf1, 0x22, 0xe8, 0x80, 0x11, 0x5f, 0x58, 0xc6, 0x96, 0xa9, 0x78, 0x89, 0xa6, 0xdb, 0xd9, - 0x5f, 0xff, 0xfe, 0xda, 0x92, 0xdd, 0x85, 0xcb, 0x6d, 0xec, 0x3d, 0x0a, 0x46, 0x92, 0x7e, 0x46, - 0x07, 0x0c, 0xcb, 0xc0, 0x27, 0x68, 0x13, 0x40, 0xc4, 0x93, 0x70, 0x5d, 0xd1, 0x4d, 0x49, 0xd0, - 0x4d, 0x58, 0x1b, 0xe3, 0x11, 0xed, 0x51, 0x1e, 0x88, 0x4e, 0x9f, 0x92, 0x91, 0x67, 0xe5, 0xb6, - 0x8c, 0x4a, 0xd1, 0x2d, 0x25, 0xe2, 0x5d, 0x25, 0xdd, 0xce, 0xbe, 0xf8, 0xc3, 0x35, 0xc3, 0x96, - 0x50, 0xd8, 0x09, 0x84, 0xe4, 0x63, 0xe2, 0xd7, 0x51, 0x09, 0x32, 0xd4, 0xd3, 0xbe, 0xe4, 0xdc, - 0x0c, 0xf5, 0x4e, 0x8b, 0x29, 0xfa, 0x08, 0xca, 0x22, 0xe8, 0x8a, 0x9e, 0x4f, 0x0f, 0x25, 0xe5, - 0xac, 0xd3, 0x27, 0xc4, 0x32, 0xb7, 0x8c, 0x4a, 0xc6, 0x5d, 0x4b, 0xcb, 0x77, 0x09, 0x51, 0xfe, - 0x1d, 0xe2, 0xc9, 0x98, 0x30, 0x69, 0xad, 0x84, 0x71, 0x8f, 0xa6, 0xf6, 0x57, 0x99, 0xe9, 0xb6, - 0xce, 0x89, 0x6d, 0x37, 0x20, 0x4f, 0x99, 0x17, 0x08, 0xe9, 0x4f, 0xa2, 0xc4, 0x48, 0xe6, 0x89, - 0x49, 0x66, 0xca, 0xa4, 0x75, 0xc8, 0xf5, 0xc9, 0x11, 0xf1, 0xad, 0xac, 0xb6, 0x23, 0x9c, 0xa0, - 0x2b, 0x90, 0xf7, 0x89, 0x20, 0xfe, 0x33, 0xe2, 0x59, 0xbf, 0xcd, 0xeb, 0x94, 0x48, 0x04, 0xe8, - 0x13, 0xc8, 0xf6, 0xa8, 0x9c, 0x58, 0xcb, 0x5b, 0x46, 0xa5, 0xe4, 0x58, 0xd5, 0xb8, 0x5c, 0xaa, - 0x89, 0x55, 0xd5, 0x1d, 0x2a, 0x27, 0xae, 0x46, 0xa1, 0x6d, 0xb8, 0x34, 0xa6, 0xa2, 0x47, 0x46, - 0x23, 0xcc, 0x08, 0x0f, 0x84, 0x05, 0x67, 0x84, 0x7b, 0x16, 0x6a, 0x7f, 0x0a, 0x59, 0xa5, 0x09, - 0xe5, 0x21, 0xfb, 0x10, 0x73, 0x51, 0x5e, 0x42, 0x25, 0x80, 0x87, 0x5c, 0xb4, 0xd8, 0x80, 0x8c, - 0x88, 0x28, 0x1b, 0xa8, 0x08, 0xf9, 0x1f, 0xe1, 0x11, 0x6f, 0x8d, 0x24, 0x2f, 0x67, 0x10, 0xc0, - 0xf2, 0x23, 0x2e, 0x7a, 0xfc, 0xa8, 0x6c, 0xa2, 0x55, 0x58, 0xd9, 0xc7, 0xd4, 0xe7, 0x5d, 0x5a, - 0xce, 0xda, 0x55, 0xc8, 0xef, 0x13, 0x21, 0x89, 0xd7, 0x6c, 0x2d, 0x12, 0x28, 0xfb, 0xaf, 0x46, - 0xbc, 0xa0, 0xb1, 0xd0, 0x02, 0x64, 0x43, 0x06, 0x37, 0xad, 0xec, 0x96, 0x59, 0x59, 0x75, 0xd0, - 0x94, 0x91, 0x78, 0x53, 0x37, 0x83, 0x9b, 0xa8, 0x01, 0x39, 0xca, 0x3c, 0x72, 0x6c, 0xe5, 0x34, - 0xec, 0xea, 0xeb, 0xb0, 0x46, 0xab, 0xfa, 0x40, 0x3d, 0xbf, 0xcf, 0xa4, 0x3f, 0x71, 0x43, 0xec, - 0xc6, 0x43, 0x80, 0xa9, 0x10, 0x95, 0xc1, 0x3c, 0x20, 0x13, 0x6d, 0x8b, 0xe9, 0xaa, 0x21, 0xaa, - 0x40, 0xee, 0x19, 0x1e, 0x05, 0xa1, 0x35, 0xa7, 0xef, 0x1d, 0x02, 0xb6, 0x33, 0x3f, 0x34, 0xec, - 0xa7, 0xb1, 0x5b, 0xce, 0x62, 0x6e, 0x7d, 0x0c, 0xcb, 0x4c, 0xe3, 0x75, 0xce, 0x9c, 0xa2, 0xbe, - 0xd1, 0x72, 0x23, 0x84, 0xbd, 0x1b, 0xeb, 0xae, 0x9f, 0xd4, 0x3d, 0xd5, 0x33, 0xc7, 0x4c, 0x67, - 0xaa, 0xe7, 0x6e, 0x12, 0xab, 0xf6, 0x09, 0x3d, 0x65, 0x30, 0xf1, 0x80, 0x44, 0x89, 0xad, 0x86, - 0xa7, 0xe5, 0xb4, 0xed, 0x25, 0xc1, 0x3b, 0xa7, 0x06, 0x15, 0xce, 0xee, 0xfc, 0x70, 0xb6, 0xdd, - 0x4c, 0xb7, 0x69, 0xb3, 0x84, 0xcb, 0x53, 0x77, 0x51, 0xb5, 0xad, 0x76, 0x31, 0x5c, 0x35, 0x5c, - 0x80, 0xc9, 0x76, 0xcc, 0x80, 0xaa, 0x49, 0x9f, 0x07, 0x92, 0xe8, 0x9a, 0x2c, 0xb8, 0xe1, 0xc4, - 0xfe, 0x49, 0xc2, 0x6f, 0xfb, 0x1c, 0xfc, 0x4e, 0xb5, 0x47, 0x0c, 0x98, 0x09, 0x03, 0xf6, 0x2f, - 0x52, 0x1d, 0xa5, 0xb1, 0x50, 0x5e, 0x94, 0x20, 0x23, 0xfa, 0x51, 0xeb, 0xca, 0x88, 0x3e, 0xfa, - 0x00, 0x0a, 0x22, 0xf0, 0x7b, 0x43, 0xec, 0x0f, 0x48, 0xd4, 0x49, 0xa6, 0x02, 0xb4, 0x05, 0xab, - 0x1e, 0x11, 0x92, 0x32, 0xac, 0xba, 0x9b, 0x6e, 0xa9, 0x05, 0x37, 0x2d, 0x42, 0x37, 0xa0, 0xd4, - 0xf3, 0x89, 0x47, 0x65, 0xa7, 0x87, 0x7d, 0xaf, 0xc3, 0x78, 0xd8, 0xf4, 0xf6, 0x96, 0xdc, 0x62, - 0x28, 0xdf, 0xc1, 0xbe, 0xb7, 0xcf, 0xd1, 0x55, 0x28, 0xf4, 0x86, 0xe4, 0xa7, 0x01, 0x51, 0x90, - 0x7c, 0x04, 0xc9, 0x87, 0xa2, 0x7d, 0x8e, 0x6a, 0x90, 0xe7, 0x3e, 0x1d, 0x50, 0x86, 0x47, 0x56, - 0x41, 0x13, 0xf1, 0xde, 0xc9, 0xee, 0x54, 0x77, 0x13, 0x50, 0xbb, 0x90, 0x74, 0x59, 0xfb, 0x9f, - 0x19, 0x28, 0xaa, 0x97, 0xcb, 0x17, 0xc4, 0x17, 0x94, 0xb3, 0x7a, 0xf8, 0x3a, 0x34, 0xa2, 0xd7, - 0x21, 0xba, 0x0e, 0x06, 0x8e, 0xc8, 0xfd, 0xde, 0x54, 0x67, 0x7a, 0x81, 0x6b, 0x60, 0x85, 0xea, - 0x46, 0x01, 0x9e, 0x8b, 0xea, 0x2a, 0x54, 0x2f, 0x4a, 0xae, 0xb9, 0xa8, 0x1e, 0xfa, 0x18, 0x0c, - 0x2f, 0x6a, 0x15, 0x73, 0x50, 0xed, 0xec, 0xf3, 0xaf, 0xaf, 0x2d, 0xb9, 0x86, 0x87, 0x4a, 0x60, - 0x10, 0xdd, 0x8f, 0x73, 0x7b, 0x4b, 0xae, 0x41, 0xd0, 0x0d, 0x30, 0xfa, 0x9a, 0xc2, 0xb9, 0x6b, - 0x15, 0xae, 0x8f, 0x6c, 0x30, 0x06, 0x9a, 0xc7, 0x79, 0x0d, 0xd9, 0x18, 0x28, 0x6b, 0x87, 0x56, - 0xe1, 0x6c, 0x6b, 0x87, 0xe8, 0x26, 0x18, 0x07, 0x56, 0x71, 0x2e, 0xe7, 0xed, 0xec, 0x8b, 0xaf, - 0xaf, 0x19, 0xae, 0x71, 0xd0, 0xce, 0x81, 0x29, 0x82, 0xb1, 0xfd, 0x4b, 0x73, 0x86, 0x6e, 0xe7, - 0x4d, 0xe9, 0x76, 0x16, 0xa2, 0xdb, 0x59, 0x88, 0x6e, 0x47, 0xd1, 0x7d, 0xfd, 0xdb, 0xe8, 0x76, - 0xce, 0x45, 0xb4, 0xf3, 0xae, 0x88, 0x46, 0x57, 0xa0, 0xc0, 0xc8, 0x51, 0xf4, 0x19, 0xf3, 0xfe, - 0x96, 0x51, 0xc9, 0xba, 0x79, 0x46, 0x8e, 0xf4, 0x07, 0x4c, 0x1c, 0x85, 0xdf, 0xcc, 0x46, 0xa1, - 0xf1, 0xa6, 0x51, 0x68, 0x2c, 0x14, 0x85, 0xc6, 0x42, 0x51, 0x68, 0x2c, 0x14, 0x85, 0xc6, 0xb9, - 0xa2, 0xd0, 0x78, 0x67, 0x51, 0xb8, 0x05, 0x88, 0x71, 0xd6, 0xe9, 0xf9, 0x54, 0xd2, 0x1e, 0x1e, - 0x45, 0xe1, 0xf8, 0x95, 0xee, 0x5d, 0x6e, 0x99, 0x71, 0xb6, 0x13, 0x3d, 0x99, 0x89, 0xcb, 0xbf, - 0x32, 0xb0, 0x91, 0x36, 0xff, 0x21, 0x67, 0xe4, 0x31, 0x23, 0x8f, 0xfb, 0x5f, 0xa8, 0x57, 0xf9, - 0x05, 0x8d, 0xd2, 0x85, 0x61, 0xff, 0xdf, 0xcb, 0xf0, 0xfd, 0xd7, 0xd9, 0xdf, 0xd7, 0x6f, 0xab, - 0xc1, 0x05, 0xa1, 0xbe, 0x3e, 0x2d, 0x88, 0x0f, 0x4f, 0x47, 0xa5, 0x7c, 0xba, 0x20, 0xb5, 0x81, - 0xee, 0xc2, 0x32, 0x65, 0x8c, 0xf8, 0x75, 0xab, 0xa4, 0x95, 0x57, 0xbe, 0xd5, 0xb3, 0xea, 0x03, - 0x8d, 0x77, 0xa3, 0x75, 0x89, 0x06, 0xc7, 0x5a, 0x7b, 0x23, 0x0d, 0x4e, 0xa4, 0xc1, 0xd9, 0xf8, - 0xa3, 0x01, 0xcb, 0xa1, 0xd2, 0xd4, 0x77, 0x92, 0x39, 0xf7, 0x3b, 0xe9, 0x81, 0xfa, 0xe4, 0x67, - 0xc4, 0x8f, 0xa2, 0xdf, 0x58, 0xd4, 0xe2, 0xf0, 0x9f, 0xfe, 0xe3, 0x86, 0x1a, 0x36, 0x6e, 0xab, - 0x83, 0x40, 0x2c, 0x4c, 0x6d, 0x5e, 0x88, 0x37, 0xd7, 0x67, 0xb2, 0x68, 0x73, 0x35, 0xde, 0xf8, - 0x53, 0x6c, 0xab, 0x73, 0x02, 0x6e, 0xc1, 0x4a, 0x8f, 0x07, 0x2c, 0x3e, 0x24, 0x16, 0xdc, 0x78, - 0x7a, 0x5e, 0x8b, 0x9d, 0xff, 0x86, 0xc5, 0x71, 0xfd, 0x7d, 0x33, 0x5b, 0x7f, 0xcd, 0xff, 0xd7, - 0xdf, 0x05, 0xaa, 0xbf, 0xe6, 0x77, 0xae, 0xbf, 0xe6, 0x5b, 0xae, 0xbf, 0xe6, 0x77, 0xaa, 0x3f, - 0x73, 0x6e, 0xfd, 0x7d, 0xf5, 0x3f, 0xab, 0xbf, 0xe6, 0x42, 0xf5, 0xe7, 0x9c, 0x59, 0x7f, 0xeb, - 0xe9, 0x8b, 0x03, 0x33, 0xba, 0x24, 0x88, 0x2b, 0xf0, 0x2f, 0x06, 0x94, 0x52, 0xfb, 0xed, 0xde, - 0x3b, 0xdf, 0x71, 0xe8, 0x9d, 0x1f, 0x4b, 0x62, 0x7f, 0xfe, 0x6e, 0xcc, 0x7c, 0x4f, 0xed, 0xde, - 0xab, 0xff, 0x98, 0xca, 0xe1, 0xfd, 0x63, 0xe9, 0xe3, 0x16, 0x9b, 0xbc, 0x55, 0xdf, 0xae, 0x4f, - 0x7d, 0x4b, 0xe1, 0x5a, 0x6c, 0x92, 0x58, 0xf4, 0xc6, 0xde, 0x3d, 0x81, 0x62, 0x7a, 0x3d, 0xaa, - 0x28, 0x07, 0xce, 0xb8, 0x55, 0x8d, 0x3b, 0x00, 0x56, 0x8e, 0x87, 0x9d, 0xd1, 0x54, 0x1d, 0xb0, - 0x18, 0x76, 0x40, 0x3d, 0xeb, 0xd9, 0x7f, 0x36, 0xa0, 0xac, 0x36, 0xfc, 0xfc, 0xd0, 0xc3, 0x92, - 0x78, 0x4f, 0x8e, 0x5d, 0x7c, 0x84, 0xae, 0x02, 0x74, 0xb9, 0x37, 0xe9, 0x74, 0x27, 0x52, 0xdf, - 0xa0, 0x1a, 0x95, 0xa2, 0x5b, 0x50, 0x92, 0xb6, 0x12, 0xa0, 0x1b, 0xb0, 0x86, 0x03, 0x39, 0xec, - 0x50, 0xd6, 0xe7, 0x11, 0x26, 0xa3, 0x31, 0x97, 0x94, 0xf8, 0x01, 0xeb, 0xf3, 0x10, 0x37, 0x7b, - 0x11, 0x6b, 0x9e, 0xb8, 0x88, 0xdd, 0x84, 0xd5, 0xe4, 0xec, 0xd2, 0xb9, 0x13, 0x5d, 0xc2, 0x16, - 0xe2, 0xd3, 0xcb, 0x1d, 0xf4, 0x03, 0x28, 0x4d, 0x9f, 0xd7, 0x6f, 0x3b, 0x4d, 0xeb, 0xe7, 0x79, - 0x8d, 0x29, 0xc6, 0x18, 0x25, 0xb4, 0xbf, 0x34, 0xe1, 0xf2, 0x8c, 0x0b, 0x6d, 0xee, 0x4d, 0xd0, - 0x6d, 0xc8, 0x8f, 0x89, 0x10, 0x78, 0x10, 0xdd, 0x01, 0xcf, 0x4b, 0xb2, 0x04, 0xa5, 0xaa, 0x7b, - 0x4c, 0xc6, 0x3c, 0xae, 0x6e, 0x35, 0x56, 0x26, 0x48, 0x3a, 0x26, 0x3c, 0x90, 0x9d, 0x21, 0xa1, - 0x83, 0xa1, 0x8c, 0x78, 0xbc, 0x14, 0x49, 0xf7, 0xb4, 0x10, 0x5d, 0x87, 0x92, 0xe0, 0x63, 0xd2, - 0x99, 0x1e, 0xc5, 0xb2, 0xfa, 0x28, 0x56, 0x54, 0xd2, 0xfd, 0xc8, 0x58, 0xb4, 0x07, 0x1f, 0xce, - 0xa2, 0x3a, 0xa7, 0x34, 0xe6, 0xdf, 0x85, 0x8d, 0xf9, 0x83, 0xf4, 0xca, 0xfd, 0xd7, 0x9b, 0x74, - 0x1b, 0x2e, 0x93, 0x63, 0x49, 0x98, 0xca, 0x91, 0x0e, 0xd7, 0xd7, 0xc9, 0xc2, 0xfa, 0x66, 0xe5, - 0x0c, 0x37, 0xcb, 0x09, 0xfe, 0x71, 0x08, 0x47, 0x4f, 0x61, 0x73, 0x66, 0xfb, 0x53, 0x14, 0xae, - 0x9d, 0xa1, 0xf0, 0x4a, 0xea, 0xcd, 0x71, 0xff, 0x35, 0xdd, 0xf6, 0x73, 0x03, 0xde, 0x4b, 0x85, - 0xa4, 0x15, 0xa5, 0x05, 0xba, 0x0b, 0xc5, 0xf0, 0x02, 0x5f, 0xe7, 0x4e, 0x1c, 0x98, 0xab, 0xd5, - 0xf0, 0x07, 0x95, 0xaa, 0x3c, 0xae, 0x46, 0x3f, 0xa8, 0x54, 0x3f, 0xd3, 0x30, 0xb5, 0xc8, 0x5d, - 0x15, 0xc9, 0x58, 0xa0, 0xca, 0xf4, 0xce, 0x4d, 0x15, 0xcd, 0xc9, 0x85, 0xbb, 0x84, 0x84, 0x77, - 0x71, 0x33, 0xd9, 0xd5, 0xd0, 0x71, 0x4b, 0x65, 0x57, 0x63, 0xd1, 0xec, 0xba, 0x19, 0x26, 0x97, - 0x4b, 0x0e, 0x89, 0x72, 0xe5, 0x73, 0xca, 0xa4, 0x4e, 0x15, 0x16, 0x8c, 0x43, 0xfb, 0xb3, 0xae, - 0x1e, 0xb7, 0xf7, 0x9e, 0xbf, 0xdc, 0x34, 0x5e, 0xbc, 0xdc, 0x34, 0xfe, 0xf1, 0x72, 0xd3, 0xf8, - 0xf2, 0xd5, 0xe6, 0xd2, 0x8b, 0x57, 0x9b, 0x4b, 0x7f, 0x7b, 0xb5, 0xb9, 0xf4, 0xb4, 0x3a, 0xa0, - 0x72, 0x18, 0x74, 0xab, 0x3d, 0x3e, 0xae, 0x45, 0x3f, 0x1d, 0x85, 0xff, 0x6e, 0x09, 0xef, 0xa0, - 0xa6, 0xea, 0x3e, 0x90, 0x74, 0x54, 0x8b, 0x1b, 0x40, 0x77, 0x59, 0x13, 0xdd, 0xf8, 0x4f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xdd, 0x4c, 0x01, 0xd9, 0xb0, 0x1a, 0x00, 0x00, -} - -func (m *Dog) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Dog) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Dog) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Size_) > 0 { - i -= len(m.Size_) - copy(dAtA[i:], m.Size_) - i = encodeVarintProto(dAtA, i, uint64(len(m.Size_))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Cat) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Cat) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Cat) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Lives != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Lives)) - i-- - dAtA[i] = 0x10 - } - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintProto(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HasAnimal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HasAnimal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x10 - } - if m.Animal != nil { - { - size, err := m.Animal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HasHasAnimal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HasHasAnimal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HasAnimal != nil { - { - size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HasHasHasAnimal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HasHasHasAnimal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HasHasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HasHasAnimal != nil { - { - size, err := m.HasHasAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestMsg) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signers) > 0 { - for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signers[iNdEx]) - copy(dAtA[i:], m.Signers[iNdEx]) - i = encodeVarintProto(dAtA, i, uint64(len(m.Signers[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *BadMultiSignature) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BadMultiSignature) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BadMultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.MaliciousField) > 0 { - i -= len(m.MaliciousField) - copy(dAtA[i:], m.MaliciousField) - i = encodeVarintProto(dAtA, i, uint64(len(m.MaliciousField))) - i-- - dAtA[i] = 0x2a - } - if len(m.Signatures) > 0 { - for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signatures[iNdEx]) - copy(dAtA[i:], m.Signatures[iNdEx]) - i = encodeVarintProto(dAtA, i, uint64(len(m.Signatures[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Customer1) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Customer1) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Customer1) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Payment) > 0 { - i -= len(m.Payment) - copy(dAtA[i:], m.Payment) - i = encodeVarintProto(dAtA, i, uint64(len(m.Payment))) - i-- - dAtA[i] = 0x3a - } - if m.SubscriptionFee != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.SubscriptionFee)))) - i-- - dAtA[i] = 0x1d - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Customer2) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Customer2) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Customer2) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Reserved != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Reserved)) - i-- - dAtA[i] = 0x41 - i-- - dAtA[i] = 0xb8 - } - if m.Miscellaneous != nil { - { - size, err := m.Miscellaneous.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - if m.City != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.City)) - i-- - dAtA[i] = 0x30 - } - if m.Fewer != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Fewer)))) - i-- - dAtA[i] = 0x25 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if m.Industry != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Industry)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Nested4A) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Nested4A) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested4A) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Nested3A) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Nested3A) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested3A) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Index) > 0 { - for k := range m.Index { - v := m.Index[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i = encodeVarintProto(dAtA, i, uint64(k)) - i-- - dAtA[i] = 0x8 - i = encodeVarintProto(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if len(m.A4) > 0 { - for iNdEx := len(m.A4) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.A4[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Nested2A) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Nested2A) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested2A) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Nested != nil { - { - size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Nested1A) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Nested1A) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested1A) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Nested != nil { - { - size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Nested4B) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Nested4B) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested4B) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if m.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Nested3B) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Nested3B) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested3B) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.B4) > 0 { - for iNdEx := len(m.B4) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.B4[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if m.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Nested2B) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Nested2B) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested2B) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Route) > 0 { - i -= len(m.Route) - copy(dAtA[i:], m.Route) - i = encodeVarintProto(dAtA, i, uint64(len(m.Route))) - i-- - dAtA[i] = 0x22 - } - if m.Nested != nil { - { - size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Fee != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Fee)))) - i-- - dAtA[i] = 0x11 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Nested1B) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Nested1B) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested1B) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) - i-- - dAtA[i] = 0x18 - } - if m.Nested != nil { - { - size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Customer3) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Customer3) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Customer3) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Original != nil { - { - size, err := m.Original.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.Payment != nil { - { - size := m.Payment.Size() - i -= size - if _, err := m.Payment.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Destination) > 0 { - i -= len(m.Destination) - copy(dAtA[i:], m.Destination) - i = encodeVarintProto(dAtA, i, uint64(len(m.Destination))) - i-- - dAtA[i] = 0x2a - } - if m.Surcharge != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Surcharge)))) - i-- - dAtA[i] = 0x25 - } - if m.Sf != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Sf)))) - i-- - dAtA[i] = 0x1d - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Customer3_CreditCardNo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Customer3_CreditCardNo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.CreditCardNo) - copy(dAtA[i:], m.CreditCardNo) - i = encodeVarintProto(dAtA, i, uint64(len(m.CreditCardNo))) - i-- - dAtA[i] = 0x3a - return len(dAtA) - i, nil -} -func (m *Customer3_ChequeNo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Customer3_ChequeNo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.ChequeNo) - copy(dAtA[i:], m.ChequeNo) - i = encodeVarintProto(dAtA, i, uint64(len(m.ChequeNo))) - i-- - dAtA[i] = 0x42 - return len(dAtA) - i, nil -} -func (m *TestVersion1) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion1) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Customer1 != nil { - { - size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.D) > 0 { - for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.C) > 0 { - for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.B != nil { - { - size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion1_E) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion1_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *TestVersion1_F) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion1_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.F != nil { - { - size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *TestVersion2) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion2) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NewField != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.NewField)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc8 - } - if m.Customer1 != nil { - { - size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.D) > 0 { - for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.C) > 0 { - for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.B != nil { - { - size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion2_E) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion2_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *TestVersion2_F) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion2_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.F != nil { - { - size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *TestVersion3) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion3) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NonCriticalField) > 0 { - i -= len(m.NonCriticalField) - copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.NonCriticalField))) - i-- - dAtA[i] = 0x40 - i-- - dAtA[i] = 0xba - } - if m.Customer1 != nil { - { - size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.D) > 0 { - for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.C) > 0 { - for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.B != nil { - { - size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion3_E) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *TestVersion3_F) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.F != nil { - { - size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *TestVersion3LoneOneOfValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion3LoneOneOfValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NonCriticalField) > 0 { - i -= len(m.NonCriticalField) - copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.NonCriticalField))) - i-- - dAtA[i] = 0x40 - i-- - dAtA[i] = 0xba - } - if m.Customer1 != nil { - { - size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.D) > 0 { - for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.C) > 0 { - for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.B != nil { - { - size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion3LoneOneOfValue_E) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3LoneOneOfValue_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *TestVersion3LoneNesting) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion3LoneNesting) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NonCriticalField) > 0 { - i -= len(m.NonCriticalField) - copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.NonCriticalField))) - i-- - dAtA[i] = 0x40 - i-- - dAtA[i] = 0xba - } - if m.Inner2 != nil { - { - size, err := m.Inner2.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - if m.Inner1 != nil { - { - size, err := m.Inner1.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - if m.Customer1 != nil { - { - size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.D) > 0 { - for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.C) > 0 { - for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.B != nil { - { - size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion3LoneNesting_F) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.F != nil { - { - size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *TestVersion3LoneNesting_Inner1) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion3LoneNesting_Inner1) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Inner != nil { - { - size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion3LoneNesting_Inner1_InnerInner) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion3LoneNesting_Inner1_InnerInner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3LoneNesting_Inner1_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.City) > 0 { - i -= len(m.City) - copy(dAtA[i:], m.City) - i = encodeVarintProto(dAtA, i, uint64(len(m.City))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestVersion3LoneNesting_Inner2) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion3LoneNesting_Inner2) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Inner != nil { - { - size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Country) > 0 { - i -= len(m.Country) - copy(dAtA[i:], m.Country) - i = encodeVarintProto(dAtA, i, uint64(len(m.Country))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestVersion3LoneNesting_Inner2_InnerInner) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion3LoneNesting_Inner2_InnerInner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion3LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.City) > 0 { - i -= len(m.City) - copy(dAtA[i:], m.City) - i = encodeVarintProto(dAtA, i, uint64(len(m.City))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestVersion4LoneNesting) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion4LoneNesting) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NonCriticalField) > 0 { - i -= len(m.NonCriticalField) - copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.NonCriticalField))) - i-- - dAtA[i] = 0x40 - i-- - dAtA[i] = 0xba - } - if m.Inner2 != nil { - { - size, err := m.Inner2.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - if m.Inner1 != nil { - { - size, err := m.Inner1.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - if m.Customer1 != nil { - { - size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.D) > 0 { - for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.C) > 0 { - for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.C[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.B != nil { - { - size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion4LoneNesting_F) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion4LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.F != nil { - { - size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *TestVersion4LoneNesting_Inner1) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion4LoneNesting_Inner1) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion4LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Inner != nil { - { - size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.City) > 0 { - i -= len(m.City) - copy(dAtA[i:], m.City) - i = encodeVarintProto(dAtA, i, uint64(len(m.City))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersion4LoneNesting_Inner2) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion4LoneNesting_Inner2) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion4LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Inner != nil { - { - size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Country) > 0 { - i -= len(m.Country) - copy(dAtA[i:], m.Country) - i = encodeVarintProto(dAtA, i, uint64(len(m.Country))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestVersion4LoneNesting_Inner2_InnerInner) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersion4LoneNesting_Inner2_InnerInner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersion4LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x10 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestVersionFD1) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersionFD1) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersionFD1) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersionFD1_E) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersionFD1_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *TestVersionFD1_F) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersionFD1_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.F != nil { - { - size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *TestVersionFD1WithExtraAny) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestVersionFD1WithExtraAny) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersionFD1WithExtraAny) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TestVersionFD1WithExtraAny_E) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersionFD1WithExtraAny_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *TestVersionFD1WithExtraAny_F) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestVersionFD1WithExtraAny_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.F != nil { - { - size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *AnyWithExtra) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AnyWithExtra) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AnyWithExtra) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.C != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.C)) - i-- - dAtA[i] = 0x20 - } - if m.B != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.B)) - i-- - dAtA[i] = 0x18 - } - if m.Any != nil { - { - size, err := m.Any.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestUpdatedTxRaw) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestUpdatedTxRaw) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestUpdatedTxRaw) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NewField_1024) > 0 { - i -= len(m.NewField_1024) - copy(dAtA[i:], m.NewField_1024) - i = encodeVarintProto(dAtA, i, uint64(len(m.NewField_1024))) - i-- - dAtA[i] = 0x40 - i-- - dAtA[i] = 0x82 - } - if len(m.NewField_5) > 0 { - i -= len(m.NewField_5) - copy(dAtA[i:], m.NewField_5) - i = encodeVarintProto(dAtA, i, uint64(len(m.NewField_5))) - i-- - dAtA[i] = 0x2a - } - if len(m.Signatures) > 0 { - for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signatures[iNdEx]) - copy(dAtA[i:], m.Signatures[iNdEx]) - i = encodeVarintProto(dAtA, i, uint64(len(m.Signatures[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.AuthInfoBytes) > 0 { - i -= len(m.AuthInfoBytes) - copy(dAtA[i:], m.AuthInfoBytes) - i = encodeVarintProto(dAtA, i, uint64(len(m.AuthInfoBytes))) - i-- - dAtA[i] = 0x12 - } - if len(m.BodyBytes) > 0 { - i -= len(m.BodyBytes) - copy(dAtA[i:], m.BodyBytes) - i = encodeVarintProto(dAtA, i, uint64(len(m.BodyBytes))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestUpdatedTxBody) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestUpdatedTxBody) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NonCriticalExtensionOptions) > 0 { - for iNdEx := len(m.NonCriticalExtensionOptions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.NonCriticalExtensionOptions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7f - i-- - dAtA[i] = 0xfa - } - } - if len(m.SomeNewFieldNonCriticalField) > 0 { - i -= len(m.SomeNewFieldNonCriticalField) - copy(dAtA[i:], m.SomeNewFieldNonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.SomeNewFieldNonCriticalField))) - i-- - dAtA[i] = 0x41 - i-- - dAtA[i] = 0xd2 - } - if len(m.ExtensionOptions) > 0 { - for iNdEx := len(m.ExtensionOptions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ExtensionOptions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3f - i-- - dAtA[i] = 0xfa - } - } - if m.SomeNewField != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.SomeNewField)) - i-- - dAtA[i] = 0x20 - } - if m.TimeoutHeight != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.TimeoutHeight)) - i-- - dAtA[i] = 0x18 - } - if len(m.Memo) > 0 { - i -= len(m.Memo) - copy(dAtA[i:], m.Memo) - i = encodeVarintProto(dAtA, i, uint64(len(m.Memo))) - i-- - dAtA[i] = 0x12 - } - if len(m.Messages) > 0 { - for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TestUpdatedAuthInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestUpdatedAuthInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestUpdatedAuthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NewField_1024) > 0 { - i -= len(m.NewField_1024) - copy(dAtA[i:], m.NewField_1024) - i = encodeVarintProto(dAtA, i, uint64(len(m.NewField_1024))) - i-- - dAtA[i] = 0x40 - i-- - dAtA[i] = 0x82 - } - if len(m.NewField_3) > 0 { - i -= len(m.NewField_3) - copy(dAtA[i:], m.NewField_3) - i = encodeVarintProto(dAtA, i, uint64(len(m.NewField_3))) - i-- - dAtA[i] = 0x1a - } - if m.Fee != nil { - { - size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.SignerInfos) > 0 { - for iNdEx := len(m.SignerInfos) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SignerInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TestRepeatedUints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestRepeatedUints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestRepeatedUints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Nums) > 0 { - dAtA57 := make([]byte, len(m.Nums)*10) - var j56 int - for _, num := range m.Nums { - for num >= 1<<7 { - dAtA57[j56] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j56++ - } - dAtA57[j56] = uint8(num) - j56++ - } - i -= j56 - copy(dAtA[i:], dAtA57[:j56]) - i = encodeVarintProto(dAtA, i, uint64(j56)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProto(dAtA []byte, offset int, v uint64) int { - offset -= sovProto(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Dog) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Size_) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Cat) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Lives != 0 { - n += 1 + sovProto(uint64(m.Lives)) - } - return n -} - -func (m *HasAnimal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Animal != nil { - l = m.Animal.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - return n -} - -func (m *HasHasAnimal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HasAnimal != nil { - l = m.HasAnimal.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *HasHasHasAnimal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HasHasAnimal != nil { - l = m.HasHasAnimal.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Signers) > 0 { - for _, s := range m.Signers { - l = len(s) - n += 1 + l + sovProto(uint64(l)) - } - } - return n -} - -func (m *BadMultiSignature) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Signatures) > 0 { - for _, b := range m.Signatures { - l = len(b) - n += 1 + l + sovProto(uint64(l)) - } - } - l = len(m.MaliciousField) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Customer1) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.SubscriptionFee != 0 { - n += 5 - } - l = len(m.Payment) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Customer2) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - if m.Industry != 0 { - n += 1 + sovProto(uint64(m.Industry)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Fewer != 0 { - n += 5 - } - if m.City != 0 { - n += 1 + sovProto(uint64(m.City)) - } - if m.Miscellaneous != nil { - l = m.Miscellaneous.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.Reserved != 0 { - n += 2 + sovProto(uint64(m.Reserved)) - } - return n -} - -func (m *Nested4A) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Nested3A) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if len(m.A4) > 0 { - for _, e := range m.A4 { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if len(m.Index) > 0 { - for k, v := range m.Index { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovProto(uint64(l)) - } - mapEntrySize := 1 + sovProto(uint64(k)) + l - n += mapEntrySize + 1 + sovProto(uint64(mapEntrySize)) - } - } - return n -} - -func (m *Nested2A) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Nested != nil { - l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Nested1A) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - if m.Nested != nil { - l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Nested4B) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - if m.Age != 0 { - n += 1 + sovProto(uint64(m.Age)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Nested3B) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - if m.Age != 0 { - n += 1 + sovProto(uint64(m.Age)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if len(m.B4) > 0 { - for _, e := range m.B4 { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - return n -} - -func (m *Nested2B) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - if m.Fee != 0 { - n += 9 - } - if m.Nested != nil { - l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.Route) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Nested1B) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - if m.Nested != nil { - l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.Age != 0 { - n += 1 + sovProto(uint64(m.Age)) - } - return n -} - -func (m *Customer3) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Sf != 0 { - n += 5 - } - if m.Surcharge != 0 { - n += 5 - } - l = len(m.Destination) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Payment != nil { - n += m.Payment.Size() - } - if m.Original != nil { - l = m.Original.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Customer3_CreditCardNo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CreditCardNo) - n += 1 + l + sovProto(uint64(l)) - return n -} -func (m *Customer3_ChequeNo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChequeNo) - n += 1 + l + sovProto(uint64(l)) - return n -} -func (m *TestVersion1) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.B != nil { - l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.C) > 0 { - for _, e := range m.C { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if len(m.D) > 0 { - for _, e := range m.D { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.H) > 0 { - for _, e := range m.H { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Customer1 != nil { - l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion1_E) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovProto(uint64(m.E)) - return n -} -func (m *TestVersion1_F) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.F != nil { - l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} -func (m *TestVersion2) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.B != nil { - l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.C) > 0 { - for _, e := range m.C { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if len(m.D) > 0 { - for _, e := range m.D { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.H) > 0 { - for _, e := range m.H { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Customer1 != nil { - l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.NewField != 0 { - n += 2 + sovProto(uint64(m.NewField)) - } - return n -} - -func (m *TestVersion2_E) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovProto(uint64(m.E)) - return n -} -func (m *TestVersion2_F) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.F != nil { - l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} -func (m *TestVersion3) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.B != nil { - l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.C) > 0 { - for _, e := range m.C { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if len(m.D) > 0 { - for _, e := range m.D { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.H) > 0 { - for _, e := range m.H { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Customer1 != nil { - l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.NonCriticalField) - if l > 0 { - n += 2 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion3_E) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovProto(uint64(m.E)) - return n -} -func (m *TestVersion3_F) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.F != nil { - l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} -func (m *TestVersion3LoneOneOfValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.B != nil { - l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.C) > 0 { - for _, e := range m.C { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if len(m.D) > 0 { - for _, e := range m.D { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.H) > 0 { - for _, e := range m.H { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Customer1 != nil { - l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.NonCriticalField) - if l > 0 { - n += 2 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion3LoneOneOfValue_E) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovProto(uint64(m.E)) - return n -} -func (m *TestVersion3LoneNesting) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.B != nil { - l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.C) > 0 { - for _, e := range m.C { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if len(m.D) > 0 { - for _, e := range m.D { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.H) > 0 { - for _, e := range m.H { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Customer1 != nil { - l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.Inner1 != nil { - l = m.Inner1.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.Inner2 != nil { - l = m.Inner2.Size() - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.NonCriticalField) - if l > 0 { - n += 2 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion3LoneNesting_F) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.F != nil { - l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} -func (m *TestVersion3LoneNesting_Inner1) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Inner != nil { - l = m.Inner.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion3LoneNesting_Inner1_InnerInner) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.City) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion3LoneNesting_Inner2) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.Country) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Inner != nil { - l = m.Inner.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion3LoneNesting_Inner2_InnerInner) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.City) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion4LoneNesting) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.B != nil { - l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.C) > 0 { - for _, e := range m.C { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if len(m.D) > 0 { - for _, e := range m.D { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.H) > 0 { - for _, e := range m.H { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Customer1 != nil { - l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.Inner1 != nil { - l = m.Inner1.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.Inner2 != nil { - l = m.Inner2.Size() - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.NonCriticalField) - if l > 0 { - n += 2 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion4LoneNesting_F) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.F != nil { - l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} -func (m *TestVersion4LoneNesting_Inner1) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Inner != nil { - l = m.Inner.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) - } - l = len(m.City) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion4LoneNesting_Inner2) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.Country) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Inner != nil { - l = m.Inner.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestVersion4LoneNesting_Inner2_InnerInner) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Value != 0 { - n += 1 + sovProto(uint64(m.Value)) - } - return n -} - -func (m *TestVersionFD1) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.H) > 0 { - for _, e := range m.H { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - return n -} - -func (m *TestVersionFD1_E) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovProto(uint64(m.E)) - return n -} -func (m *TestVersionFD1_F) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.F != nil { - l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} -func (m *TestVersionFD1WithExtraAny) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) - } - if len(m.H) > 0 { - for _, e := range m.H { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - return n -} - -func (m *TestVersionFD1WithExtraAny_E) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovProto(uint64(m.E)) - return n -} -func (m *TestVersionFD1WithExtraAny_F) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.F != nil { - l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} -func (m *AnyWithExtra) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Any != nil { - l = m.Any.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.B != 0 { - n += 1 + sovProto(uint64(m.B)) - } - if m.C != 0 { - n += 1 + sovProto(uint64(m.C)) - } - return n -} - -func (m *TestUpdatedTxRaw) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.BodyBytes) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.AuthInfoBytes) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if len(m.Signatures) > 0 { - for _, b := range m.Signatures { - l = len(b) - n += 1 + l + sovProto(uint64(l)) - } - } - l = len(m.NewField_5) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.NewField_1024) - if l > 0 { - n += 2 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestUpdatedTxBody) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Messages) > 0 { - for _, e := range m.Messages { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - l = len(m.Memo) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.TimeoutHeight != 0 { - n += 1 + sovProto(uint64(m.TimeoutHeight)) - } - if m.SomeNewField != 0 { - n += 1 + sovProto(uint64(m.SomeNewField)) - } - if len(m.ExtensionOptions) > 0 { - for _, e := range m.ExtensionOptions { - l = e.Size() - n += 2 + l + sovProto(uint64(l)) - } - } - l = len(m.SomeNewFieldNonCriticalField) - if l > 0 { - n += 2 + l + sovProto(uint64(l)) - } - if len(m.NonCriticalExtensionOptions) > 0 { - for _, e := range m.NonCriticalExtensionOptions { - l = e.Size() - n += 2 + l + sovProto(uint64(l)) - } - } - return n -} - -func (m *TestUpdatedAuthInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SignerInfos) > 0 { - for _, e := range m.SignerInfos { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } - } - if m.Fee != nil { - l = m.Fee.Size() - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.NewField_3) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.NewField_1024) - if l > 0 { - n += 2 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestRepeatedUints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Nums) > 0 { - l = 0 - for _, e := range m.Nums { - l += sovProto(uint64(e)) - } - n += 1 + sovProto(uint64(l)) + l - } - return n -} - -func sovProto(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProto(x uint64) (n int) { - return sovProto(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Dog) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Dog: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Dog: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Size_ = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Cat) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Cat: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Cat: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lives", wireType) - } - m.Lives = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Lives |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HasAnimal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HasAnimal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Animal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Animal == nil { - m.Animal = &types.Any{} - } - if err := m.Animal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HasHasAnimal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HasHasAnimal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HasAnimal == nil { - m.HasAnimal = &types.Any{} - } - if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HasHasHasAnimal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HasHasHasAnimal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HasHasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HasHasAnimal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HasHasAnimal == nil { - m.HasHasAnimal = &types.Any{} - } - if err := m.HasHasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BadMultiSignature) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BadMultiSignature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BadMultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) - copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaliciousField", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MaliciousField = append(m.MaliciousField[:0], dAtA[iNdEx:postIndex]...) - if m.MaliciousField == nil { - m.MaliciousField = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Customer1) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Customer1: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Customer1: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionFee", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.SubscriptionFee = float32(math.Float32frombits(v)) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payment", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payment = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Customer2) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Customer2: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Customer2: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Industry", wireType) - } - m.Industry = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Industry |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field Fewer", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.Fewer = float32(math.Float32frombits(v)) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) - } - m.City = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.City |= Customer2_City(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Miscellaneous", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Miscellaneous == nil { - m.Miscellaneous = &types.Any{} - } - if err := m.Miscellaneous.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1047: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reserved", wireType) - } - m.Reserved = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Reserved |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Nested4A) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Nested4A: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Nested4A: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Nested3A) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Nested3A: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Nested3A: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A4", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.A4 = append(m.A4, &Nested4A{}) - if err := m.A4[len(m.A4)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Index == nil { - m.Index = make(map[int64]*Nested4A) - } - var mapkey int64 - var mapvalue *Nested4A - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapkey |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthProto - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthProto - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Nested4A{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Index[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Nested2A) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Nested2A: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Nested2A: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nested", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Nested == nil { - m.Nested = &Nested3A{} - } - if err := m.Nested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Nested1A) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Nested1A: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Nested1A: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nested", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Nested == nil { - m.Nested = &Nested2A{} - } - if err := m.Nested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Nested4B) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Nested4B: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Nested4B: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) - } - m.Age = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Age |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Nested3B) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Nested3B: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Nested3B: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) - } - m.Age = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Age |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B4", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.B4 = append(m.B4, &Nested4B{}) - if err := m.B4[len(m.B4)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Nested2B) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Nested2B: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Nested2B: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Fee = float64(math.Float64frombits(v)) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nested", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Nested == nil { - m.Nested = &Nested3B{} - } - if err := m.Nested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Route = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Nested1B) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Nested1B: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Nested1B: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nested", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Nested == nil { - m.Nested = &Nested2B{} - } - if err := m.Nested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) - } - m.Age = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Age |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Customer3) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Customer3: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Customer3: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field Sf", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.Sf = float32(math.Float32frombits(v)) - case 4: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field Surcharge", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.Surcharge = float32(math.Float32frombits(v)) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Destination", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Destination = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreditCardNo", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payment = &Customer3_CreditCardNo{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChequeNo", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payment = &Customer3_ChequeNo{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Original", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Original == nil { - m.Original = &Customer1{} - } - if err := m.Original.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion1) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestVersion1: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestVersion1: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.A == nil { - m.A = &TestVersion1{} - } - if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.B == nil { - m.B = &TestVersion1{} - } - if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.C = append(m.C, &TestVersion1{}) - if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.D = append(m.D, TestVersion1{}) - if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Sum = &TestVersion1_E{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TestVersion1{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &TestVersion1_F{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.G == nil { - m.G = &types.Any{} - } - if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.H = append(m.H, &TestVersion1{}) - if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Customer1 == nil { - m.Customer1 = &Customer1{} - } - if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion2) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestVersion2: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestVersion2: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.A == nil { - m.A = &TestVersion2{} - } - if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.B == nil { - m.B = &TestVersion2{} - } - if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.C = append(m.C, &TestVersion2{}) - if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.D = append(m.D, &TestVersion2{}) - if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Sum = &TestVersion2_E{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TestVersion2{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &TestVersion2_F{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.G == nil { - m.G = &types.Any{} - } - if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.H = append(m.H, &TestVersion1{}) - if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Customer1 == nil { - m.Customer1 = &Customer1{} - } - if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 25: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NewField", wireType) - } - m.NewField = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NewField |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion3) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestVersion3: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestVersion3: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.A == nil { - m.A = &TestVersion3{} - } - if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.B == nil { - m.B = &TestVersion3{} - } - if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.C = append(m.C, &TestVersion3{}) - if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.D = append(m.D, &TestVersion3{}) - if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Sum = &TestVersion3_E{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TestVersion3{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &TestVersion3_F{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.G == nil { - m.G = &types.Any{} - } - if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.H = append(m.H, &TestVersion1{}) - if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Customer1 == nil { - m.Customer1 = &Customer1{} - } - if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1031: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalField", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NonCriticalField = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestVersion3LoneOneOfValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestVersion3LoneOneOfValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.A == nil { - m.A = &TestVersion3{} - } - if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.B == nil { - m.B = &TestVersion3{} - } - if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.C = append(m.C, &TestVersion3{}) - if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.D = append(m.D, &TestVersion3{}) - if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Sum = &TestVersion3LoneOneOfValue_E{v} - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.G == nil { - m.G = &types.Any{} - } - if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.H = append(m.H, &TestVersion1{}) - if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Customer1 == nil { - m.Customer1 = &Customer1{} - } - if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1031: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalField", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NonCriticalField = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestVersion3LoneNesting: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestVersion3LoneNesting: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.A == nil { - m.A = &TestVersion3{} - } - if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.B == nil { - m.B = &TestVersion3{} - } - if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.C = append(m.C, &TestVersion3{}) - if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.D = append(m.D, &TestVersion3{}) - if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TestVersion3LoneNesting{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &TestVersion3LoneNesting_F{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.G == nil { - m.G = &types.Any{} - } - if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.H = append(m.H, &TestVersion1{}) - if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Customer1 == nil { - m.Customer1 = &Customer1{} - } - if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inner1", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Inner1 == nil { - m.Inner1 = &TestVersion3LoneNesting_Inner1{} - } - if err := m.Inner1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inner2", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Inner2 == nil { - m.Inner2 = &TestVersion3LoneNesting_Inner2{} - } - if err := m.Inner2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1031: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalField", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NonCriticalField = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Inner1: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Inner1: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Inner == nil { - m.Inner = &TestVersion3LoneNesting_Inner1_InnerInner{} - } - if err := m.Inner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InnerInner: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InnerInner: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.City = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Inner2: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Inner2: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Country", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Country = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Inner == nil { - m.Inner = &TestVersion3LoneNesting_Inner2_InnerInner{} - } - if err := m.Inner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InnerInner: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InnerInner: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.City = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestVersion4LoneNesting: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestVersion4LoneNesting: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.A == nil { - m.A = &TestVersion3{} - } - if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.B == nil { - m.B = &TestVersion3{} - } - if err := m.B.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.C = append(m.C, &TestVersion3{}) - if err := m.C[len(m.C)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.D = append(m.D, &TestVersion3{}) - if err := m.D[len(m.D)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TestVersion3LoneNesting{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &TestVersion4LoneNesting_F{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.G == nil { - m.G = &types.Any{} - } - if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.H = append(m.H, &TestVersion1{}) - if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Customer1", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Customer1 == nil { - m.Customer1 = &Customer1{} - } - if err := m.Customer1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inner1", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Inner1 == nil { - m.Inner1 = &TestVersion4LoneNesting_Inner1{} - } - if err := m.Inner1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inner2", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Inner2 == nil { - m.Inner2 = &TestVersion4LoneNesting_Inner2{} - } - if err := m.Inner2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1031: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalField", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NonCriticalField = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Inner1: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Inner1: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Inner == nil { - m.Inner = &TestVersion4LoneNesting_Inner1_InnerInner{} - } - if err := m.Inner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InnerInner: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InnerInner: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.City = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Inner2: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Inner2: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Country", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Country = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Inner == nil { - m.Inner = &TestVersion4LoneNesting_Inner2_InnerInner{} - } - if err := m.Inner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InnerInner: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InnerInner: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestVersionFD1: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestVersionFD1: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.A == nil { - m.A = &TestVersion1{} - } - if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Sum = &TestVersionFD1_E{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TestVersion1{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &TestVersionFD1_F{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.G == nil { - m.G = &types.Any{} - } - if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.H = append(m.H, &TestVersion1{}) - if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestVersionFD1WithExtraAny: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestVersionFD1WithExtraAny: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.A == nil { - m.A = &TestVersion1{} - } - if err := m.A.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Sum = &TestVersionFD1WithExtraAny_E{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TestVersion1{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &TestVersionFD1WithExtraAny_F{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field G", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.G == nil { - m.G = &AnyWithExtra{} - } - if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.H = append(m.H, &TestVersion1{}) - if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AnyWithExtra: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AnyWithExtra: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Any", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Any == nil { - m.Any = &types.Any{} - } - if err := m.Any.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - m.B = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.B |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) - } - m.C = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.C |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestUpdatedTxRaw: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestUpdatedTxRaw: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BodyBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BodyBytes = append(m.BodyBytes[:0], dAtA[iNdEx:postIndex]...) - if m.BodyBytes == nil { - m.BodyBytes = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthInfoBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuthInfoBytes = append(m.AuthInfoBytes[:0], dAtA[iNdEx:postIndex]...) - if m.AuthInfoBytes == nil { - m.AuthInfoBytes = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) - copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewField_5", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewField_5 = append(m.NewField_5[:0], dAtA[iNdEx:postIndex]...) - if m.NewField_5 == nil { - m.NewField_5 = []byte{} - } - iNdEx = postIndex - case 1024: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewField_1024", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewField_1024 = append(m.NewField_1024[:0], dAtA[iNdEx:postIndex]...) - if m.NewField_1024 == nil { - m.NewField_1024 = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestUpdatedTxBody: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestUpdatedTxBody: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Messages = append(m.Messages, &types.Any{}) - if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Memo", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Memo = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) - } - m.TimeoutHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SomeNewField", wireType) - } - m.SomeNewField = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SomeNewField |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 1023: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtensionOptions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExtensionOptions = append(m.ExtensionOptions, &types.Any{}) - if err := m.ExtensionOptions[len(m.ExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1050: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SomeNewFieldNonCriticalField", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SomeNewFieldNonCriticalField = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2047: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NonCriticalExtensionOptions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &types.Any{}) - if err := m.NonCriticalExtensionOptions[len(m.NonCriticalExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestUpdatedAuthInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestUpdatedAuthInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignerInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SignerInfos = append(m.SignerInfos, &tx.SignerInfo{}) - if err := m.SignerInfos[len(m.SignerInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Fee == nil { - m.Fee = &tx.Fee{} - } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewField_3", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewField_3 = append(m.NewField_3[:0], dAtA[iNdEx:postIndex]...) - if m.NewField_3 == nil { - m.NewField_3 = []byte{} - } - iNdEx = postIndex - case 1024: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewField_1024", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewField_1024 = append(m.NewField_1024[:0], dAtA[iNdEx:postIndex]...) - if m.NewField_1024 == nil { - m.NewField_1024 = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestRepeatedUints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestRepeatedUints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Nums = append(m.Nums, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Nums) == 0 { - m.Nums = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Nums = append(m.Nums, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Nums", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProto(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProto - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProto - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProto - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProto = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProto = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProto = fmt.Errorf("proto: unexpected end of group") -) From f18f4e38d8362a2bc970f5da48b13865709cca2d Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 18:37:00 +0200 Subject: [PATCH 08/51] Fix build --- testutil/testdata/grpc_query.go | 2 +- testutil/testdata/msg_service.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testutil/testdata/grpc_query.go b/testutil/testdata/grpc_query.go index 4e517026c80f..6e2b64152995 100644 --- a/testutil/testdata/grpc_query.go +++ b/testutil/testdata/grpc_query.go @@ -11,7 +11,7 @@ import ( type QueryImpl struct{} -var _ QueryServer = QueryImpl +var _ QueryServer = QueryImpl{} func (e QueryImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) { animal, ok := request.AnyAnimal.GetCachedValue().(Animal) diff --git a/testutil/testdata/msg_service.go b/testutil/testdata/msg_service.go index 17115ab5ad5b..d476445c569b 100644 --- a/testutil/testdata/msg_service.go +++ b/testutil/testdata/msg_service.go @@ -6,11 +6,11 @@ import ( type MsgImpl struct{} -var _ MsgServer = MsgImpl +var _ MsgServer = MsgImpl{} // CreateDog implements the MsgServer interface. func (m MsgImpl) CreateDog(_ context.Context, msg *MsgCreateDog) (*MsgCreateDogResponse, error) { return &MsgCreateDogResponse{ Name: msg.Dog.Name, - } + }, nil } From 1ed29dfe28e7f741b491f77c57f43d0c794eb268 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 18:37:34 +0200 Subject: [PATCH 09/51] typo --- baseapp/msg_service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/msg_service_test.go b/baseapp/msg_service_test.go index 693946491010..578fbb539500 100644 --- a/baseapp/msg_service_test.go +++ b/baseapp/msg_service_test.go @@ -4,6 +4,6 @@ import ( "testing" ) -func TestMessageService(t *testing.T) { +func TestMsgService(t *testing.T) { // TODO } From 0d9efc4c6b3daca256a8f90c4644f783b13bb7fd Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 10:50:56 +0200 Subject: [PATCH 10/51] Add router --- baseapp/grpcrouter_helpers.go | 9 ++- baseapp/msg_service.go | 8 --- baseapp/msg_service_router.go | 86 +++++++++++++++++++++++++++ baseapp/msg_service_router_helpers.go | 65 ++++++++++++++++++++ baseapp/msg_service_router_test.go | 32 ++++++++++ baseapp/msg_service_test.go | 9 --- types/tx/types.go | 22 +++++-- 7 files changed, 204 insertions(+), 27 deletions(-) delete mode 100644 baseapp/msg_service.go create mode 100644 baseapp/msg_service_router.go create mode 100644 baseapp/msg_service_router_helpers.go create mode 100644 baseapp/msg_service_router_test.go delete mode 100644 baseapp/msg_service_test.go diff --git a/baseapp/grpcrouter_helpers.go b/baseapp/grpcrouter_helpers.go index 5d4048e0ed1f..da8dd5b2415a 100644 --- a/baseapp/grpcrouter_helpers.go +++ b/baseapp/grpcrouter_helpers.go @@ -4,12 +4,11 @@ import ( gocontext "context" "fmt" - "github.com/cosmos/cosmos-sdk/codec/types" - gogogrpc "github.com/gogo/protobuf/grpc" abci "github.com/tendermint/tendermint/abci/types" "google.golang.org/grpc" + "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,6 +21,9 @@ type QueryServiceTestHelper struct { ctx sdk.Context } +var _ gogogrpc.Server = &QueryServiceTestHelper{} +var _ gogogrpc.ClientConn = &QueryServiceTestHelper{} + // NewQueryServerTestHelper creates a new QueryServiceTestHelper that wraps // the provided sdk.Context func NewQueryServerTestHelper(ctx sdk.Context, interfaceRegistry types.InterfaceRegistry) *QueryServiceTestHelper { @@ -62,6 +64,3 @@ func (q *QueryServiceTestHelper) Invoke(_ gocontext.Context, method string, args func (q *QueryServiceTestHelper) NewStream(gocontext.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) { return nil, fmt.Errorf("not supported") } - -var _ gogogrpc.Server = &QueryServiceTestHelper{} -var _ gogogrpc.ClientConn = &QueryServiceTestHelper{} diff --git a/baseapp/msg_service.go b/baseapp/msg_service.go deleted file mode 100644 index c46c00ae97bd..000000000000 --- a/baseapp/msg_service.go +++ /dev/null @@ -1,8 +0,0 @@ -package baseapp - -type MsgServiceRouter struct{} - -// NewMsgServiceRouter creates a new MsgServiceRouter. -func NewMsgServiceRouter() *MsgServiceRouter { - return &MsgServiceRouter{} -} diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go new file mode 100644 index 000000000000..79e8cbe1e720 --- /dev/null +++ b/baseapp/msg_service_router.go @@ -0,0 +1,86 @@ +package baseapp + +import ( + "fmt" + + gogogrpc "github.com/gogo/protobuf/grpc" + "google.golang.org/grpc" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// MsgServiceRouter routes Msg Service fully-qualified service methods to their +// handler. +type MsgServiceRouter struct { + interfaceRegistry codectypes.InterfaceRegistry + routes map[string]MsgServiceHandler +} + +var _ gogogrpc.Server = &MsgServiceRouter{} + +// NewMsgServiceRouter creates a new MsgServiceRouter. +func NewMsgServiceRouter() *MsgServiceRouter { + return &MsgServiceRouter{ + routes: map[string]MsgServiceHandler{}, + } +} + +// MsgServiceHandler defines a function type which handles ABCI Query requests +// using gRPC +type MsgServiceHandler = func(ctx sdk.Context, data []byte) (*sdk.Result, error) + +// Route returns the MsgServiceHandler for a given query route path or nil +// if not found. +func (msr *MsgServiceRouter) Route(path string) MsgServiceHandler { + handler, found := msr.routes[path] + if !found { + return nil + } + + return handler +} + +// RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC +// service description, handler is an object which implements that gRPC service. +func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { + // adds a top-level query handler based on the gRPC service name + for _, method := range sd.Methods { + fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) + methodHandler := method.Handler + + msr.routes[fqMethod] = func(ctx sdk.Context, data []byte) (*sdk.Result, error) { + // call the method handler from the service description with the handler object, + // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data + res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { + err := protoCodec.Unmarshal(data, i) + if err != nil { + return err + } + if msr.interfaceRegistry != nil { + return codectypes.UnpackInterfaces(i, msr.interfaceRegistry) + } + return nil + }, nil) + if err != nil { + return nil, err + } + + // proto marshal the result bytes + resBytes, err := protoCodec.Marshal(res) + if err != nil { + return nil, err + } + + // return the result bytes as the response value + return &sdk.Result{ + Data: resBytes, + }, nil + } + } +} + +// SetInterfaceRegistry sets the interface registry for the router. +func (msr *MsgServiceRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) { + msr.interfaceRegistry = interfaceRegistry +} diff --git a/baseapp/msg_service_router_helpers.go b/baseapp/msg_service_router_helpers.go new file mode 100644 index 000000000000..8b9b24dcac32 --- /dev/null +++ b/baseapp/msg_service_router_helpers.go @@ -0,0 +1,65 @@ +package baseapp + +import ( + gocontext "context" + "fmt" + + gogogrpc "github.com/gogo/protobuf/grpc" + "google.golang.org/grpc" + + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// MsgServiceTestHelper provides a helper for making grpc msg service +// rpc calls in unit tests. It implements both the grpc Server and ClientConn +// interfaces needed to register a msg service server and create a msg +// service client. +type MsgServiceTestHelper struct { + *MsgServiceRouter + ctx sdk.Context +} + +var _ gogogrpc.Server = &MsgServiceTestHelper{} +var _ gogogrpc.ClientConn = &MsgServiceTestHelper{} + +// NewMsgServerTestHelper creates a new MsgServiceTestHelper that wraps +// the provided sdk.Context +func NewMsgServerTestHelper(ctx sdk.Context, interfaceRegistry types.InterfaceRegistry) *MsgServiceTestHelper { + qrt := NewMsgServiceRouter() + qrt.SetInterfaceRegistry(interfaceRegistry) + return &MsgServiceTestHelper{MsgServiceRouter: qrt, ctx: ctx} +} + +// Invoke implements the grpc ClientConn.Invoke method +func (q *MsgServiceTestHelper) Invoke(_ gocontext.Context, method string, args, reply interface{}, _ ...grpc.CallOption) error { + querier := q.Route(method) + if querier == nil { + return fmt.Errorf("handler not found for %s", method) + } + reqBz, err := protoCodec.Marshal(args) + if err != nil { + return err + } + + res, err := querier(q.ctx, reqBz) + if err != nil { + return err + } + + err = protoCodec.Unmarshal(res.Data, reply) + if err != nil { + return err + } + + if q.interfaceRegistry != nil { + return types.UnpackInterfaces(reply, q.interfaceRegistry) + } + + return nil +} + +// NewStream implements the grpc ClientConn.NewStream method +func (q *MsgServiceTestHelper) NewStream(gocontext.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) { + return nil, fmt.Errorf("not supported") +} diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go new file mode 100644 index 000000000000..cbe9914824fc --- /dev/null +++ b/baseapp/msg_service_router_test.go @@ -0,0 +1,32 @@ +package baseapp + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func TestMsgService(t *testing.T) { + qr := NewMsgServiceRouter() + interfaceRegistry := testdata.NewTestInterfaceRegistry() + qr.SetInterfaceRegistry(interfaceRegistry) + testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) + helper := &MsgServiceTestHelper{ + MsgServiceRouter: qr, + ctx: sdk.Context{}.WithContext(context.Background()), + } + client := testdata.NewMsgClient(helper) + + res, err := client.CreateDog(context.Background(), &testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "spot"}}) + require.Nil(t, err) + require.NotNil(t, res) + require.Equal(t, "spot", res.Name) + + require.Panics(t, func() { + _, _ = client.CreateDog(context.Background(), nil) + }) +} diff --git a/baseapp/msg_service_test.go b/baseapp/msg_service_test.go deleted file mode 100644 index 578fbb539500..000000000000 --- a/baseapp/msg_service_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package baseapp - -import ( - "testing" -) - -func TestMsgService(t *testing.T) { - // TODO -} diff --git a/types/tx/types.go b/types/tx/types.go index b5463c1bcc71..932ac27de9a0 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -1,7 +1,8 @@ package tx import ( - fmt "fmt" + "fmt" + "strings" "github.com/tendermint/tendermint/crypto" @@ -138,12 +139,23 @@ func (t *Tx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { // UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method func (m *TxBody) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, any := range m.Messages { - var msg sdk.Msg - err := unpacker.UnpackAny(any, &msg) - if err != nil { - return err + // If the any's typeUrl contains 2 slashes, then we unpack the any into + // a ServiceMsg struct as per ADR-031. + if nSlashes := len(strings.Split("/", any.TypeUrl)); nSlashes >= 3 { + var serviceMsg sdk.ServiceMsg + err := unpacker.UnpackAny(any, &serviceMsg) + if err != nil { + return err + } + } else { + var msg sdk.Msg + err := unpacker.UnpackAny(any, &msg) + if err != nil { + return err + } } } + return nil } From be1a26b9f2a30117b127cd54fe85333556390f6f Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 10:52:28 +0200 Subject: [PATCH 11/51] Fix test --- baseapp/msg_service_router_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go index cbe9914824fc..81514dd7344d 100644 --- a/baseapp/msg_service_router_test.go +++ b/baseapp/msg_service_router_test.go @@ -14,7 +14,7 @@ func TestMsgService(t *testing.T) { qr := NewMsgServiceRouter() interfaceRegistry := testdata.NewTestInterfaceRegistry() qr.SetInterfaceRegistry(interfaceRegistry) - testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) + testdata.RegisterMsgServer(qr, testdata.MsgImpl{}) helper := &MsgServiceTestHelper{ MsgServiceRouter: qr, ctx: sdk.Context{}.WithContext(context.Background()), From fef78cf8b04c089c34735384921cf6256c0f892c Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 12:52:42 +0200 Subject: [PATCH 12/51] WIP --- buf.yaml | 1 + proto/cosmos/bank/v1beta1/tx.proto | 15 + types/result.go | 30 ++ types/result_test.go | 35 +++ types/tx/types.go | 2 +- x/bank/handler.go | 89 +----- x/bank/keeper/keeper_test.go | 6 + x/bank/keeper/msg_server.go | 104 +++++++ x/bank/types/tx.pb.go | 421 +++++++++++++++++++++++++++-- 9 files changed, 593 insertions(+), 110 deletions(-) create mode 100644 x/bank/keeper/msg_server.go diff --git a/buf.yaml b/buf.yaml index adaef5ff18ef..33388763d7a3 100644 --- a/buf.yaml +++ b/buf.yaml @@ -14,6 +14,7 @@ lint: - COMMENT_FIELD - SERVICE_SUFFIX - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME ignore: - tendermint - gogoproto diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index 449deba115f7..0216ad665ed7 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -7,6 +7,15 @@ import "cosmos/bank/v1beta1/bank.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; +// Msg defines the bank Msg service. +service Msg { + // Send defines a method for sending coins from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); + + // MultiSend defines a method for sending coins from some accounts to other accounts. + rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); +} + // MsgSend represents a message to send coins from one account to another. message MsgSend { option (gogoproto.equal) = false; @@ -18,6 +27,9 @@ message MsgSend { [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse { } + // MsgMultiSend represents an arbitrary multi-in, multi-out send message. message MsgMultiSend { option (gogoproto.equal) = false; @@ -25,3 +37,6 @@ message MsgMultiSend { repeated Input inputs = 1 [(gogoproto.nullable) = false]; repeated Output outputs = 2 [(gogoproto.nullable) = false]; } + +// MsgMultiSendResponse defines the Msg/MultiSend response type. +message MsgMultiSendResponse { } diff --git a/types/result.go b/types/result.go index 02467e0a309e..6a50ecffbacd 100644 --- a/types/result.go +++ b/types/result.go @@ -7,8 +7,11 @@ import ( "math" "strings" + "github.com/gogo/protobuf/proto" + yaml "gopkg.in/yaml.v2" + abci "github.com/tendermint/tendermint/abci/types" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/cosmos/cosmos-sdk/codec" @@ -263,3 +266,30 @@ func (r TxResponse) GetTx() Tx { } return nil } + +// WrapServiceResult wraps a result from a protobuf RPC service method call in +// a Result object or error. This method takes care of marshaling the res param to +// protobuf and attaching any events on the ctx.EventManager() to the Result. +func WrapServiceResult(ctx Context, res proto.Message, err error) (*Result, error) { + if err != nil { + return nil, err + } + + var data []byte + if res != nil { + data, err = proto.Marshal(res) + if err != nil { + return nil, err + } + } + + var events []abci.Event + if evtMgr := ctx.EventManager(); evtMgr != nil { + events = evtMgr.ABCIEvents() + } + + return &Result{ + Data: data, + Events: events, + }, nil +} diff --git a/types/result_test.go b/types/result_test.go index 44d66023752e..6ca9731f8cc4 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -2,9 +2,13 @@ package types_test import ( "encoding/hex" + "fmt" "strings" "testing" + "github.com/golang/protobuf/proto" + + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" @@ -12,6 +16,7 @@ import ( ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -180,3 +185,33 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { s.Require().Equal(want, sdk.NewResponseFormatBroadcastTxCommit(checkTxResult)) s.Require().Equal(want, sdk.NewResponseFormatBroadcastTxCommit(deliverTxResult)) } + +func TestWrapServiceResult(t *testing.T) { + ctx := sdk.Context{} + + res, err := sdk.WrapServiceResult(ctx, nil, fmt.Errorf("test")) + require.Nil(t, res) + require.NotNil(t, err) + + res, err = sdk.WrapServiceResult(ctx, nil, nil) + require.NotNil(t, res) + require.Nil(t, err) + require.Empty(t, res.Events) + + ctx = ctx.WithEventManager(sdk.NewEventManager()) + ctx.EventManager().EmitEvent(sdk.NewEvent("test")) + res, err = sdk.WrapServiceResult(ctx, nil, nil) + require.NotNil(t, res) + require.Nil(t, err) + require.Len(t, res.Events, 1) + + spot := testdata.Dog{Name: "spot"} + res, err = sdk.WrapServiceResult(ctx, &spot, nil) + require.NotNil(t, res) + require.Nil(t, err) + require.Len(t, res.Events, 1) + var spot2 testdata.Dog + err = proto.Unmarshal(res.Data, &spot2) + require.NoError(t, err) + require.Equal(t, spot, spot2) +} diff --git a/types/tx/types.go b/types/tx/types.go index 932ac27de9a0..d5ee1160385c 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -141,7 +141,7 @@ func (m *TxBody) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, any := range m.Messages { // If the any's typeUrl contains 2 slashes, then we unpack the any into // a ServiceMsg struct as per ADR-031. - if nSlashes := len(strings.Split("/", any.TypeUrl)); nSlashes >= 3 { + if nSlashes := len(strings.Split("/", any.TypeUrl)) - 1; nSlashes >= 2 { var serviceMsg sdk.ServiceMsg err := unpacker.UnpackAny(any, &serviceMsg) if err != nil { diff --git a/x/bank/handler.go b/x/bank/handler.go index f2f710fa2fd9..d7c04897a5df 100644 --- a/x/bank/handler.go +++ b/x/bank/handler.go @@ -1,9 +1,6 @@ package bank import ( - metrics "github.com/armon/go-metrics" - - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -15,93 +12,19 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) + msgServer := keeper.NewMsgServerImpl(k) + switch msg := msg.(type) { case *types.MsgSend: - return handleMsgSend(ctx, k, msg) + res, err := msgServer.Send(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgMultiSend: - return handleMsgMultiSend(ctx, k, msg) + res, err := msgServer.MultiSend(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized bank message type: %T", msg) } } } - -// Handle MsgSend. -func handleMsgSend(ctx sdk.Context, k keeper.Keeper, msg *types.MsgSend) (*sdk.Result, error) { - if err := k.SendEnabledCoins(ctx, msg.Amount...); err != nil { - return nil, err - } - - from, err := sdk.AccAddressFromBech32(msg.FromAddress) - if err != nil { - return nil, err - } - to, err := sdk.AccAddressFromBech32(msg.ToAddress) - if err != nil { - return nil, err - } - - if k.BlockedAddr(to) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) - } - - err = k.SendCoins(ctx, from, to, msg.Amount) - if err != nil { - return nil, err - } - - defer func() { - for _, a := range msg.Amount { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "send"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - }() - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -// Handle MsgMultiSend. -func handleMsgMultiSend(ctx sdk.Context, k keeper.Keeper, msg *types.MsgMultiSend) (*sdk.Result, error) { - // NOTE: totalIn == totalOut should already have been checked - for _, in := range msg.Inputs { - if err := k.SendEnabledCoins(ctx, in.Coins...); err != nil { - return nil, err - } - } - - for _, out := range msg.Outputs { - accAddr, err := sdk.AccAddressFromBech32(out.Address) - if err != nil { - panic(err) - } - if k.BlockedAddr(accAddr) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive transactions", out.Address) - } - } - - err := k.InputOutputCoins(ctx, msg.Inputs, msg.Outputs) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index aea72006a45f..435bc6858fb1 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -64,6 +64,7 @@ type IntegrationTestSuite struct { app *simapp.SimApp ctx sdk.Context queryClient types.QueryClient + msgClient types.MsgClient } func (suite *IntegrationTestSuite) SetupTest() { @@ -77,9 +78,14 @@ func (suite *IntegrationTestSuite) SetupTest() { types.RegisterQueryServer(queryHelper, app.BankKeeper) queryClient := types.NewQueryClient(queryHelper) + msgHelper := baseapp.NewMsgServerTestHelper(ctx, app.InterfaceRegistry()) + types.RegisterMsgServer(msgHelper, keeper.NewMsgServerImpl(app.BankKeeper)) + msgClient := types.NewMsgClient(msgHelper) + suite.app = app suite.ctx = ctx suite.queryClient = queryClient + suite.msgClient = msgClient } func (suite *IntegrationTestSuite) TestSupply() { diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go new file mode 100644 index 000000000000..024d857dab73 --- /dev/null +++ b/x/bank/keeper/msg_server.go @@ -0,0 +1,104 @@ +package keeper + +import ( + "context" + + "github.com/armon/go-metrics" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) Send(goCtx context.Context, msg *types.MsgSend) (*types.MsgSendResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := k.SendEnabledCoins(ctx, msg.Amount...); err != nil { + return nil, err + } + + from, err := sdk.AccAddressFromBech32(msg.FromAddress) + if err != nil { + return nil, err + } + to, err := sdk.AccAddressFromBech32(msg.ToAddress) + if err != nil { + return nil, err + } + + if k.BlockedAddr(to) { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) + } + + err = k.SendCoins(ctx, from, to, msg.Amount) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range msg.Amount { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "send"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + }() + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + ) + + return &types.MsgSendResponse{}, nil +} + +func (k msgServer) MultiSend(goCtx context.Context, msg *types.MsgMultiSend) (*types.MsgMultiSendResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // NOTE: totalIn == totalOut should already have been checked + for _, in := range msg.Inputs { + if err := k.SendEnabledCoins(ctx, in.Coins...); err != nil { + return nil, err + } + } + + for _, out := range msg.Outputs { + accAddr, err := sdk.AccAddressFromBech32(out.Address) + if err != nil { + panic(err) + } + if k.BlockedAddr(accAddr) { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive transactions", out.Address) + } + } + + err := k.InputOutputCoins(ctx, msg.Inputs, msg.Outputs) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + ) + + return &types.MsgMultiSendResponse{}, nil +} diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index e91fe4547bf8..abc37dcf0ae7 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -4,11 +4,16 @@ package types import ( + context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -65,6 +70,42 @@ func (m *MsgSend) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSend proto.InternalMessageInfo +type MsgSendResponse struct { +} + +func (m *MsgSendResponse) Reset() { *m = MsgSendResponse{} } +func (m *MsgSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSendResponse) ProtoMessage() {} +func (*MsgSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{1} +} +func (m *MsgSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendResponse.Merge(m, src) +} +func (m *MsgSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendResponse proto.InternalMessageInfo + // MsgMultiSend represents an arbitrary multi-in, multi-out send message. type MsgMultiSend struct { Inputs []Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs"` @@ -75,7 +116,7 @@ func (m *MsgMultiSend) Reset() { *m = MsgMultiSend{} } func (m *MsgMultiSend) String() string { return proto.CompactTextString(m) } func (*MsgMultiSend) ProtoMessage() {} func (*MsgMultiSend) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{1} + return fileDescriptor_1d8cb1613481f5b7, []int{2} } func (m *MsgMultiSend) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -118,39 +159,197 @@ func (m *MsgMultiSend) GetOutputs() []Output { return nil } +type MsgMultiSendResponse struct { +} + +func (m *MsgMultiSendResponse) Reset() { *m = MsgMultiSendResponse{} } +func (m *MsgMultiSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgMultiSendResponse) ProtoMessage() {} +func (*MsgMultiSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{3} +} +func (m *MsgMultiSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMultiSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMultiSendResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgMultiSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMultiSendResponse.Merge(m, src) +} +func (m *MsgMultiSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMultiSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMultiSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMultiSendResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSend)(nil), "cosmos.bank.v1beta1.MsgSend") + proto.RegisterType((*MsgSendResponse)(nil), "cosmos.bank.v1beta1.MsgSendResponse") proto.RegisterType((*MsgMultiSend)(nil), "cosmos.bank.v1beta1.MsgMultiSend") + proto.RegisterType((*MsgMultiSendResponse)(nil), "cosmos.bank.v1beta1.MsgMultiSendResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 374 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0xcc, 0xcb, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x81, 0x64, 0xf5, - 0xa0, 0xb2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 0x54, 0x4a, - 0x0e, 0x6e, 0x50, 0x71, 0x2a, 0xdc, 0xa0, 0xe4, 0xfc, 0xcc, 0x3c, 0x0c, 0x79, 0x24, 0x8b, 0xc0, - 0xe6, 0x82, 0xe5, 0x95, 0x5e, 0x31, 0x72, 0xb1, 0xfb, 0x16, 0xa7, 0x07, 0xa7, 0xe6, 0xa5, 0x08, - 0x59, 0x71, 0xf1, 0xa4, 0x15, 0xe5, 0xe7, 0xc6, 0x27, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x4b, - 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x89, 0x7f, 0xba, 0x27, 0x2f, 0x5c, 0x99, 0x98, 0x9b, 0x63, - 0xa5, 0x84, 0x2c, 0xab, 0x14, 0xc4, 0x0d, 0xe2, 0x3a, 0x42, 0x78, 0x42, 0x26, 0x5c, 0x5c, 0x25, - 0xf9, 0x70, 0x9d, 0x4c, 0x60, 0x9d, 0xa2, 0x9f, 0xee, 0xc9, 0x0b, 0x42, 0x74, 0x22, 0xe4, 0x94, - 0x82, 0x38, 0x4b, 0xf2, 0x61, 0xba, 0x92, 0xb9, 0xd8, 0x12, 0x73, 0xf3, 0x4b, 0xf3, 0x4a, 0x24, - 0x98, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x24, 0xf5, 0xe0, 0x3e, 0x2f, 0x4e, 0x85, 0xf9, 0x5c, 0xcf, - 0x39, 0x3f, 0x33, 0xcf, 0xc9, 0xe0, 0xc4, 0x3d, 0x79, 0x86, 0x55, 0xf7, 0xe5, 0x35, 0xd2, 0x33, - 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xa1, 0x7e, 0x83, 0x50, 0xba, 0xc5, 0x29, - 0xd9, 0xfa, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x60, 0x0d, 0xc5, 0x41, 0x50, 0xa3, 0xad, 0x38, 0x3a, - 0x16, 0xc8, 0x33, 0xbc, 0x58, 0x20, 0xcf, 0xa0, 0xd4, 0xcd, 0xc8, 0xc5, 0xe3, 0x5b, 0x9c, 0xee, - 0x5b, 0x9a, 0x53, 0x92, 0x09, 0xf6, 0xb1, 0x05, 0x17, 0x5b, 0x66, 0x5e, 0x41, 0x69, 0x09, 0xc8, - 0xaf, 0x20, 0xfb, 0xa5, 0xf4, 0xb0, 0x84, 0xbc, 0x9e, 0x27, 0x48, 0x89, 0x13, 0x0b, 0xc8, 0x01, - 0x41, 0x50, 0xf5, 0x42, 0xd6, 0x5c, 0xec, 0xf9, 0xa5, 0x25, 0x60, 0xad, 0x4c, 0x60, 0xad, 0xd2, - 0x58, 0xb5, 0xfa, 0x83, 0xd5, 0x40, 0xf5, 0xc2, 0x74, 0x58, 0xb1, 0x80, 0x5c, 0xe3, 0xe4, 0x7c, - 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, - 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x9a, 0x78, 0xfd, 0x58, 0x01, 0x89, - 0x4c, 0xb0, 0x57, 0x93, 0xd8, 0xc0, 0xd1, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x84, - 0x52, 0xaa, 0x51, 0x02, 0x00, 0x00, + // 436 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x3f, 0xef, 0xd2, 0x40, + 0x1c, 0xc6, 0x7b, 0x3f, 0x08, 0x3f, 0x39, 0x48, 0x0c, 0x05, 0x15, 0x2b, 0x69, 0xb1, 0x71, 0x80, + 0xc1, 0xab, 0xa0, 0x83, 0xa9, 0x93, 0x65, 0xd2, 0xa4, 0x31, 0xa9, 0x93, 0x2e, 0xa6, 0x7f, 0xce, + 0xda, 0x40, 0x7b, 0x0d, 0x77, 0x35, 0xf0, 0x0e, 0x4c, 0x5c, 0x7c, 0x09, 0xcc, 0xc6, 0x17, 0xc2, + 0xc8, 0xe8, 0x84, 0x06, 0x16, 0xe3, 0xc8, 0x2b, 0x30, 0xbd, 0xfe, 0x81, 0x44, 0xc4, 0xa9, 0xbd, + 0x3c, 0xdf, 0xcf, 0xd3, 0xe7, 0xe9, 0xf7, 0x60, 0xcf, 0x25, 0x34, 0x24, 0x54, 0x73, 0xec, 0x68, + 0xaa, 0x7d, 0x1c, 0x39, 0x98, 0xd9, 0x23, 0x8d, 0x2d, 0x50, 0x3c, 0x27, 0x8c, 0x88, 0xed, 0x4c, + 0x45, 0xa9, 0x8a, 0x72, 0x55, 0xea, 0xf8, 0xc4, 0x27, 0x5c, 0xd7, 0xd2, 0xb7, 0x6c, 0x54, 0x92, + 0x4b, 0x23, 0x8a, 0x4b, 0x23, 0x97, 0x04, 0xd1, 0x5f, 0xfa, 0xc9, 0x87, 0xb8, 0x2f, 0xd7, 0xd5, + 0xdf, 0x00, 0x5e, 0x9b, 0xd4, 0x7f, 0x8d, 0x23, 0x4f, 0xd4, 0x61, 0xf3, 0xfd, 0x9c, 0x84, 0xef, + 0x6c, 0xcf, 0x9b, 0x63, 0x4a, 0xbb, 0xa0, 0x0f, 0x06, 0x75, 0xe3, 0xce, 0x61, 0xab, 0xb4, 0x97, + 0x76, 0x38, 0xd3, 0xd5, 0x53, 0x55, 0xb5, 0x1a, 0xe9, 0xf1, 0x79, 0x76, 0x12, 0x9f, 0x40, 0xc8, + 0x48, 0x49, 0x5e, 0x71, 0xf2, 0xd6, 0x61, 0xab, 0xb4, 0x32, 0xf2, 0xa8, 0xa9, 0x56, 0x9d, 0x91, + 0x82, 0x72, 0x61, 0xcd, 0x0e, 0x49, 0x12, 0xb1, 0x6e, 0xa5, 0x5f, 0x19, 0x34, 0xc6, 0x77, 0x51, + 0xd9, 0x9c, 0xe2, 0xa2, 0x39, 0x9a, 0x90, 0x20, 0x32, 0x1e, 0xad, 0xb7, 0x8a, 0xf0, 0xf5, 0x87, + 0x32, 0xf0, 0x03, 0xf6, 0x21, 0x71, 0x90, 0x4b, 0x42, 0x2d, 0xef, 0x96, 0x3d, 0x1e, 0x52, 0x6f, + 0xaa, 0xb1, 0x65, 0x8c, 0x29, 0x07, 0xa8, 0x95, 0x5b, 0xeb, 0x37, 0x3e, 0xad, 0x14, 0xe1, 0xd7, + 0x4a, 0x11, 0xd4, 0x16, 0xbc, 0x99, 0x77, 0xb5, 0x30, 0x8d, 0x49, 0x44, 0xb1, 0xfa, 0x19, 0xc0, + 0xa6, 0x49, 0x7d, 0x33, 0x99, 0xb1, 0x80, 0xff, 0x84, 0xa7, 0xb0, 0x16, 0x44, 0x71, 0xc2, 0xd2, + 0xfa, 0x69, 0x24, 0x09, 0x9d, 0x59, 0x06, 0x7a, 0x91, 0x8e, 0x18, 0xd5, 0x34, 0x93, 0x95, 0xcf, + 0x8b, 0xcf, 0xe0, 0x35, 0x49, 0x18, 0x47, 0xaf, 0x38, 0x7a, 0xef, 0x2c, 0xfa, 0x8a, 0xcf, 0xe4, + 0x6c, 0x41, 0xe8, 0x55, 0x1e, 0xf0, 0x36, 0xec, 0x9c, 0x86, 0x29, 0x52, 0x8e, 0xbf, 0x01, 0x58, + 0x31, 0xa9, 0x2f, 0xbe, 0x84, 0x55, 0x1e, 0xb2, 0x77, 0xd6, 0x39, 0xef, 0x26, 0x3d, 0xb8, 0xa4, + 0x16, 0x9e, 0xe2, 0x1b, 0x58, 0x3f, 0xb6, 0xbe, 0xff, 0x2f, 0xa4, 0x1c, 0x91, 0x86, 0xff, 0x1d, + 0x29, 0xac, 0x8d, 0xc9, 0x7a, 0x27, 0x83, 0xcd, 0x4e, 0x06, 0x3f, 0x77, 0x32, 0xf8, 0xb2, 0x97, + 0x85, 0xcd, 0x5e, 0x16, 0xbe, 0xef, 0x65, 0xe1, 0xed, 0xf0, 0xe2, 0xf6, 0x16, 0xd9, 0x35, 0xe5, + 0x4b, 0x74, 0x6a, 0xfc, 0x82, 0x3e, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x78, 0xdc, 0x7c, 0x0b, + 0x2b, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) + MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) { + out := new(MsgSendResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) { + out := new(MsgMultiSendResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/MultiSend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + Send(context.Context, *MsgSend) (*MsgSendResponse, error) + MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Send(ctx context.Context, req *MsgSend) (*MsgSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} +func (*UnimplementedMsgServer) MultiSend(ctx context.Context, req *MsgMultiSend) (*MsgMultiSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MultiSend not implemented") +} + +func RegisterMsgServer(s grpc1.Server, 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(MsgSend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Send(ctx, req.(*MsgSend)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMultiSend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MultiSend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/MultiSend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MultiSend(ctx, req.(*MsgMultiSend)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.bank.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _Msg_Send_Handler, + }, + { + MethodName: "MultiSend", + Handler: _Msg_MultiSend_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/bank/v1beta1/tx.proto", } func (m *MsgSend) Marshal() (dAtA []byte, err error) { @@ -204,6 +403,29 @@ func (m *MsgSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSendResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgMultiSend) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -255,6 +477,29 @@ func (m *MsgMultiSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgMultiSendResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgMultiSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMultiSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -289,6 +534,15 @@ func (m *MsgSend) Size() (n int) { return n } +func (m *MsgSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgMultiSend) Size() (n int) { if m == nil { return 0 @@ -310,6 +564,15 @@ func (m *MsgMultiSend) Size() (n int) { return n } +func (m *MsgMultiSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -467,6 +730,59 @@ func (m *MsgSend) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSendResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgMultiSend) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -588,6 +904,59 @@ func (m *MsgMultiSend) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgMultiSendResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgMultiSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMultiSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From ff05343b87f0625f3b2bc2e7b1f0db6e3c74949b Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 12:53:39 +0200 Subject: [PATCH 13/51] Add router --- baseapp/baseapp.go | 40 ++++++------ baseapp/msg_server.go | 4 ++ baseapp/msg_service_router.go | 13 ++-- baseapp/msg_service_router_helpers.go | 65 ------------------- .../{msg_service.go => msg_server.go} | 0 5 files changed, 30 insertions(+), 92 deletions(-) create mode 100644 baseapp/msg_server.go delete mode 100644 baseapp/msg_service_router_helpers.go rename testutil/testdata/{msg_service.go => msg_server.go} (100%) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 23a9d1dd8d56..1b84e8f7044f 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -45,15 +45,16 @@ type ( // BaseApp reflects the ABCI application implementation. type BaseApp struct { // nolint: maligned // initialized on creation - logger log.Logger - name string // application name from abci.Info - db dbm.DB // common DB backend - cms sdk.CommitMultiStore // Main (uncached) state - storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader() - router sdk.Router // handle any kind of message - queryRouter sdk.QueryRouter // router for redirecting query calls - grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls - txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx + logger log.Logger + name string // application name from abci.Info + db dbm.DB // common DB backend + cms sdk.CommitMultiStore // Main (uncached) state + storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader() + router sdk.Router // handle any kind of message + queryRouter sdk.QueryRouter // router for redirecting query calls + grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls + msgServiceRouter *MsgServiceRouter // router for redirecting Msg service messages + txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx anteHandler sdk.AnteHandler // ante handler for fee and auth initChainer sdk.InitChainer // initialize state with validators and state blob @@ -136,16 +137,17 @@ func NewBaseApp( name string, logger log.Logger, db dbm.DB, txDecoder sdk.TxDecoder, options ...func(*BaseApp), ) *BaseApp { app := &BaseApp{ - logger: logger, - name: name, - db: db, - cms: store.NewCommitMultiStore(db), - storeLoader: DefaultStoreLoader, - router: NewRouter(), - queryRouter: NewQueryRouter(), - grpcQueryRouter: NewGRPCQueryRouter(), - txDecoder: txDecoder, - fauxMerkleMode: false, + logger: logger, + name: name, + db: db, + cms: store.NewCommitMultiStore(db), + storeLoader: DefaultStoreLoader, + router: NewRouter(), + queryRouter: NewQueryRouter(), + grpcQueryRouter: NewGRPCQueryRouter(), + msgServiceRouter: NewMsgServiceRouter(), + txDecoder: txDecoder, + fauxMerkleMode: false, } for _, option := range options { diff --git a/baseapp/msg_server.go b/baseapp/msg_server.go new file mode 100644 index 000000000000..0baa0aa7a61c --- /dev/null +++ b/baseapp/msg_server.go @@ -0,0 +1,4 @@ +package baseapp + +// MsgServiceRouter returns the MsgServiceRouter of a BaseApp. +func (app *BaseApp) MsgServiceRouter() *MsgServiceRouter { return app.msgServiceRouter } diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 79e8cbe1e720..51edac861e09 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -26,9 +26,10 @@ func NewMsgServiceRouter() *MsgServiceRouter { } } -// MsgServiceHandler defines a function type which handles ABCI Query requests -// using gRPC -type MsgServiceHandler = func(ctx sdk.Context, data []byte) (*sdk.Result, error) +// MsgServiceHandler defines a function type which handles Msg service message. +// It's similar to sdk.Handler, but with simplified version of `Msg`, without +// `Route()`, `Type()` and `GetSignBytes()`. +type MsgServiceHandler = func(ctx sdk.Context, msgRequest sdk.MsgRequest) (*sdk.Result, error) // Route returns the MsgServiceHandler for a given query route path or nil // if not found. @@ -49,14 +50,10 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) methodHandler := method.Handler - msr.routes[fqMethod] = func(ctx sdk.Context, data []byte) (*sdk.Result, error) { + msr.routes[fqMethod] = func(ctx sdk.Context, msgRequest sdk.MsgRequest) (*sdk.Result, error) { // call the method handler from the service description with the handler object, // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { - err := protoCodec.Unmarshal(data, i) - if err != nil { - return err - } if msr.interfaceRegistry != nil { return codectypes.UnpackInterfaces(i, msr.interfaceRegistry) } diff --git a/baseapp/msg_service_router_helpers.go b/baseapp/msg_service_router_helpers.go deleted file mode 100644 index 8b9b24dcac32..000000000000 --- a/baseapp/msg_service_router_helpers.go +++ /dev/null @@ -1,65 +0,0 @@ -package baseapp - -import ( - gocontext "context" - "fmt" - - gogogrpc "github.com/gogo/protobuf/grpc" - "google.golang.org/grpc" - - "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// MsgServiceTestHelper provides a helper for making grpc msg service -// rpc calls in unit tests. It implements both the grpc Server and ClientConn -// interfaces needed to register a msg service server and create a msg -// service client. -type MsgServiceTestHelper struct { - *MsgServiceRouter - ctx sdk.Context -} - -var _ gogogrpc.Server = &MsgServiceTestHelper{} -var _ gogogrpc.ClientConn = &MsgServiceTestHelper{} - -// NewMsgServerTestHelper creates a new MsgServiceTestHelper that wraps -// the provided sdk.Context -func NewMsgServerTestHelper(ctx sdk.Context, interfaceRegistry types.InterfaceRegistry) *MsgServiceTestHelper { - qrt := NewMsgServiceRouter() - qrt.SetInterfaceRegistry(interfaceRegistry) - return &MsgServiceTestHelper{MsgServiceRouter: qrt, ctx: ctx} -} - -// Invoke implements the grpc ClientConn.Invoke method -func (q *MsgServiceTestHelper) Invoke(_ gocontext.Context, method string, args, reply interface{}, _ ...grpc.CallOption) error { - querier := q.Route(method) - if querier == nil { - return fmt.Errorf("handler not found for %s", method) - } - reqBz, err := protoCodec.Marshal(args) - if err != nil { - return err - } - - res, err := querier(q.ctx, reqBz) - if err != nil { - return err - } - - err = protoCodec.Unmarshal(res.Data, reply) - if err != nil { - return err - } - - if q.interfaceRegistry != nil { - return types.UnpackInterfaces(reply, q.interfaceRegistry) - } - - return nil -} - -// NewStream implements the grpc ClientConn.NewStream method -func (q *MsgServiceTestHelper) NewStream(gocontext.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) { - return nil, fmt.Errorf("not supported") -} diff --git a/testutil/testdata/msg_service.go b/testutil/testdata/msg_server.go similarity index 100% rename from testutil/testdata/msg_service.go rename to testutil/testdata/msg_server.go From 13b8dbd8fdaff13e1254c52b05643e7aaa6b4849 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 12:56:10 +0200 Subject: [PATCH 14/51] Remove test helper --- x/bank/keeper/keeper_test.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 435bc6858fb1..aea72006a45f 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -64,7 +64,6 @@ type IntegrationTestSuite struct { app *simapp.SimApp ctx sdk.Context queryClient types.QueryClient - msgClient types.MsgClient } func (suite *IntegrationTestSuite) SetupTest() { @@ -78,14 +77,9 @@ func (suite *IntegrationTestSuite) SetupTest() { types.RegisterQueryServer(queryHelper, app.BankKeeper) queryClient := types.NewQueryClient(queryHelper) - msgHelper := baseapp.NewMsgServerTestHelper(ctx, app.InterfaceRegistry()) - types.RegisterMsgServer(msgHelper, keeper.NewMsgServerImpl(app.BankKeeper)) - msgClient := types.NewMsgClient(msgHelper) - suite.app = app suite.ctx = ctx suite.queryClient = queryClient - suite.msgClient = msgClient } func (suite *IntegrationTestSuite) TestSupply() { From ab00ebf4cc2da858625ef38f81bea8ee29f44e6c Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 13:14:59 +0200 Subject: [PATCH 15/51] Add beginning of test --- baseapp/msg_service_router_test.go | 48 +++++++++++++++++++----------- testutil/testdata/tx.go | 14 +++++++++ 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go index 81514dd7344d..a57cfdcc6668 100644 --- a/baseapp/msg_service_router_test.go +++ b/baseapp/msg_service_router_test.go @@ -1,32 +1,46 @@ package baseapp import ( - "context" + "fmt" "testing" + "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" + txtypes "github.com/cosmos/cosmos-sdk/types/tx" ) func TestMsgService(t *testing.T) { - qr := NewMsgServiceRouter() - interfaceRegistry := testdata.NewTestInterfaceRegistry() - qr.SetInterfaceRegistry(interfaceRegistry) - testdata.RegisterMsgServer(qr, testdata.MsgImpl{}) - helper := &MsgServiceTestHelper{ - MsgServiceRouter: qr, - ctx: sdk.Context{}.WithContext(context.Background()), + msgServiceOpt := func(bapp *BaseApp) { + testdata.RegisterMsgServer( + bapp.MsgServiceRouter(), + testdata.MsgImpl{}, + ) } - client := testdata.NewMsgClient(helper) - res, err := client.CreateDog(context.Background(), &testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "spot"}}) - require.Nil(t, err) - require.NotNil(t, res) - require.Equal(t, "spot", res.Name) + app := setupBaseApp(t, msgServiceOpt) - require.Panics(t, func() { - _, _ = client.CreateDog(context.Background(), nil) - }) + app.InitChain(abci.RequestInitChain{}) + header := tmproto.Header{Height: app.LastBlockHeight() + 1} + app.BeginBlock(abci.RequestBeginBlock{Header: header}) + app.Commit() + + msg, err := testdata.NewServiceMsgCreateDog(&testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}}) + require.NoError(t, err) + tx := &txtypes.Tx{ + Body: &txtypes.TxBody{ + Messages: []*codectypes.Any{msg}, + }, + } + txBytes, err := proto.Marshal(tx) + require.NoError(t, err) + + res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) + fmt.Println(res.Data) + require.Empty(t, res.Events) + require.False(t, true) } diff --git a/testutil/testdata/tx.go b/testutil/testdata/tx.go index 72f8d0f00ac0..89212e409cc9 100644 --- a/testutil/testdata/tx.go +++ b/testutil/testdata/tx.go @@ -3,8 +3,10 @@ package testdata import ( "encoding/json" + "github.com/gogo/protobuf/proto" "github.com/tendermint/tendermint/crypto" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -65,3 +67,15 @@ func (msg *TestMsg) GetSigners() []sdk.AccAddress { return addrs } func (msg *TestMsg) ValidateBasic() error { return nil } + +func NewServiceMsgCreateDog(msg *MsgCreateDog) (*codectypes.Any, error) { + txBytes, err := proto.Marshal(msg) + if err != nil { + return nil, err + } + + return &codectypes.Any{ + TypeUrl: "/testdata.Msg/CreateDog", + Value: txBytes, + }, nil +} From 797ddd3ba332f611685820988ad49ba07bf9fe94 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 13:22:48 +0200 Subject: [PATCH 16/51] Move test to simapp? --- baseapp/msg_service_router_test.go | 46 ------------------------------ simapp/msg_service_test.go | 38 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 46 deletions(-) delete mode 100644 baseapp/msg_service_router_test.go create mode 100644 simapp/msg_service_test.go diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go deleted file mode 100644 index a57cfdcc6668..000000000000 --- a/baseapp/msg_service_router_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package baseapp - -import ( - "fmt" - "testing" - - "github.com/gogo/protobuf/proto" - "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - txtypes "github.com/cosmos/cosmos-sdk/types/tx" -) - -func TestMsgService(t *testing.T) { - msgServiceOpt := func(bapp *BaseApp) { - testdata.RegisterMsgServer( - bapp.MsgServiceRouter(), - testdata.MsgImpl{}, - ) - } - - app := setupBaseApp(t, msgServiceOpt) - - app.InitChain(abci.RequestInitChain{}) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} - app.BeginBlock(abci.RequestBeginBlock{Header: header}) - app.Commit() - - msg, err := testdata.NewServiceMsgCreateDog(&testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}}) - require.NoError(t, err) - tx := &txtypes.Tx{ - Body: &txtypes.TxBody{ - Messages: []*codectypes.Any{msg}, - }, - } - txBytes, err := proto.Marshal(tx) - require.NoError(t, err) - - res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) - fmt.Println(res.Data) - require.Empty(t, res.Events) - require.False(t, true) -} diff --git a/simapp/msg_service_test.go b/simapp/msg_service_test.go new file mode 100644 index 000000000000..10262cab3f8b --- /dev/null +++ b/simapp/msg_service_test.go @@ -0,0 +1,38 @@ +package simapp_test + +import ( + "os" + "testing" + + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/testutil/testdata" +) + +func TestMsgService(t *testing.T) { + db := dbm.NewMemDB() + encCfg := simapp.MakeEncodingConfig() + msgServiceOpt := func(bapp *baseapp.BaseApp) { + testdata.RegisterMsgServer( + bapp.MsgServiceRouter(), + testdata.MsgImpl{}, + ) + } + app := simapp.NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 0, encCfg, msgServiceOpt) + + msg, err := testdata.NewServiceMsgCreateDog(&testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}}) + require.NoError(t, err) + + txf := tx.Factory{}. + WithTxConfig(encCfg.TxConfig). + WithAccountNumber(50). + WithSequence(23). + WithFees("50stake"). + WithMemo("memo"). + WithChainID("test-chain") +} From a65ab55a97d3049b0b10dfd0e053b5cbc810065e Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 13:34:18 +0200 Subject: [PATCH 17/51] ServiceMsg implement sdk.Msg --- baseapp/msg_service_router.go | 2 +- types/msg_service.go | 32 ++++++++++++++++++++++++++++++++ types/tx_msg.go | 13 +------------ 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 51edac861e09..f5880539078a 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -50,7 +50,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) methodHandler := method.Handler - msr.routes[fqMethod] = func(ctx sdk.Context, msgRequest sdk.MsgRequest) (*sdk.Result, error) { + msr.routes[fqMethod] = func(ctx sdk.Context, _ sdk.MsgRequest) (*sdk.Result, error) { // call the method handler from the service description with the handler object, // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { diff --git a/types/msg_service.go b/types/msg_service.go index 26a20d9ddf5e..c37f780d82cf 100644 --- a/types/msg_service.go +++ b/types/msg_service.go @@ -8,7 +8,12 @@ import ( // service method, must fulfill. type MsgRequest interface { proto.Message + // ValidateBasic does a simple validation check that + // doesn't require access to any other information. ValidateBasic() error + // Signers returns the addrs of signers that must sign. + // CONTRACT: All signatures must be present to be valid. + // CONTRACT: Returns addrs in some deterministic order. GetSigners() []AccAddress } @@ -20,3 +25,30 @@ type ServiceMsg struct { // Request is the request payload. Request MsgRequest } + +var _ Msg = ServiceMsg{} + +// Route implements Msg.Route method. +func (msg ServiceMsg) Route() string { + return msg.MethodName +} + +// ValidateBasic implements Msg.ValidateBasic method. +func (msg ServiceMsg) ValidateBasic() error { + return msg.Request.ValidateBasic() +} + +// GetSignBytes implements Msg.GetSignBytes method. +func (msg ServiceMsg) GetSignBytes() []byte { + panic("ServiceMsg does not have a GetSignBytes method") +} + +// GetSigners implements Msg.GetSigners method. +func (msg ServiceMsg) GetSigners() []AccAddress { + return msg.Request.GetSigners() +} + +// Type implements Msg.Type method. +func (msg ServiceMsg) Type() string { + return "timeout_packet" +} diff --git a/types/tx_msg.go b/types/tx_msg.go index e75b7b6ae62a..d1ddbf7da5a9 100644 --- a/types/tx_msg.go +++ b/types/tx_msg.go @@ -1,15 +1,13 @@ package types import ( - "github.com/gogo/protobuf/proto" - "github.com/tendermint/tendermint/crypto" ) type ( // Msg defines the interface a transaction message must fulfill. Msg interface { - proto.Message + MsgRequest // Return the message type. // Must be alphanumeric or empty. @@ -19,17 +17,8 @@ type ( // within tags Type() string - // ValidateBasic does a simple validation check that - // doesn't require access to any other information. - ValidateBasic() error - // Get the canonical byte representation of the Msg. GetSignBytes() []byte - - // Signers returns the addrs of signers that must sign. - // CONTRACT: All signatures must be present to be valid. - // CONTRACT: Returns addrs in some deterministic order. - GetSigners() []AccAddress } // Fee defines an interface for an application application-defined concrete From 759b2a59cf4882b8eb5c490db521f07c4d4cb6a5 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 13:39:01 +0200 Subject: [PATCH 18/51] Add handler by MsgServiceRouter --- baseapp/baseapp.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 1b84e8f7044f..4a69f71b83e6 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -685,7 +685,12 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s } msgRoute := msg.Route() - handler := app.router.Route(ctx, msgRoute) + // First, check if the MsgService router handles the route. + handler := app.MsgServiceRouter().Route(msgRoute) + // If not, then check if the legacy router handles the route. + if handler == nil { + handler = app.router.Route(ctx, msgRoute) + } if handler == nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message route: %s; message index: %d", msgRoute, i) From 931ca66a613d7b3eb2b7f41f077dba61f3ea9bc3 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 13:39:10 +0200 Subject: [PATCH 19/51] Correct signature --- baseapp/msg_service_router.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index f5880539078a..88da5ccb1eb8 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -14,7 +14,7 @@ import ( // handler. type MsgServiceRouter struct { interfaceRegistry codectypes.InterfaceRegistry - routes map[string]MsgServiceHandler + routes map[string]sdk.Handler } var _ gogogrpc.Server = &MsgServiceRouter{} @@ -22,18 +22,18 @@ var _ gogogrpc.Server = &MsgServiceRouter{} // NewMsgServiceRouter creates a new MsgServiceRouter. func NewMsgServiceRouter() *MsgServiceRouter { return &MsgServiceRouter{ - routes: map[string]MsgServiceHandler{}, + routes: map[string]sdk.Handler{}, } } -// MsgServiceHandler defines a function type which handles Msg service message. +// sdk.Handler defines a function type which handles Msg service message. // It's similar to sdk.Handler, but with simplified version of `Msg`, without // `Route()`, `Type()` and `GetSignBytes()`. type MsgServiceHandler = func(ctx sdk.Context, msgRequest sdk.MsgRequest) (*sdk.Result, error) -// Route returns the MsgServiceHandler for a given query route path or nil +// Route returns the sdk.Handler for a given query route path or nil // if not found. -func (msr *MsgServiceRouter) Route(path string) MsgServiceHandler { +func (msr *MsgServiceRouter) Route(path string) sdk.Handler { handler, found := msr.routes[path] if !found { return nil @@ -50,7 +50,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) methodHandler := method.Handler - msr.routes[fqMethod] = func(ctx sdk.Context, _ sdk.MsgRequest) (*sdk.Result, error) { + msr.routes[fqMethod] = func(ctx sdk.Context, _ sdk.Msg) (*sdk.Result, error) { // call the method handler from the service description with the handler object, // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { From f21b3325fb6cc66406145e1892459760b509bb68 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 15:44:02 +0200 Subject: [PATCH 20/51] Add full test --- simapp/msg_service_test.go | 50 ++++++++++++++++++++++++++++++++------ testutil/testdata/tx.go | 20 +++++++-------- types/msg_service.go | 4 +++ x/auth/tx/builder.go | 23 +++++++++++++++--- 4 files changed, 75 insertions(+), 22 deletions(-) diff --git a/simapp/msg_service_test.go b/simapp/msg_service_test.go index 10262cab3f8b..0490bdb023a2 100644 --- a/simapp/msg_service_test.go +++ b/simapp/msg_service_test.go @@ -1,10 +1,12 @@ package simapp_test import ( + "fmt" "os" "testing" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" @@ -12,6 +14,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/testdata" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" ) func TestMsgService(t *testing.T) { @@ -23,16 +27,46 @@ func TestMsgService(t *testing.T) { testdata.MsgImpl{}, ) } + priv, _, _ := testdata.KeyTestPubAddr() app := simapp.NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 0, encCfg, msgServiceOpt) - msg, err := testdata.NewServiceMsgCreateDog(&testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}}) + msg := testdata.NewServiceMsgCreateDog(&testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}}) + + txBuilder := encCfg.TxConfig.NewTxBuilder() + txBuilder.SetFeeAmount(testdata.NewTestFeeAmount()) + txBuilder.SetGasLimit(testdata.NewTestGasLimit()) + txBuilder.SetMsgs(msg) + + // First round: we gather all the signer infos. We use the "set empty + // signature" hack to do that. + sigV2 := signing.SignatureV2{ + PubKey: priv.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: encCfg.TxConfig.SignModeHandler().DefaultMode(), + Signature: nil, + }, + Sequence: 0, + } + + err := txBuilder.SetSignatures(sigV2) require.NoError(t, err) - txf := tx.Factory{}. - WithTxConfig(encCfg.TxConfig). - WithAccountNumber(50). - WithSequence(23). - WithFees("50stake"). - WithMemo("memo"). - WithChainID("test-chain") + // Second round: all signer infos are set, so each signer can sign. + signerData := authsigning.SignerData{ + ChainID: "test", + AccountNumber: 0, + Sequence: 0, + } + sigV2, err = tx.SignWithPrivKey( + encCfg.TxConfig.SignModeHandler().DefaultMode(), signerData, + txBuilder, priv, encCfg.TxConfig, 0) + require.NoError(t, err) + err = txBuilder.SetSignatures(sigV2) + require.NoError(t, err) + + // Send the tx to the app + txBytes, err := encCfg.TxConfig.TxJSONEncoder()(txBuilder.GetTx()) + require.NoError(t, err) + res := app.BaseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) + fmt.Println("res=", res) } diff --git a/testutil/testdata/tx.go b/testutil/testdata/tx.go index 89212e409cc9..09e1e365f1ca 100644 --- a/testutil/testdata/tx.go +++ b/testutil/testdata/tx.go @@ -3,10 +3,8 @@ package testdata import ( "encoding/json" - "github.com/gogo/protobuf/proto" "github.com/tendermint/tendermint/crypto" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -68,14 +66,14 @@ func (msg *TestMsg) GetSigners() []sdk.AccAddress { } func (msg *TestMsg) ValidateBasic() error { return nil } -func NewServiceMsgCreateDog(msg *MsgCreateDog) (*codectypes.Any, error) { - txBytes, err := proto.Marshal(msg) - if err != nil { - return nil, err - } +var _ sdk.MsgRequest = &MsgCreateDog{} - return &codectypes.Any{ - TypeUrl: "/testdata.Msg/CreateDog", - Value: txBytes, - }, nil +func (msg *MsgCreateDog) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{} } +func (msg *MsgCreateDog) ValidateBasic() error { return nil } + +func NewServiceMsgCreateDog(msg *MsgCreateDog) sdk.Msg { + return sdk.ServiceMsg{ + MethodName: "/testdata.Msg/CreateDog", + Request: msg, + } } diff --git a/types/msg_service.go b/types/msg_service.go index c37f780d82cf..a4f5a9c04ae7 100644 --- a/types/msg_service.go +++ b/types/msg_service.go @@ -28,6 +28,10 @@ type ServiceMsg struct { var _ Msg = ServiceMsg{} +func (msg ServiceMsg) ProtoMessage() {} +func (msg ServiceMsg) Reset() {} +func (msg ServiceMsg) String() string { return "ServiceMsg" } + // Route implements Msg.Route method. func (msg ServiceMsg) Route() string { return msg.MethodName diff --git a/x/auth/tx/builder.go b/x/auth/tx/builder.go index 42645f375beb..b3697e70b262 100644 --- a/x/auth/tx/builder.go +++ b/x/auth/tx/builder.go @@ -205,10 +205,27 @@ func (w *wrapper) SetMsgs(msgs ...sdk.Msg) error { for i, msg := range msgs { var err error - anys[i], err = codectypes.NewAnyWithValue(msg) - if err != nil { - return err + switch msg := msg.(type) { + case sdk.ServiceMsg: + { + bz, err := proto.Marshal(msg.Request) + if err != nil { + return err + } + anys[i] = &codectypes.Any{ + TypeUrl: msg.MethodName, + Value: bz, + } + } + default: + { + anys[i], err = codectypes.NewAnyWithValue(msg) + if err != nil { + return err + } + } } + } w.tx.Body.Messages = anys From 24fa6f0e6986b5a115548674ae77d761af0316ef Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 15:45:20 +0200 Subject: [PATCH 21/51] use TxEncoder --- simapp/msg_service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simapp/msg_service_test.go b/simapp/msg_service_test.go index 0490bdb023a2..8ad4264bd035 100644 --- a/simapp/msg_service_test.go +++ b/simapp/msg_service_test.go @@ -65,7 +65,7 @@ func TestMsgService(t *testing.T) { require.NoError(t, err) // Send the tx to the app - txBytes, err := encCfg.TxConfig.TxJSONEncoder()(txBuilder.GetTx()) + txBytes, err := encCfg.TxConfig.TxEncoder()(txBuilder.GetTx()) require.NoError(t, err) res := app.BaseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) fmt.Println("res=", res) From 12cbcece0ce2f0e711f6c9a4ec9cc4a9e4b5fc5b Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 16:40:04 +0200 Subject: [PATCH 22/51] Update baseapp/msg_service_router.go Co-authored-by: Aaron Craelius --- baseapp/msg_service_router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 88da5ccb1eb8..f7f0313aa2d3 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -29,7 +29,7 @@ func NewMsgServiceRouter() *MsgServiceRouter { // sdk.Handler defines a function type which handles Msg service message. // It's similar to sdk.Handler, but with simplified version of `Msg`, without // `Route()`, `Type()` and `GetSignBytes()`. -type MsgServiceHandler = func(ctx sdk.Context, msgRequest sdk.MsgRequest) (*sdk.Result, error) +type MsgServiceHandler = func(ctx sdk.Context, reqBz []byte) (*sdk.Result, error) // Route returns the sdk.Handler for a given query route path or nil // if not found. From b599b6551e99e51187781eff578ba5557c05412d Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 13 Oct 2020 16:54:25 +0200 Subject: [PATCH 23/51] Push changes --- baseapp/baseapp.go | 7 +- baseapp/msg_service_router.go | 32 ++- proto/cosmos/tx/v1beta1/tx.proto | 13 ++ types/{ => tx}/msg_service.go | 30 ++- types/tx/tx.pb.go | 343 ++++++++++++++++++++++++++----- types/tx_msg.go | 13 +- x/auth/tx/builder.go | 8 +- x/bank/types/tx.pb.go | 6 + 8 files changed, 362 insertions(+), 90 deletions(-) rename types/{ => tx}/msg_service.go (65%) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 4a69f71b83e6..1b84e8f7044f 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -685,12 +685,7 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s } msgRoute := msg.Route() - // First, check if the MsgService router handles the route. - handler := app.MsgServiceRouter().Route(msgRoute) - // If not, then check if the legacy router handles the route. - if handler == nil { - handler = app.router.Route(ctx, msgRoute) - } + handler := app.router.Route(ctx, msgRoute) if handler == nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message route: %s; message index: %d", msgRoute, i) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index f7f0313aa2d3..1e8a4a3d8ac2 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -8,13 +8,15 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/tx" ) // MsgServiceRouter routes Msg Service fully-qualified service methods to their // handler. type MsgServiceRouter struct { interfaceRegistry codectypes.InterfaceRegistry - routes map[string]sdk.Handler + routes map[string]MsgServiceHandler } var _ gogogrpc.Server = &MsgServiceRouter{} @@ -22,18 +24,16 @@ var _ gogogrpc.Server = &MsgServiceRouter{} // NewMsgServiceRouter creates a new MsgServiceRouter. func NewMsgServiceRouter() *MsgServiceRouter { return &MsgServiceRouter{ - routes: map[string]sdk.Handler{}, + routes: map[string]MsgServiceHandler{}, } } -// sdk.Handler defines a function type which handles Msg service message. -// It's similar to sdk.Handler, but with simplified version of `Msg`, without -// `Route()`, `Type()` and `GetSignBytes()`. +// MsgServiceHandler defines a function type which handles Msg service message. type MsgServiceHandler = func(ctx sdk.Context, reqBz []byte) (*sdk.Result, error) -// Route returns the sdk.Handler for a given query route path or nil +// Route returns the MsgServiceHandler for a given query route path or nil // if not found. -func (msr *MsgServiceRouter) Route(path string) sdk.Handler { +func (msr *MsgServiceRouter) Route(path string) MsgServiceHandler { handler, found := msr.routes[path] if !found { return nil @@ -50,13 +50,29 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) methodHandler := method.Handler - msr.routes[fqMethod] = func(ctx sdk.Context, _ sdk.Msg) (*sdk.Result, error) { + msr.routes[fqMethod] = func(ctx sdk.Context, reqBz []byte) (*sdk.Result, error) { // call the method handler from the service description with the handler object, // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { + err := protoCodec.Unmarshal(reqBz, i) + if err != nil { + return err + } + + req, ok := i.(tx.MsgRequest) + if !ok { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "req is not a MsgRequest") + } + if msr.interfaceRegistry != nil { return codectypes.UnpackInterfaces(i, msr.interfaceRegistry) } + + err = req.ValidateBasic() + if err != nil { + return err + } + return nil }, nil) if err != nil { diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto index 05eea1f65482..10464b3b8aaa 100644 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -180,3 +180,16 @@ message Fee { // not support fee grants, this will fail string granter = 4; } + +// ServiceMsg is the struct which represents a service message, it can be +// thought as an Any whose typeUrl matches a service method format +// (ex. `/cosmos.gov.Msg/SubmitProposal`), and whose value is the marshalled +// bytes of the request. +message ServiceMsg { + // method_name is the fully-qualified service method name of the service + // message. Note that is contains two '/' characters. + string method_name = 1; + // request is the encoded raw bytes of the request which corresponds to the + // service method. + bytes request = 2; +} diff --git a/types/msg_service.go b/types/tx/msg_service.go similarity index 65% rename from types/msg_service.go rename to types/tx/msg_service.go index a4f5a9c04ae7..9ed625156c63 100644 --- a/types/msg_service.go +++ b/types/tx/msg_service.go @@ -1,7 +1,9 @@ -package types +package tx import ( "github.com/gogo/protobuf/proto" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // MsgRequest is the interface a transaction message, defined as a proto @@ -14,23 +16,19 @@ type MsgRequest interface { // Signers returns the addrs of signers that must sign. // CONTRACT: All signatures must be present to be valid. // CONTRACT: Returns addrs in some deterministic order. - GetSigners() []AccAddress -} - -// ServiceMsg is the struct into which an Any whose typeUrl matches a service -// method format (ex. `/cosmos.gov.Msg/SubmitProposal`) unpacks. -type ServiceMsg struct { - // MethodName is the fully-qualified service method name. - MethodName string - // Request is the request payload. - Request MsgRequest + GetSigners() []sdk.AccAddress } -var _ Msg = ServiceMsg{} +// // ServiceMsg is the struct into which an Any whose typeUrl matches a service +// // method format (ex. `/cosmos.gov.Msg/SubmitProposal`) unpacks. +// type ServiceMsg struct { +// // MethodName is the fully-qualified service method name. +// MethodName string +// // Request is the request payload. +// Request MsgRequest +// } -func (msg ServiceMsg) ProtoMessage() {} -func (msg ServiceMsg) Reset() {} -func (msg ServiceMsg) String() string { return "ServiceMsg" } +var _ sdk.Msg = ServiceMsg{} // Route implements Msg.Route method. func (msg ServiceMsg) Route() string { @@ -48,7 +46,7 @@ func (msg ServiceMsg) GetSignBytes() []byte { } // GetSigners implements Msg.GetSigners method. -func (msg ServiceMsg) GetSigners() []AccAddress { +func (msg ServiceMsg) GetSigners() []sdk.AccAddress { return msg.Request.GetSigners() } diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index 996ed527cb8c..8715cff0b2cb 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -743,6 +743,66 @@ func (m *Fee) GetGranter() string { return "" } +// ServiceMsg is the struct which represents a service message, it can be +// thought as an Any whose typeUrl matches a service method format +// (ex. `/cosmos.gov.Msg/SubmitProposal`), and whose value is the marshalled +// bytes of the request. +type ServiceMsg struct { + // method_name is the fully-qualified service method name of the service + // message. Note that is contains two '/' characters. + MethodName string `protobuf:"bytes,1,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` + // request is the encoded raw bytes of the request which corresponds to the + // service method. + Request []byte `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"` +} + +func (m *ServiceMsg) Reset() { *m = ServiceMsg{} } +func (m *ServiceMsg) String() string { return proto.CompactTextString(m) } +func (*ServiceMsg) ProtoMessage() {} +func (*ServiceMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_96d1575ffde80842, []int{8} +} +func (m *ServiceMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServiceMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ServiceMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceMsg.Merge(m, src) +} +func (m *ServiceMsg) XXX_Size() int { + return m.Size() +} +func (m *ServiceMsg) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceMsg proto.InternalMessageInfo + +func (m *ServiceMsg) GetMethodName() string { + if m != nil { + return m.MethodName + } + return "" +} + +func (m *ServiceMsg) GetRequest() []byte { + if m != nil { + return m.Request + } + return nil +} + func init() { proto.RegisterType((*Tx)(nil), "cosmos.tx.v1beta1.Tx") proto.RegisterType((*TxRaw)(nil), "cosmos.tx.v1beta1.TxRaw") @@ -754,65 +814,69 @@ func init() { proto.RegisterType((*ModeInfo_Single)(nil), "cosmos.tx.v1beta1.ModeInfo.Single") proto.RegisterType((*ModeInfo_Multi)(nil), "cosmos.tx.v1beta1.ModeInfo.Multi") proto.RegisterType((*Fee)(nil), "cosmos.tx.v1beta1.Fee") + proto.RegisterType((*ServiceMsg)(nil), "cosmos.tx.v1beta1.ServiceMsg") } func init() { proto.RegisterFile("cosmos/tx/v1beta1/tx.proto", fileDescriptor_96d1575ffde80842) } var fileDescriptor_96d1575ffde80842 = []byte{ - // 843 bytes of a gzipped FileDescriptorProto + // 883 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xdd, 0x6e, 0xdc, 0x44, - 0x14, 0x5e, 0xef, 0x5f, 0xd6, 0x27, 0x49, 0x4b, 0x47, 0x11, 0xda, 0x6c, 0x54, 0x37, 0x18, 0x15, - 0xf6, 0x26, 0x76, 0x9b, 0x5e, 0xf0, 0x23, 0x24, 0xc8, 0x16, 0xaa, 0x54, 0xa5, 0x20, 0x4d, 0x72, - 0xd5, 0x1b, 0x6b, 0xec, 0x9d, 0x78, 0x47, 0x5d, 0xcf, 0x2c, 0x9e, 0x71, 0xb1, 0x1f, 0x02, 0xa9, - 0x42, 0x42, 0xbc, 0x03, 0x2f, 0xc0, 0x2b, 0xf4, 0xb2, 0x97, 0x5c, 0x41, 0x95, 0x3c, 0x08, 0x68, - 0xc6, 0x63, 0x27, 0x82, 0x55, 0x72, 0xc3, 0x95, 0xe7, 0x9c, 0xf9, 0xce, 0x37, 0x9f, 0xcf, 0x1f, - 0x4c, 0x12, 0x21, 0x33, 0x21, 0x43, 0x55, 0x86, 0xaf, 0x1e, 0xc6, 0x54, 0x91, 0x87, 0xa1, 0x2a, - 0x83, 0x55, 0x2e, 0x94, 0x40, 0x77, 0xea, 0xbb, 0x40, 0x95, 0x81, 0xbd, 0x9b, 0xec, 0xa4, 0x22, - 0x15, 0xe6, 0x36, 0xd4, 0xa7, 0x1a, 0x38, 0x39, 0xb0, 0x24, 0x49, 0x5e, 0xad, 0x94, 0x08, 0xb3, - 0x62, 0xa9, 0x98, 0x64, 0x69, 0xcb, 0xd8, 0x38, 0x2c, 0xdc, 0xb3, 0xf0, 0x98, 0x48, 0xda, 0x62, - 0x12, 0xc1, 0xb8, 0xbd, 0xff, 0xf8, 0x52, 0x93, 0x64, 0x29, 0x67, 0xfc, 0x92, 0xc9, 0xda, 0x16, - 0xb8, 0x9b, 0x0a, 0x91, 0x2e, 0x69, 0x68, 0xac, 0xb8, 0x38, 0x0b, 0x09, 0xaf, 0xea, 0x2b, 0xff, - 0x27, 0x07, 0xba, 0xa7, 0x25, 0x3a, 0x80, 0x7e, 0x2c, 0xe6, 0xd5, 0xd8, 0xd9, 0x77, 0xa6, 0x9b, - 0x87, 0xbb, 0xc1, 0x7f, 0xfe, 0x28, 0x38, 0x2d, 0x67, 0x62, 0x5e, 0x61, 0x03, 0x43, 0x9f, 0x82, - 0x4b, 0x0a, 0xb5, 0x88, 0x18, 0x3f, 0x13, 0xe3, 0xae, 0x89, 0xd9, 0x5b, 0x13, 0x73, 0x54, 0xa8, - 0xc5, 0x53, 0x7e, 0x26, 0xf0, 0x88, 0xd8, 0x13, 0xf2, 0x00, 0xb4, 0x36, 0xa2, 0x8a, 0x9c, 0xca, - 0x71, 0x6f, 0xbf, 0x37, 0xdd, 0xc2, 0x57, 0x3c, 0x3e, 0x87, 0xc1, 0x69, 0x89, 0xc9, 0x8f, 0xe8, - 0x2e, 0x80, 0x7e, 0x2a, 0x8a, 0x2b, 0x45, 0xa5, 0xd1, 0xb5, 0x85, 0x5d, 0xed, 0x99, 0x69, 0x07, - 0xfa, 0x08, 0x6e, 0xb7, 0x0a, 0x2c, 0xa6, 0x6b, 0x30, 0xdb, 0xcd, 0x53, 0x35, 0xee, 0xa6, 0xf7, - 0x7e, 0x76, 0x60, 0xe3, 0x84, 0xa5, 0xfc, 0x6b, 0x91, 0xfc, 0x5f, 0x4f, 0xee, 0xc2, 0x28, 0x59, - 0x10, 0xc6, 0x23, 0x36, 0x1f, 0xf7, 0xf6, 0x9d, 0xa9, 0x8b, 0x37, 0x8c, 0xfd, 0x74, 0x8e, 0xee, - 0xc3, 0x2d, 0x92, 0x24, 0xa2, 0xe0, 0x2a, 0xe2, 0x45, 0x16, 0xd3, 0x7c, 0xdc, 0xdf, 0x77, 0xa6, - 0x7d, 0xbc, 0x6d, 0xbd, 0xdf, 0x19, 0xa7, 0xff, 0x4b, 0x17, 0x86, 0x75, 0xbe, 0xd1, 0x03, 0x18, - 0x65, 0x54, 0x4a, 0x92, 0x1a, 0x45, 0xbd, 0xe9, 0xe6, 0xe1, 0x4e, 0x50, 0x57, 0x33, 0x68, 0xaa, - 0x19, 0x1c, 0xf1, 0x0a, 0xb7, 0x28, 0x84, 0xa0, 0x9f, 0xd1, 0xac, 0x2e, 0x8b, 0x8b, 0xcd, 0x59, - 0xbf, 0xab, 0x58, 0x46, 0x45, 0xa1, 0xa2, 0x05, 0x65, 0xe9, 0x42, 0x19, 0x61, 0x7d, 0xbc, 0x6d, - 0xbd, 0xc7, 0xc6, 0x89, 0x66, 0x70, 0x87, 0x96, 0x8a, 0x72, 0xc9, 0x04, 0x8f, 0xc4, 0x4a, 0x31, - 0xc1, 0xe5, 0xf8, 0xef, 0x8d, 0x6b, 0x9e, 0x7d, 0xaf, 0xc5, 0x7f, 0x5f, 0xc3, 0xd1, 0x0b, 0xf0, - 0xb8, 0xe0, 0x51, 0x92, 0x33, 0xc5, 0x12, 0xb2, 0x8c, 0xd6, 0x10, 0xde, 0xbe, 0x86, 0x70, 0x8f, - 0x0b, 0xfe, 0xd8, 0xc6, 0x7e, 0xf3, 0x2f, 0x6e, 0xff, 0x15, 0x8c, 0x9a, 0x96, 0x42, 0x5f, 0xc1, - 0x96, 0x2e, 0x23, 0xcd, 0x4d, 0x3d, 0x9a, 0xe4, 0xdc, 0x5d, 0xd3, 0x85, 0x27, 0x06, 0x66, 0xfa, - 0x70, 0x53, 0xb6, 0x67, 0x89, 0xa6, 0xd0, 0x3b, 0xa3, 0xd4, 0xb6, 0xef, 0xfb, 0x6b, 0x02, 0x9f, - 0x50, 0x8a, 0x35, 0xc4, 0xff, 0xd5, 0x01, 0xb8, 0x64, 0x41, 0x8f, 0x00, 0x56, 0x45, 0xbc, 0x64, - 0x49, 0xf4, 0x92, 0x36, 0x23, 0xb3, 0xfe, 0x6f, 0xdc, 0x1a, 0xf7, 0x8c, 0x9a, 0x91, 0xc9, 0xc4, - 0x9c, 0xde, 0x34, 0x32, 0xcf, 0xc5, 0x9c, 0xd6, 0x23, 0x93, 0xd9, 0x13, 0x9a, 0xc0, 0x48, 0xd2, - 0x1f, 0x0a, 0xca, 0x13, 0x6a, 0xcb, 0xd6, 0xda, 0xfe, 0xbb, 0x2e, 0x8c, 0x9a, 0x10, 0xf4, 0x05, - 0x0c, 0x25, 0xe3, 0xe9, 0x92, 0x5a, 0x4d, 0xfe, 0x35, 0xfc, 0xc1, 0x89, 0x41, 0x1e, 0x77, 0xb0, - 0x8d, 0x41, 0x9f, 0xc1, 0xc0, 0xec, 0x1f, 0x2b, 0xee, 0x83, 0xeb, 0x82, 0x9f, 0x6b, 0xe0, 0x71, - 0x07, 0xd7, 0x11, 0x93, 0x23, 0x18, 0xd6, 0x74, 0xe8, 0x13, 0xe8, 0x6b, 0xdd, 0x46, 0xc0, 0xad, - 0xc3, 0x0f, 0xaf, 0x70, 0x34, 0x1b, 0xe9, 0x6a, 0x55, 0x34, 0x1f, 0x36, 0x01, 0x93, 0xd7, 0x0e, - 0x0c, 0x0c, 0x2b, 0x7a, 0x06, 0xa3, 0x98, 0x29, 0x92, 0xe7, 0xa4, 0xc9, 0x6d, 0xd8, 0xd0, 0xd4, - 0x7b, 0x33, 0x68, 0xd7, 0x64, 0xc3, 0xf5, 0x58, 0x64, 0x2b, 0x92, 0xa8, 0x19, 0x53, 0x47, 0x3a, - 0x0c, 0xb7, 0x04, 0xe8, 0x73, 0x80, 0x36, 0xeb, 0x7a, 0x5c, 0x7b, 0x37, 0xa5, 0xdd, 0x6d, 0xd2, - 0x2e, 0x67, 0x03, 0xe8, 0xc9, 0x22, 0xf3, 0x7f, 0x77, 0xa0, 0xf7, 0x84, 0x52, 0x94, 0xc0, 0x90, - 0x64, 0x7a, 0x48, 0x6d, 0xab, 0xb5, 0x4b, 0x52, 0xaf, 0xe7, 0x2b, 0x52, 0x18, 0x9f, 0x3d, 0x78, - 0xf3, 0xe7, 0xbd, 0xce, 0x6f, 0x7f, 0xdd, 0x9b, 0xa6, 0x4c, 0x2d, 0x8a, 0x38, 0x48, 0x44, 0x16, - 0x36, 0xab, 0xdf, 0x7c, 0x0e, 0xe4, 0xfc, 0x65, 0xa8, 0xaa, 0x15, 0x95, 0x26, 0x40, 0x62, 0x4b, - 0x8d, 0xf6, 0xc0, 0x4d, 0x89, 0x8c, 0x96, 0x2c, 0x63, 0xca, 0x14, 0xa2, 0x8f, 0x47, 0x29, 0x91, - 0xdf, 0x6a, 0x1b, 0xed, 0xc0, 0x60, 0x45, 0x2a, 0x9a, 0xdb, 0xad, 0x52, 0x1b, 0x68, 0x0c, 0x1b, - 0x69, 0x4e, 0xb8, 0xb2, 0xcb, 0xc4, 0xc5, 0x8d, 0x39, 0xfb, 0xf2, 0xcd, 0xb9, 0xe7, 0xbc, 0x3d, - 0xf7, 0x9c, 0x77, 0xe7, 0x9e, 0xf3, 0xfa, 0xc2, 0xeb, 0xbc, 0xbd, 0xf0, 0x3a, 0x7f, 0x5c, 0x78, - 0x9d, 0x17, 0xf7, 0x6f, 0x16, 0x16, 0xaa, 0x32, 0x1e, 0x9a, 0x66, 0x7e, 0xf4, 0x4f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xd4, 0xb7, 0x75, 0x7d, 0xfd, 0x06, 0x00, 0x00, + 0x14, 0x5e, 0xef, 0x5f, 0x76, 0x4f, 0x92, 0x96, 0x8e, 0x22, 0xb4, 0xd9, 0xa8, 0x4e, 0x30, 0x2a, + 0xec, 0x4d, 0xec, 0x36, 0xbd, 0xe0, 0x47, 0x48, 0x90, 0x2d, 0x94, 0x54, 0x25, 0x45, 0x9a, 0xe4, + 0xaa, 0x37, 0xd6, 0xd8, 0x3b, 0xf1, 0x8e, 0xba, 0x33, 0xb3, 0x78, 0xc6, 0x61, 0xf7, 0x21, 0x90, + 0x2a, 0x24, 0xc4, 0x3b, 0xf0, 0x02, 0xbc, 0x42, 0x2f, 0x7b, 0xc9, 0x15, 0x54, 0xc9, 0x83, 0x80, + 0x66, 0x3c, 0x76, 0x22, 0x58, 0x25, 0x37, 0x5c, 0x79, 0xce, 0x99, 0xef, 0x7c, 0xf3, 0xf9, 0xfc, + 0xc1, 0x30, 0x95, 0x8a, 0x4b, 0x15, 0xe9, 0x45, 0x74, 0xfe, 0x28, 0xa1, 0x9a, 0x3c, 0x8a, 0xf4, + 0x22, 0x9c, 0xe7, 0x52, 0x4b, 0x74, 0xaf, 0xbc, 0x0b, 0xf5, 0x22, 0x74, 0x77, 0xc3, 0xad, 0x4c, + 0x66, 0xd2, 0xde, 0x46, 0xe6, 0x54, 0x02, 0x87, 0xfb, 0x8e, 0x24, 0xcd, 0x97, 0x73, 0x2d, 0x23, + 0x5e, 0xcc, 0x34, 0x53, 0x2c, 0xab, 0x19, 0x2b, 0x87, 0x83, 0xfb, 0x0e, 0x9e, 0x10, 0x45, 0x6b, + 0x4c, 0x2a, 0x99, 0x70, 0xf7, 0x1f, 0x5f, 0x69, 0x52, 0x2c, 0x13, 0x4c, 0x5c, 0x31, 0x39, 0xdb, + 0x01, 0xb7, 0x33, 0x29, 0xb3, 0x19, 0x8d, 0xac, 0x95, 0x14, 0x67, 0x11, 0x11, 0xcb, 0xf2, 0x2a, + 0xf8, 0xc9, 0x83, 0xe6, 0xe9, 0x02, 0xed, 0x43, 0x3b, 0x91, 0x93, 0xe5, 0xc0, 0xdb, 0xf3, 0x46, + 0xeb, 0x07, 0xdb, 0xe1, 0x7f, 0xfe, 0x28, 0x3c, 0x5d, 0x8c, 0xe5, 0x64, 0x89, 0x2d, 0x0c, 0x7d, + 0x0a, 0x7d, 0x52, 0xe8, 0x69, 0xcc, 0xc4, 0x99, 0x1c, 0x34, 0x6d, 0xcc, 0xce, 0x8a, 0x98, 0xc3, + 0x42, 0x4f, 0x9f, 0x89, 0x33, 0x89, 0x7b, 0xc4, 0x9d, 0x90, 0x0f, 0x60, 0xb4, 0x11, 0x5d, 0xe4, + 0x54, 0x0d, 0x5a, 0x7b, 0xad, 0xd1, 0x06, 0xbe, 0xe6, 0x09, 0x04, 0x74, 0x4e, 0x17, 0x98, 0xfc, + 0x88, 0xee, 0x03, 0x98, 0xa7, 0xe2, 0x64, 0xa9, 0xa9, 0xb2, 0xba, 0x36, 0x70, 0xdf, 0x78, 0xc6, + 0xc6, 0x81, 0x3e, 0x82, 0xbb, 0xb5, 0x02, 0x87, 0x69, 0x5a, 0xcc, 0x66, 0xf5, 0x54, 0x89, 0xbb, + 0xed, 0xbd, 0x9f, 0x3d, 0x58, 0x3b, 0x61, 0x99, 0xf8, 0x5a, 0xa6, 0xff, 0xd7, 0x93, 0xdb, 0xd0, + 0x4b, 0xa7, 0x84, 0x89, 0x98, 0x4d, 0x06, 0xad, 0x3d, 0x6f, 0xd4, 0xc7, 0x6b, 0xd6, 0x7e, 0x36, + 0x41, 0x0f, 0xe0, 0x0e, 0x49, 0x53, 0x59, 0x08, 0x1d, 0x8b, 0x82, 0x27, 0x34, 0x1f, 0xb4, 0xf7, + 0xbc, 0x51, 0x1b, 0x6f, 0x3a, 0xef, 0x0b, 0xeb, 0x0c, 0x7e, 0x69, 0x42, 0xb7, 0xcc, 0x37, 0x7a, + 0x08, 0x3d, 0x4e, 0x95, 0x22, 0x99, 0x55, 0xd4, 0x1a, 0xad, 0x1f, 0x6c, 0x85, 0x65, 0x35, 0xc3, + 0xaa, 0x9a, 0xe1, 0xa1, 0x58, 0xe2, 0x1a, 0x85, 0x10, 0xb4, 0x39, 0xe5, 0x65, 0x59, 0xfa, 0xd8, + 0x9e, 0xcd, 0xbb, 0x9a, 0x71, 0x2a, 0x0b, 0x1d, 0x4f, 0x29, 0xcb, 0xa6, 0xda, 0x0a, 0x6b, 0xe3, + 0x4d, 0xe7, 0x3d, 0xb2, 0x4e, 0x34, 0x86, 0x7b, 0x74, 0xa1, 0xa9, 0x50, 0x4c, 0x8a, 0x58, 0xce, + 0x35, 0x93, 0x42, 0x0d, 0xfe, 0x5e, 0xbb, 0xe1, 0xd9, 0xf7, 0x6a, 0xfc, 0xf7, 0x25, 0x1c, 0xbd, + 0x04, 0x5f, 0x48, 0x11, 0xa7, 0x39, 0xd3, 0x2c, 0x25, 0xb3, 0x78, 0x05, 0xe1, 0xdd, 0x1b, 0x08, + 0x77, 0x84, 0x14, 0x4f, 0x5c, 0xec, 0x37, 0xff, 0xe2, 0x0e, 0xce, 0xa1, 0x57, 0xb5, 0x14, 0xfa, + 0x0a, 0x36, 0x4c, 0x19, 0x69, 0x6e, 0xeb, 0x51, 0x25, 0xe7, 0xfe, 0x8a, 0x2e, 0x3c, 0xb1, 0x30, + 0xdb, 0x87, 0xeb, 0xaa, 0x3e, 0x2b, 0x34, 0x82, 0xd6, 0x19, 0xa5, 0xae, 0x7d, 0xdf, 0x5f, 0x11, + 0xf8, 0x94, 0x52, 0x6c, 0x20, 0xc1, 0xaf, 0x1e, 0xc0, 0x15, 0x0b, 0x7a, 0x0c, 0x30, 0x2f, 0x92, + 0x19, 0x4b, 0xe3, 0x57, 0xb4, 0x1a, 0x99, 0xd5, 0x7f, 0xd3, 0x2f, 0x71, 0xcf, 0xa9, 0x1d, 0x19, + 0x2e, 0x27, 0xf4, 0xb6, 0x91, 0x39, 0x96, 0x13, 0x5a, 0x8e, 0x0c, 0x77, 0x27, 0x34, 0x84, 0x9e, + 0xa2, 0x3f, 0x14, 0x54, 0xa4, 0xd4, 0x95, 0xad, 0xb6, 0x83, 0x77, 0x4d, 0xe8, 0x55, 0x21, 0xe8, + 0x0b, 0xe8, 0x2a, 0x26, 0xb2, 0x19, 0x75, 0x9a, 0x82, 0x1b, 0xf8, 0xc3, 0x13, 0x8b, 0x3c, 0x6a, + 0x60, 0x17, 0x83, 0x3e, 0x83, 0x8e, 0xdd, 0x3f, 0x4e, 0xdc, 0x07, 0x37, 0x05, 0x1f, 0x1b, 0xe0, + 0x51, 0x03, 0x97, 0x11, 0xc3, 0x43, 0xe8, 0x96, 0x74, 0xe8, 0x13, 0x68, 0x1b, 0xdd, 0x56, 0xc0, + 0x9d, 0x83, 0x0f, 0xaf, 0x71, 0x54, 0x1b, 0xe9, 0x7a, 0x55, 0x0c, 0x1f, 0xb6, 0x01, 0xc3, 0xd7, + 0x1e, 0x74, 0x2c, 0x2b, 0x7a, 0x0e, 0xbd, 0x84, 0x69, 0x92, 0xe7, 0xa4, 0xca, 0x6d, 0x54, 0xd1, + 0x94, 0x7b, 0x33, 0xac, 0xd7, 0x64, 0xc5, 0xf5, 0x44, 0xf2, 0x39, 0x49, 0xf5, 0x98, 0xe9, 0x43, + 0x13, 0x86, 0x6b, 0x02, 0xf4, 0x39, 0x40, 0x9d, 0x75, 0x33, 0xae, 0xad, 0xdb, 0xd2, 0xde, 0xaf, + 0xd2, 0xae, 0xc6, 0x1d, 0x68, 0xa9, 0x82, 0x07, 0xbf, 0x7b, 0xd0, 0x7a, 0x4a, 0x29, 0x4a, 0xa1, + 0x4b, 0xb8, 0x19, 0x52, 0xd7, 0x6a, 0xf5, 0x92, 0x34, 0xeb, 0xf9, 0x9a, 0x14, 0x26, 0xc6, 0x0f, + 0xdf, 0xfc, 0xb9, 0xdb, 0xf8, 0xed, 0xaf, 0xdd, 0x51, 0xc6, 0xf4, 0xb4, 0x48, 0xc2, 0x54, 0xf2, + 0xa8, 0x5a, 0xfd, 0xf6, 0xb3, 0xaf, 0x26, 0xaf, 0x22, 0xbd, 0x9c, 0x53, 0x65, 0x03, 0x14, 0x76, + 0xd4, 0x68, 0x07, 0xfa, 0x19, 0x51, 0xf1, 0x8c, 0x71, 0xa6, 0x6d, 0x21, 0xda, 0xb8, 0x97, 0x11, + 0xf5, 0x9d, 0xb1, 0xd1, 0x16, 0x74, 0xe6, 0x64, 0x49, 0x73, 0xb7, 0x55, 0x4a, 0x03, 0x0d, 0x60, + 0x2d, 0xcb, 0x89, 0xd0, 0x6e, 0x99, 0xf4, 0x71, 0x65, 0x06, 0xdf, 0x02, 0x9c, 0xd0, 0xfc, 0x9c, + 0xa5, 0xf4, 0x58, 0x65, 0x68, 0x17, 0xd6, 0x39, 0xd5, 0x53, 0x39, 0x89, 0x05, 0xe1, 0x65, 0x85, + 0xfa, 0x18, 0x4a, 0xd7, 0x0b, 0xc2, 0xa9, 0x21, 0xca, 0x4d, 0x5f, 0x29, 0xed, 0xf6, 0x5a, 0x65, + 0x8e, 0xbf, 0x7c, 0x73, 0xe1, 0x7b, 0x6f, 0x2f, 0x7c, 0xef, 0xdd, 0x85, 0xef, 0xbd, 0xbe, 0xf4, + 0x1b, 0x6f, 0x2f, 0xfd, 0xc6, 0x1f, 0x97, 0x7e, 0xe3, 0xe5, 0x83, 0xdb, 0xff, 0x30, 0xd2, 0x8b, + 0xa4, 0x6b, 0xa7, 0xe2, 0xf1, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc3, 0xc0, 0x25, 0x15, 0x46, + 0x07, 0x00, 0x00, } func (m *Tx) Marshal() (dAtA []byte, err error) { @@ -1355,6 +1419,43 @@ func (m *Fee) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ServiceMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceMsg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Request) > 0 { + i -= len(m.Request) + copy(dAtA[i:], m.Request) + i = encodeVarintTx(dAtA, i, uint64(len(m.Request))) + i-- + dAtA[i] = 0x12 + } + if len(m.MethodName) > 0 { + i -= len(m.MethodName) + copy(dAtA[i:], m.MethodName) + i = encodeVarintTx(dAtA, i, uint64(len(m.MethodName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1602,6 +1703,23 @@ func (m *Fee) Size() (n int) { return n } +func (m *ServiceMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MethodName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Request) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3051,6 +3169,125 @@ func (m *Fee) Unmarshal(dAtA []byte) error { } return nil } +func (m *ServiceMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MethodName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MethodName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Request = append(m.Request[:0], dAtA[iNdEx:postIndex]...) + if m.Request == nil { + m.Request = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/types/tx_msg.go b/types/tx_msg.go index d1ddbf7da5a9..e75b7b6ae62a 100644 --- a/types/tx_msg.go +++ b/types/tx_msg.go @@ -1,13 +1,15 @@ package types import ( + "github.com/gogo/protobuf/proto" + "github.com/tendermint/tendermint/crypto" ) type ( // Msg defines the interface a transaction message must fulfill. Msg interface { - MsgRequest + proto.Message // Return the message type. // Must be alphanumeric or empty. @@ -17,8 +19,17 @@ type ( // within tags Type() string + // ValidateBasic does a simple validation check that + // doesn't require access to any other information. + ValidateBasic() error + // Get the canonical byte representation of the Msg. GetSignBytes() []byte + + // Signers returns the addrs of signers that must sign. + // CONTRACT: All signatures must be present to be valid. + // CONTRACT: Returns addrs in some deterministic order. + GetSigners() []AccAddress } // Fee defines an interface for an application application-defined concrete diff --git a/x/auth/tx/builder.go b/x/auth/tx/builder.go index b3697e70b262..22e4f4742232 100644 --- a/x/auth/tx/builder.go +++ b/x/auth/tx/builder.go @@ -206,15 +206,11 @@ func (w *wrapper) SetMsgs(msgs ...sdk.Msg) error { for i, msg := range msgs { var err error switch msg := msg.(type) { - case sdk.ServiceMsg: + case tx.ServiceMsg: { - bz, err := proto.Marshal(msg.Request) - if err != nil { - return err - } anys[i] = &codectypes.Any{ TypeUrl: msg.MethodName, - Value: bz, + Value: msg.Request, } } default: diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index abc37dcf0ae7..a9e70007c389 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -70,6 +70,7 @@ func (m *MsgSend) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSend proto.InternalMessageInfo +// MsgSendResponse defines the Msg/Send response type. type MsgSendResponse struct { } @@ -159,6 +160,7 @@ func (m *MsgMultiSend) GetOutputs() []Output { return nil } +// MsgMultiSendResponse defines the Msg/MultiSend response type. type MsgMultiSendResponse struct { } @@ -248,7 +250,9 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + // Send defines a method for sending coins from one account to another account. Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) + // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) } @@ -280,7 +284,9 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp // MsgServer is the server API for Msg service. type MsgServer interface { + // Send defines a method for sending coins from one account to another account. Send(context.Context, *MsgSend) (*MsgSendResponse, error) + // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) } From 0c5ce17c6143a06ea95ea2a9302e0f45b4fecac9 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 13:42:11 -0400 Subject: [PATCH 24/51] WIP on ServiceMsg unpacking --- baseapp/msg_service_router.go | 66 ++++++++++++++++--------------- codec/json.go | 4 +- codec/types/interface_registry.go | 60 ++++++++++++++++++++++++++-- proto/cosmos/tx/v1beta1/tx.proto | 13 ------ types/tx/types.go | 7 +++- 5 files changed, 99 insertions(+), 51 deletions(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 1e8a4a3d8ac2..d3f617780995 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -1,14 +1,16 @@ package baseapp import ( + "context" "fmt" + "github.com/gogo/protobuf/proto" + gogogrpc "github.com/gogo/protobuf/grpc" "google.golang.org/grpc" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx" ) @@ -29,7 +31,7 @@ func NewMsgServiceRouter() *MsgServiceRouter { } // MsgServiceHandler defines a function type which handles Msg service message. -type MsgServiceHandler = func(ctx sdk.Context, reqBz []byte) (*sdk.Result, error) +type MsgServiceHandler = func(ctx sdk.Context, req tx.MsgRequest) (*sdk.Result, error) // Route returns the MsgServiceHandler for a given query route path or nil // if not found. @@ -50,45 +52,47 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) methodHandler := method.Handler - msr.routes[fqMethod] = func(ctx sdk.Context, reqBz []byte) (*sdk.Result, error) { + // NOTE: this is how we pull the concrete request type for each handler for registering in the InterfaceRegistry. + // This approach is maybe a bit hacky, but less hacky than reflecting on the handler object itself. + // We use a no-op interceptor to avoid actually calling into the handler itself. + _, _ = methodHandler(nil, context.Background(), func(i interface{}) error { + msg, ok := i.(proto.Message) + if !ok { + // we panic here because there is no other alternative and the app cannot be initialized correctly + // this should only happen if there is a problem with code generation in which case the app won't + // work correctly anyway + panic(fmt.Errorf("can't register request type %T for service method %s", i, fqMethod)) + } + msr.interfaceRegistry.RegisterServiceRequestType(fqMethod, msg) + return nil + }, func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { + return nil, nil + }) + + msr.routes[fqMethod] = func(ctx sdk.Context, req tx.MsgRequest) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) // call the method handler from the service description with the handler object, // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { - err := protoCodec.Unmarshal(reqBz, i) - if err != nil { - return err - } - - req, ok := i.(tx.MsgRequest) - if !ok { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "req is not a MsgRequest") - } - - if msr.interfaceRegistry != nil { - return codectypes.UnpackInterfaces(i, msr.interfaceRegistry) - } - - err = req.ValidateBasic() + // we don't do any decoding here because the decoding was already done + return nil + }, func(goCtx context.Context, _ interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + err := req.ValidateBasic() if err != nil { - return err + return nil, err } - - return nil - }, nil) + goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) + return handler(goCtx, req) + }) if err != nil { return nil, err } - // proto marshal the result bytes - resBytes, err := protoCodec.Marshal(res) - if err != nil { - return nil, err + resMsg, ok := res.(proto.Message) + if !ok { + return nil, fmt.Errorf("can't proto encode %T", resMsg) } - - // return the result bytes as the response value - return &sdk.Result{ - Data: resBytes, - }, nil + return sdk.WrapServiceResult(ctx, resMsg, err) } } } diff --git a/codec/json.go b/codec/json.go index 044a6ae2b87e..db77365e0356 100644 --- a/codec/json.go +++ b/codec/json.go @@ -11,10 +11,10 @@ import ( // ProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded // bytes of a message. -func ProtoMarshalJSON(msg proto.Message) ([]byte, error) { +func ProtoMarshalJSON(msg proto.Message, resolver jsonpb.AnyResolver) ([]byte, error) { // We use the OrigName because camel casing fields just doesn't make sense. // EmitDefaults is also often the more expected behavior for CLI users - jm := &jsonpb.Marshaler{OrigName: true, EmitDefaults: true} + jm := &jsonpb.Marshaler{OrigName: true, EmitDefaults: true, AnyResolver: resolver} err := types.UnpackInterfaces(msg, types.ProtoJSONPacker{JSONPBMarshaler: jm}) if err != nil { return nil, err diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index 8bdb8168f5d5..dc944323bb2b 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -4,6 +4,8 @@ import ( "fmt" "reflect" + "github.com/gogo/protobuf/jsonpb" + "github.com/gogo/protobuf/proto" ) @@ -18,12 +20,14 @@ type AnyUnpacker interface { // err := cdc.UnpackAny(any, &msg) // ... UnpackAny(any *Any, iface interface{}) error + UnpackServiceMethodRequest(any *Any) (proto.Message, error) } // InterfaceRegistry provides a mechanism for registering interfaces and // implementations that can be safely unpacked from Any type InterfaceRegistry interface { AnyUnpacker + jsonpb.AnyResolver // RegisterInterface associates protoName as the public name for the // interface passed in as iface. This is to be used primarily to create @@ -43,6 +47,8 @@ type InterfaceRegistry interface { // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) RegisterImplementations(iface interface{}, impls ...proto.Message) + RegisterServiceRequestType(methodName string, request proto.Message) + // ListAllInterfaces list the type URLs of all registered interfaces. ListAllInterfaces() []string @@ -76,8 +82,10 @@ type UnpackInterfacesMessage interface { } type interfaceRegistry struct { - interfaceNames map[string]reflect.Type - interfaceImpls map[reflect.Type]interfaceMap + interfaceNames map[string]reflect.Type + interfaceImpls map[reflect.Type]interfaceMap + typeURLMap map[string]reflect.Type + serviceRequests map[string]reflect.Type } type interfaceMap = map[string]reflect.Type @@ -112,12 +120,20 @@ func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, im panic(fmt.Errorf("type %T doesn't actually implement interface %+v", impl, ityp)) } - imap["/"+proto.MessageName(impl)] = implType + typeUrl := "/" + proto.MessageName(impl) + imap[typeUrl] = implType + registry.typeURLMap[typeUrl] = implType } registry.interfaceImpls[ityp] = imap } +func (registry *interfaceRegistry) RegisterServiceRequestType(methodName string, request proto.Message) { + typ := reflect.TypeOf(request) + registry.typeURLMap[methodName] = typ + registry.serviceRequests[methodName] = typ +} + func (registry *interfaceRegistry) ListAllInterfaces() []string { interfaceNames := registry.interfaceNames keys := make([]string, 0, len(interfaceNames)) @@ -198,6 +214,44 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error return nil } +func (registry *interfaceRegistry) UnpackServiceMethodRequest(any *Any) (proto.Message, error) { + if any.TypeUrl == "" { + // if TypeUrl is empty return nil because without it we can't actually unpack anything + return nil, nil + } + + typ, found := registry.serviceRequests[any.TypeUrl] + if !found { + return nil, fmt.Errorf("no method named %s registered", any.TypeUrl) + } + + msg, ok := reflect.New(typ.Elem()).Interface().(proto.Message) + if !ok { + return nil, fmt.Errorf("can't proto unmarshal %T", msg) + } + + err := proto.Unmarshal(any.Value, msg) + if err != nil { + return nil, err + } + + err = UnpackInterfaces(msg, registry) + if err != nil { + return nil, err + } + + return msg, nil +} + +func (registry *interfaceRegistry) Resolve(typeUrl string) (proto.Message, error) { + typ := registry.typeURLMap[typeUrl] + msg, ok := reflect.New(typ.Elem()).Interface().(proto.Message) + if !ok { + return nil, fmt.Errorf("can't resolve type URL %s", typeUrl) + } + return msg, nil +} + // UnpackInterfaces is a convenience function that calls UnpackInterfaces // on x if x implements UnpackInterfacesMessage func UnpackInterfaces(x interface{}, unpacker AnyUnpacker) error { diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto index 10464b3b8aaa..05eea1f65482 100644 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -180,16 +180,3 @@ message Fee { // not support fee grants, this will fail string granter = 4; } - -// ServiceMsg is the struct which represents a service message, it can be -// thought as an Any whose typeUrl matches a service method format -// (ex. `/cosmos.gov.Msg/SubmitProposal`), and whose value is the marshalled -// bytes of the request. -message ServiceMsg { - // method_name is the fully-qualified service method name of the service - // message. Note that is contains two '/' characters. - string method_name = 1; - // request is the encoded raw bytes of the request which corresponds to the - // service method. - bytes request = 2; -} diff --git a/types/tx/types.go b/types/tx/types.go index d5ee1160385c..a1261d62795b 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -142,11 +142,14 @@ func (m *TxBody) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { // If the any's typeUrl contains 2 slashes, then we unpack the any into // a ServiceMsg struct as per ADR-031. if nSlashes := len(strings.Split("/", any.TypeUrl)) - 1; nSlashes >= 2 { - var serviceMsg sdk.ServiceMsg - err := unpacker.UnpackAny(any, &serviceMsg) + var serviceMsg ServiceMsg + req, err := unpacker.UnpackServiceMethodRequest(any) if err != nil { return err } + msgReq, ok := req.(MsgRequest) + serviceMsg.MethodName = any.TypeUrl + serviceMsg.Request = msgReq } else { var msg sdk.Msg err := unpacker.UnpackAny(any, &msg) From 14619c4bea55695b749848aebc41ab225dc600cb Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 15:14:38 -0400 Subject: [PATCH 25/51] Make TestMsgService test pass --- baseapp/abci.go | 2 +- baseapp/baseapp.go | 53 ++-- baseapp/msg_service_router.go | 16 +- baseapp/options.go | 8 + codec/proto_codec.go | 21 +- codec/types/interface_registry.go | 75 ++---- codec/unknownproto/unknown_fields.go | 19 +- simapp/app.go | 2 +- simapp/msg_service_test.go | 31 +-- types/{tx => }/msg_service.go | 30 +-- types/tx/tx.pb.go | 350 +++++---------------------- types/tx/types.go | 23 +- x/auth/tx/builder.go | 8 +- x/auth/tx/config.go | 2 +- x/auth/tx/decoder.go | 6 +- x/auth/tx/encoder.go | 6 +- x/auth/tx/sigs.go | 2 +- 17 files changed, 223 insertions(+), 431 deletions(-) rename types/{tx => }/msg_service.go (65%) diff --git a/baseapp/abci.go b/baseapp/abci.go index e3a07d620406..07c6be72b253 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -688,7 +688,7 @@ func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) abci.Res Result: res, } - bz, err := codec.ProtoMarshalJSON(simRes) + bz, err := codec.ProtoMarshalJSON(simRes, app.interfaceRegistry) if err != nil { return sdkerrors.QueryResult(sdkerrors.Wrap(err, "failed to JSON encode simulation response")) } diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 1b84e8f7044f..9b2e956ac46b 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -6,6 +6,8 @@ import ( "reflect" "strings" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/gogo/protobuf/proto" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/tmhash" @@ -45,16 +47,17 @@ type ( // BaseApp reflects the ABCI application implementation. type BaseApp struct { // nolint: maligned // initialized on creation - logger log.Logger - name string // application name from abci.Info - db dbm.DB // common DB backend - cms sdk.CommitMultiStore // Main (uncached) state - storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader() - router sdk.Router // handle any kind of message - queryRouter sdk.QueryRouter // router for redirecting query calls - grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls - msgServiceRouter *MsgServiceRouter // router for redirecting Msg service messages - txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx + logger log.Logger + name string // application name from abci.Info + db dbm.DB // common DB backend + cms sdk.CommitMultiStore // Main (uncached) state + storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader() + router sdk.Router // handle any kind of message + queryRouter sdk.QueryRouter // router for redirecting query calls + grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls + msgServiceRouter *MsgServiceRouter // router for redirecting Msg service messages + interfaceRegistry types.InterfaceRegistry + txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx anteHandler sdk.AnteHandler // ante handler for fee and auth initChainer sdk.InitChainer // initialize state with validators and state blob @@ -684,20 +687,36 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s break } - msgRoute := msg.Route() - handler := app.router.Route(ctx, msgRoute) + var msgEvents sdk.Events + var msgResult *sdk.Result + var err error + var msgType string + + if svcMsg, ok := msg.(sdk.ServiceMsg); ok { + msgType = svcMsg.MethodName + handler := app.msgServiceRouter.Handler(msgType) + if handler == nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message service method: %s; message index: %d", msgType, i) + } + msgResult, err = handler(ctx, svcMsg.Request) + } else { + // legacy sdk.Msg routing + msgRoute := msg.Route() + msgType = msg.Type() + handler := app.router.Route(ctx, msgRoute) + if handler == nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message route: %s; message index: %d", msgRoute, i) + } - if handler == nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message route: %s; message index: %d", msgRoute, i) + msgResult, err = handler(ctx, msg) } - msgResult, err := handler(ctx, msg) if err != nil { return nil, sdkerrors.Wrapf(err, "failed to execute message; message index: %d", i) } - msgEvents := sdk.Events{ - sdk.NewEvent(sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyAction, msg.Type())), + msgEvents = sdk.Events{ + sdk.NewEvent(sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyAction, msgType)), } msgEvents = msgEvents.AppendEvents(msgResult.GetEvents()) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index d3f617780995..530a38d0af70 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -11,7 +11,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" ) // MsgServiceRouter routes Msg Service fully-qualified service methods to their @@ -31,12 +30,12 @@ func NewMsgServiceRouter() *MsgServiceRouter { } // MsgServiceHandler defines a function type which handles Msg service message. -type MsgServiceHandler = func(ctx sdk.Context, req tx.MsgRequest) (*sdk.Result, error) +type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) // Route returns the MsgServiceHandler for a given query route path or nil // if not found. -func (msr *MsgServiceRouter) Route(path string) MsgServiceHandler { - handler, found := msr.routes[path] +func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { + handler, found := msr.routes[methodName] if !found { return nil } @@ -63,24 +62,21 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter // work correctly anyway panic(fmt.Errorf("can't register request type %T for service method %s", i, fqMethod)) } - msr.interfaceRegistry.RegisterServiceRequestType(fqMethod, msg) + msr.interfaceRegistry.RegisterServiceRequestType((*sdk.MsgRequest)(nil), fqMethod, msg) return nil }, func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { return nil, nil }) - msr.routes[fqMethod] = func(ctx sdk.Context, req tx.MsgRequest) (*sdk.Result, error) { + msr.routes[fqMethod] = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) + // call the method handler from the service description with the handler object, // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { // we don't do any decoding here because the decoding was already done return nil }, func(goCtx context.Context, _ interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - err := req.ValidateBasic() - if err != nil { - return nil, err - } goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) return handler(goCtx, req) }) diff --git a/baseapp/options.go b/baseapp/options.go index 026433ae5bed..482863e1a128 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -4,6 +4,8 @@ import ( "fmt" "io" + "github.com/cosmos/cosmos-sdk/codec/types" + dbm "github.com/tendermint/tm-db" "github.com/cosmos/cosmos-sdk/snapshots" @@ -221,3 +223,9 @@ func (app *BaseApp) SetSnapshotKeepRecent(snapshotKeepRecent uint32) { } app.snapshotKeepRecent = snapshotKeepRecent } + +func (app *BaseApp) SetInterfaceRegistry(registry types.InterfaceRegistry) { + app.interfaceRegistry = registry + app.grpcQueryRouter.SetInterfaceRegistry(registry) + app.msgServiceRouter.SetInterfaceRegistry(registry) +} diff --git a/codec/proto_codec.go b/codec/proto_codec.go index 02677af3627c..c9123f5d754c 100644 --- a/codec/proto_codec.go +++ b/codec/proto_codec.go @@ -14,14 +14,14 @@ import ( // ProtoCodec defines a codec that utilizes Protobuf for both binary and JSON // encoding. type ProtoCodec struct { - anyUnpacker types.AnyUnpacker + interfaceRegistry types.InterfaceRegistry } var _ Marshaler = &ProtoCodec{} // NewProtoCodec returns a reference to a new ProtoCodec -func NewProtoCodec(anyUnpacker types.AnyUnpacker) *ProtoCodec { - return &ProtoCodec{anyUnpacker: anyUnpacker} +func NewProtoCodec(interfaceRegistry types.InterfaceRegistry) *ProtoCodec { + return &ProtoCodec{interfaceRegistry: interfaceRegistry} } // MarshalBinaryBare implements BinaryMarshaler.MarshalBinaryBare method. @@ -67,7 +67,7 @@ func (pc *ProtoCodec) UnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler) error { if err != nil { return err } - err = types.UnpackInterfaces(ptr, pc.anyUnpacker) + err = types.UnpackInterfaces(ptr, pc.interfaceRegistry) if err != nil { return err } @@ -113,7 +113,7 @@ func (pc *ProtoCodec) MarshalJSON(o proto.Message) ([]byte, error) { return nil, fmt.Errorf("cannot protobuf JSON encode unsupported type: %T", o) } - return ProtoMarshalJSON(m) + return ProtoMarshalJSON(m, pc.interfaceRegistry) } // MustMarshalJSON implements JSONMarshaler.MustMarshalJSON method, @@ -135,12 +135,13 @@ func (pc *ProtoCodec) UnmarshalJSON(bz []byte, ptr proto.Message) error { return fmt.Errorf("cannot protobuf JSON decode unsupported type: %T", ptr) } - err := jsonpb.Unmarshal(strings.NewReader(string(bz)), m) + unmarshaler := jsonpb.Unmarshaler{AnyResolver: pc.interfaceRegistry} + err := unmarshaler.Unmarshal(strings.NewReader(string(bz)), m) if err != nil { return err } - return types.UnpackInterfaces(ptr, pc.anyUnpacker) + return types.UnpackInterfaces(ptr, pc.interfaceRegistry) } // MustUnmarshalJSON implements JSONMarshaler.MustUnmarshalJSON method, @@ -155,5 +156,9 @@ func (pc *ProtoCodec) MustUnmarshalJSON(bz []byte, ptr proto.Message) { // it unpacks the value in any to the interface pointer passed in as // iface. func (pc *ProtoCodec) UnpackAny(any *types.Any, iface interface{}) error { - return pc.anyUnpacker.UnpackAny(any, iface) + return pc.interfaceRegistry.UnpackAny(any, iface) +} + +func (pc *ProtoCodec) InterfaceRegistry() types.InterfaceRegistry { + return pc.interfaceRegistry } diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index dc944323bb2b..3b17309f05b7 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -20,7 +20,6 @@ type AnyUnpacker interface { // err := cdc.UnpackAny(any, &msg) // ... UnpackAny(any *Any, iface interface{}) error - UnpackServiceMethodRequest(any *Any) (proto.Message, error) } // InterfaceRegistry provides a mechanism for registering interfaces and @@ -47,7 +46,7 @@ type InterfaceRegistry interface { // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) RegisterImplementations(iface interface{}, impls ...proto.Message) - RegisterServiceRequestType(methodName string, request proto.Message) + RegisterServiceRequestType(iface interface{}, methodName string, request proto.Message) // ListAllInterfaces list the type URLs of all registered interfaces. ListAllInterfaces() []string @@ -82,10 +81,9 @@ type UnpackInterfacesMessage interface { } type interfaceRegistry struct { - interfaceNames map[string]reflect.Type - interfaceImpls map[reflect.Type]interfaceMap - typeURLMap map[string]reflect.Type - serviceRequests map[string]reflect.Type + interfaceNames map[string]reflect.Type + interfaceImpls map[reflect.Type]interfaceMap + typeURLMap map[string]reflect.Type } type interfaceMap = map[string]reflect.Type @@ -95,6 +93,7 @@ func NewInterfaceRegistry() InterfaceRegistry { return &interfaceRegistry{ interfaceNames: map[string]reflect.Type{}, interfaceImpls: map[reflect.Type]interfaceMap{}, + typeURLMap: map[string]reflect.Type{}, } } @@ -108,30 +107,32 @@ func (registry *interfaceRegistry) RegisterInterface(protoName string, iface int } func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, impls ...proto.Message) { + for _, impl := range impls { + typeUrl := "/" + proto.MessageName(impl) + registry.registerImpl(iface, typeUrl, impl) + } +} + +func (registry *interfaceRegistry) RegisterServiceRequestType(iface interface{}, methodName string, request proto.Message) { + registry.registerImpl(iface, methodName, request) +} + +func (registry *interfaceRegistry) registerImpl(iface interface{}, typeUrl string, impl proto.Message) { ityp := reflect.TypeOf(iface).Elem() imap, found := registry.interfaceImpls[ityp] if !found { imap = map[string]reflect.Type{} } - for _, impl := range impls { - implType := reflect.TypeOf(impl) - if !implType.AssignableTo(ityp) { - panic(fmt.Errorf("type %T doesn't actually implement interface %+v", impl, ityp)) - } - - typeUrl := "/" + proto.MessageName(impl) - imap[typeUrl] = implType - registry.typeURLMap[typeUrl] = implType + implType := reflect.TypeOf(impl) + if !implType.AssignableTo(ityp) { + panic(fmt.Errorf("type %T doesn't actually implement interface %+v", impl, ityp)) } - registry.interfaceImpls[ityp] = imap -} + imap[typeUrl] = implType + registry.typeURLMap[typeUrl] = implType -func (registry *interfaceRegistry) RegisterServiceRequestType(methodName string, request proto.Message) { - typ := reflect.TypeOf(request) - registry.typeURLMap[methodName] = typ - registry.serviceRequests[methodName] = typ + registry.interfaceImpls[ityp] = imap } func (registry *interfaceRegistry) ListAllInterfaces() []string { @@ -214,41 +215,17 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error return nil } -func (registry *interfaceRegistry) UnpackServiceMethodRequest(any *Any) (proto.Message, error) { - if any.TypeUrl == "" { - // if TypeUrl is empty return nil because without it we can't actually unpack anything - return nil, nil - } - - typ, found := registry.serviceRequests[any.TypeUrl] +func (registry *interfaceRegistry) Resolve(typeUrl string) (proto.Message, error) { + typ, found := registry.typeURLMap[typeUrl] if !found { - return nil, fmt.Errorf("no method named %s registered", any.TypeUrl) - } - - msg, ok := reflect.New(typ.Elem()).Interface().(proto.Message) - if !ok { - return nil, fmt.Errorf("can't proto unmarshal %T", msg) - } - - err := proto.Unmarshal(any.Value, msg) - if err != nil { - return nil, err + return nil, fmt.Errorf("unable to resolve type URL %s", typeUrl) } - err = UnpackInterfaces(msg, registry) - if err != nil { - return nil, err - } - - return msg, nil -} - -func (registry *interfaceRegistry) Resolve(typeUrl string) (proto.Message, error) { - typ := registry.typeURLMap[typeUrl] msg, ok := reflect.New(typ.Elem()).Interface().(proto.Message) if !ok { return nil, fmt.Errorf("can't resolve type URL %s", typeUrl) } + return msg, nil } diff --git a/codec/unknownproto/unknown_fields.go b/codec/unknownproto/unknown_fields.go index 4faaca0b858e..d60ca42ec5d5 100644 --- a/codec/unknownproto/unknown_fields.go +++ b/codec/unknownproto/unknown_fields.go @@ -9,6 +9,8 @@ import ( "reflect" "sync" + "github.com/gogo/protobuf/jsonpb" + "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" "google.golang.org/protobuf/encoding/protowire" @@ -24,8 +26,8 @@ type descriptorIface interface { // RejectUnknownFieldsStrict rejects any bytes bz with an error that has unknown fields for the provided proto.Message type. // This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. -func RejectUnknownFieldsStrict(bz []byte, msg proto.Message) error { - _, err := RejectUnknownFields(bz, msg, false) +func RejectUnknownFieldsStrict(bz []byte, msg proto.Message, resolver jsonpb.AnyResolver) error { + _, err := RejectUnknownFields(bz, msg, false, resolver) return err } @@ -34,7 +36,7 @@ func RejectUnknownFieldsStrict(bz []byte, msg proto.Message) error { // hasUnknownNonCriticals will be set to true if non-critical fields were encountered during traversal. This flag can be // used to treat a message with non-critical field different in different security contexts (such as transaction signing). // This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. -func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals bool) (hasUnknownNonCriticals bool, err error) { +func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals bool, resolver jsonpb.AnyResolver) (hasUnknownNonCriticals bool, err error) { if len(bz) == 0 { return hasUnknownNonCriticals, nil } @@ -115,9 +117,12 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals _, o := protowire.ConsumeVarint(fieldBytes) fieldBytes = fieldBytes[o:] + var msg proto.Message + var err error + if protoMessageName == ".google.protobuf.Any" { // Firstly typecheck types.Any to ensure nothing snuck in. - hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, (*types.Any)(nil), allowUnknownNonCriticals) + hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, (*types.Any)(nil), allowUnknownNonCriticals, resolver) hasUnknownNonCriticals = hasUnknownNonCriticals || hasUnknownNonCriticalsChild if err != nil { return hasUnknownNonCriticals, err @@ -129,14 +134,16 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals } protoMessageName = any.TypeUrl fieldBytes = any.Value + msg, err = resolver.Resolve(protoMessageName) + } else { + msg, err = protoMessageForTypeName(protoMessageName[1:]) } - msg, err := protoMessageForTypeName(protoMessageName[1:]) if err != nil { return hasUnknownNonCriticals, err } - hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, msg, allowUnknownNonCriticals) + hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, msg, allowUnknownNonCriticals, resolver) hasUnknownNonCriticals = hasUnknownNonCriticals || hasUnknownNonCriticalsChild if err != nil { return hasUnknownNonCriticals, err diff --git a/simapp/app.go b/simapp/app.go index 3096fcf28c5f..e9e9c4ac4df2 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -202,7 +202,7 @@ func NewSimApp( bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetAppVersion(version.Version) - bApp.GRPCQueryRouter().SetInterfaceRegistry(interfaceRegistry) + bApp.SetInterfaceRegistry(interfaceRegistry) bApp.GRPCQueryRouter().RegisterSimulateService(bApp.Simulate, interfaceRegistry) keys := sdk.NewKVStoreKeys( diff --git a/simapp/msg_service_test.go b/simapp/msg_service_test.go index 8ad4264bd035..d02957ddea4a 100644 --- a/simapp/msg_service_test.go +++ b/simapp/msg_service_test.go @@ -1,10 +1,11 @@ package simapp_test import ( - "fmt" "os" "testing" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" @@ -19,23 +20,23 @@ import ( ) func TestMsgService(t *testing.T) { - db := dbm.NewMemDB() - encCfg := simapp.MakeEncodingConfig() - msgServiceOpt := func(bapp *baseapp.BaseApp) { - testdata.RegisterMsgServer( - bapp.MsgServiceRouter(), - testdata.MsgImpl{}, - ) - } priv, _, _ := testdata.KeyTestPubAddr() - app := simapp.NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 0, encCfg, msgServiceOpt) + encCfg := simapp.MakeEncodingConfig() + db := dbm.NewMemDB() + app := baseapp.NewBaseApp("test", log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, encCfg.TxConfig.TxDecoder()) + app.SetInterfaceRegistry(encCfg.InterfaceRegistry) + testdata.RegisterMsgServer( + app.MsgServiceRouter(), + testdata.MsgImpl{}, + ) + _ = app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 1}}) msg := testdata.NewServiceMsgCreateDog(&testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}}) - txBuilder := encCfg.TxConfig.NewTxBuilder() txBuilder.SetFeeAmount(testdata.NewTestFeeAmount()) txBuilder.SetGasLimit(testdata.NewTestGasLimit()) - txBuilder.SetMsgs(msg) + err := txBuilder.SetMsgs(msg) + require.NoError(t, err) // First round: we gather all the signer infos. We use the "set empty // signature" hack to do that. @@ -48,7 +49,7 @@ func TestMsgService(t *testing.T) { Sequence: 0, } - err := txBuilder.SetSignatures(sigV2) + err = txBuilder.SetSignatures(sigV2) require.NoError(t, err) // Second round: all signer infos are set, so each signer can sign. @@ -67,6 +68,6 @@ func TestMsgService(t *testing.T) { // Send the tx to the app txBytes, err := encCfg.TxConfig.TxEncoder()(txBuilder.GetTx()) require.NoError(t, err) - res := app.BaseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) - fmt.Println("res=", res) + res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) + require.Equal(t, abci.CodeTypeOK, res.Code, "res=%+v", res) } diff --git a/types/tx/msg_service.go b/types/msg_service.go similarity index 65% rename from types/tx/msg_service.go rename to types/msg_service.go index 9ed625156c63..a4f5a9c04ae7 100644 --- a/types/tx/msg_service.go +++ b/types/msg_service.go @@ -1,9 +1,7 @@ -package tx +package types import ( "github.com/gogo/protobuf/proto" - - sdk "github.com/cosmos/cosmos-sdk/types" ) // MsgRequest is the interface a transaction message, defined as a proto @@ -16,19 +14,23 @@ type MsgRequest interface { // Signers returns the addrs of signers that must sign. // CONTRACT: All signatures must be present to be valid. // CONTRACT: Returns addrs in some deterministic order. - GetSigners() []sdk.AccAddress + GetSigners() []AccAddress +} + +// ServiceMsg is the struct into which an Any whose typeUrl matches a service +// method format (ex. `/cosmos.gov.Msg/SubmitProposal`) unpacks. +type ServiceMsg struct { + // MethodName is the fully-qualified service method name. + MethodName string + // Request is the request payload. + Request MsgRequest } -// // ServiceMsg is the struct into which an Any whose typeUrl matches a service -// // method format (ex. `/cosmos.gov.Msg/SubmitProposal`) unpacks. -// type ServiceMsg struct { -// // MethodName is the fully-qualified service method name. -// MethodName string -// // Request is the request payload. -// Request MsgRequest -// } +var _ Msg = ServiceMsg{} -var _ sdk.Msg = ServiceMsg{} +func (msg ServiceMsg) ProtoMessage() {} +func (msg ServiceMsg) Reset() {} +func (msg ServiceMsg) String() string { return "ServiceMsg" } // Route implements Msg.Route method. func (msg ServiceMsg) Route() string { @@ -46,7 +48,7 @@ func (msg ServiceMsg) GetSignBytes() []byte { } // GetSigners implements Msg.GetSigners method. -func (msg ServiceMsg) GetSigners() []sdk.AccAddress { +func (msg ServiceMsg) GetSigners() []AccAddress { return msg.Request.GetSigners() } diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index 8715cff0b2cb..aef71a802f08 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -5,6 +5,10 @@ package tx import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + types "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/crypto/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -12,9 +16,6 @@ import ( signing "github.com/cosmos/cosmos-sdk/types/tx/signing" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -743,66 +744,6 @@ func (m *Fee) GetGranter() string { return "" } -// ServiceMsg is the struct which represents a service message, it can be -// thought as an Any whose typeUrl matches a service method format -// (ex. `/cosmos.gov.Msg/SubmitProposal`), and whose value is the marshalled -// bytes of the request. -type ServiceMsg struct { - // method_name is the fully-qualified service method name of the service - // message. Note that is contains two '/' characters. - MethodName string `protobuf:"bytes,1,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` - // request is the encoded raw bytes of the request which corresponds to the - // service method. - Request []byte `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"` -} - -func (m *ServiceMsg) Reset() { *m = ServiceMsg{} } -func (m *ServiceMsg) String() string { return proto.CompactTextString(m) } -func (*ServiceMsg) ProtoMessage() {} -func (*ServiceMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_96d1575ffde80842, []int{8} -} -func (m *ServiceMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ServiceMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceMsg.Merge(m, src) -} -func (m *ServiceMsg) XXX_Size() int { - return m.Size() -} -func (m *ServiceMsg) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceMsg proto.InternalMessageInfo - -func (m *ServiceMsg) GetMethodName() string { - if m != nil { - return m.MethodName - } - return "" -} - -func (m *ServiceMsg) GetRequest() []byte { - if m != nil { - return m.Request - } - return nil -} - func init() { proto.RegisterType((*Tx)(nil), "cosmos.tx.v1beta1.Tx") proto.RegisterType((*TxRaw)(nil), "cosmos.tx.v1beta1.TxRaw") @@ -814,69 +755,65 @@ func init() { proto.RegisterType((*ModeInfo_Single)(nil), "cosmos.tx.v1beta1.ModeInfo.Single") proto.RegisterType((*ModeInfo_Multi)(nil), "cosmos.tx.v1beta1.ModeInfo.Multi") proto.RegisterType((*Fee)(nil), "cosmos.tx.v1beta1.Fee") - proto.RegisterType((*ServiceMsg)(nil), "cosmos.tx.v1beta1.ServiceMsg") } func init() { proto.RegisterFile("cosmos/tx/v1beta1/tx.proto", fileDescriptor_96d1575ffde80842) } var fileDescriptor_96d1575ffde80842 = []byte{ - // 883 bytes of a gzipped FileDescriptorProto + // 843 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xdd, 0x6e, 0xdc, 0x44, - 0x14, 0x5e, 0xef, 0x5f, 0x76, 0x4f, 0x92, 0x96, 0x8e, 0x22, 0xb4, 0xd9, 0xa8, 0x4e, 0x30, 0x2a, - 0xec, 0x4d, 0xec, 0x36, 0xbd, 0xe0, 0x47, 0x48, 0x90, 0x2d, 0x94, 0x54, 0x25, 0x45, 0x9a, 0xe4, - 0xaa, 0x37, 0xd6, 0xd8, 0x3b, 0xf1, 0x8e, 0xba, 0x33, 0xb3, 0x78, 0xc6, 0x61, 0xf7, 0x21, 0x90, - 0x2a, 0x24, 0xc4, 0x3b, 0xf0, 0x02, 0xbc, 0x42, 0x2f, 0x7b, 0xc9, 0x15, 0x54, 0xc9, 0x83, 0x80, - 0x66, 0x3c, 0x76, 0x22, 0x58, 0x25, 0x37, 0x5c, 0x79, 0xce, 0x99, 0xef, 0x7c, 0xf3, 0xf9, 0xfc, - 0xc1, 0x30, 0x95, 0x8a, 0x4b, 0x15, 0xe9, 0x45, 0x74, 0xfe, 0x28, 0xa1, 0x9a, 0x3c, 0x8a, 0xf4, - 0x22, 0x9c, 0xe7, 0x52, 0x4b, 0x74, 0xaf, 0xbc, 0x0b, 0xf5, 0x22, 0x74, 0x77, 0xc3, 0xad, 0x4c, - 0x66, 0xd2, 0xde, 0x46, 0xe6, 0x54, 0x02, 0x87, 0xfb, 0x8e, 0x24, 0xcd, 0x97, 0x73, 0x2d, 0x23, - 0x5e, 0xcc, 0x34, 0x53, 0x2c, 0xab, 0x19, 0x2b, 0x87, 0x83, 0xfb, 0x0e, 0x9e, 0x10, 0x45, 0x6b, - 0x4c, 0x2a, 0x99, 0x70, 0xf7, 0x1f, 0x5f, 0x69, 0x52, 0x2c, 0x13, 0x4c, 0x5c, 0x31, 0x39, 0xdb, - 0x01, 0xb7, 0x33, 0x29, 0xb3, 0x19, 0x8d, 0xac, 0x95, 0x14, 0x67, 0x11, 0x11, 0xcb, 0xf2, 0x2a, - 0xf8, 0xc9, 0x83, 0xe6, 0xe9, 0x02, 0xed, 0x43, 0x3b, 0x91, 0x93, 0xe5, 0xc0, 0xdb, 0xf3, 0x46, - 0xeb, 0x07, 0xdb, 0xe1, 0x7f, 0xfe, 0x28, 0x3c, 0x5d, 0x8c, 0xe5, 0x64, 0x89, 0x2d, 0x0c, 0x7d, - 0x0a, 0x7d, 0x52, 0xe8, 0x69, 0xcc, 0xc4, 0x99, 0x1c, 0x34, 0x6d, 0xcc, 0xce, 0x8a, 0x98, 0xc3, - 0x42, 0x4f, 0x9f, 0x89, 0x33, 0x89, 0x7b, 0xc4, 0x9d, 0x90, 0x0f, 0x60, 0xb4, 0x11, 0x5d, 0xe4, - 0x54, 0x0d, 0x5a, 0x7b, 0xad, 0xd1, 0x06, 0xbe, 0xe6, 0x09, 0x04, 0x74, 0x4e, 0x17, 0x98, 0xfc, - 0x88, 0xee, 0x03, 0x98, 0xa7, 0xe2, 0x64, 0xa9, 0xa9, 0xb2, 0xba, 0x36, 0x70, 0xdf, 0x78, 0xc6, - 0xc6, 0x81, 0x3e, 0x82, 0xbb, 0xb5, 0x02, 0x87, 0x69, 0x5a, 0xcc, 0x66, 0xf5, 0x54, 0x89, 0xbb, - 0xed, 0xbd, 0x9f, 0x3d, 0x58, 0x3b, 0x61, 0x99, 0xf8, 0x5a, 0xa6, 0xff, 0xd7, 0x93, 0xdb, 0xd0, - 0x4b, 0xa7, 0x84, 0x89, 0x98, 0x4d, 0x06, 0xad, 0x3d, 0x6f, 0xd4, 0xc7, 0x6b, 0xd6, 0x7e, 0x36, - 0x41, 0x0f, 0xe0, 0x0e, 0x49, 0x53, 0x59, 0x08, 0x1d, 0x8b, 0x82, 0x27, 0x34, 0x1f, 0xb4, 0xf7, - 0xbc, 0x51, 0x1b, 0x6f, 0x3a, 0xef, 0x0b, 0xeb, 0x0c, 0x7e, 0x69, 0x42, 0xb7, 0xcc, 0x37, 0x7a, - 0x08, 0x3d, 0x4e, 0x95, 0x22, 0x99, 0x55, 0xd4, 0x1a, 0xad, 0x1f, 0x6c, 0x85, 0x65, 0x35, 0xc3, - 0xaa, 0x9a, 0xe1, 0xa1, 0x58, 0xe2, 0x1a, 0x85, 0x10, 0xb4, 0x39, 0xe5, 0x65, 0x59, 0xfa, 0xd8, - 0x9e, 0xcd, 0xbb, 0x9a, 0x71, 0x2a, 0x0b, 0x1d, 0x4f, 0x29, 0xcb, 0xa6, 0xda, 0x0a, 0x6b, 0xe3, - 0x4d, 0xe7, 0x3d, 0xb2, 0x4e, 0x34, 0x86, 0x7b, 0x74, 0xa1, 0xa9, 0x50, 0x4c, 0x8a, 0x58, 0xce, - 0x35, 0x93, 0x42, 0x0d, 0xfe, 0x5e, 0xbb, 0xe1, 0xd9, 0xf7, 0x6a, 0xfc, 0xf7, 0x25, 0x1c, 0xbd, - 0x04, 0x5f, 0x48, 0x11, 0xa7, 0x39, 0xd3, 0x2c, 0x25, 0xb3, 0x78, 0x05, 0xe1, 0xdd, 0x1b, 0x08, - 0x77, 0x84, 0x14, 0x4f, 0x5c, 0xec, 0x37, 0xff, 0xe2, 0x0e, 0xce, 0xa1, 0x57, 0xb5, 0x14, 0xfa, - 0x0a, 0x36, 0x4c, 0x19, 0x69, 0x6e, 0xeb, 0x51, 0x25, 0xe7, 0xfe, 0x8a, 0x2e, 0x3c, 0xb1, 0x30, - 0xdb, 0x87, 0xeb, 0xaa, 0x3e, 0x2b, 0x34, 0x82, 0xd6, 0x19, 0xa5, 0xae, 0x7d, 0xdf, 0x5f, 0x11, - 0xf8, 0x94, 0x52, 0x6c, 0x20, 0xc1, 0xaf, 0x1e, 0xc0, 0x15, 0x0b, 0x7a, 0x0c, 0x30, 0x2f, 0x92, - 0x19, 0x4b, 0xe3, 0x57, 0xb4, 0x1a, 0x99, 0xd5, 0x7f, 0xd3, 0x2f, 0x71, 0xcf, 0xa9, 0x1d, 0x19, - 0x2e, 0x27, 0xf4, 0xb6, 0x91, 0x39, 0x96, 0x13, 0x5a, 0x8e, 0x0c, 0x77, 0x27, 0x34, 0x84, 0x9e, - 0xa2, 0x3f, 0x14, 0x54, 0xa4, 0xd4, 0x95, 0xad, 0xb6, 0x83, 0x77, 0x4d, 0xe8, 0x55, 0x21, 0xe8, - 0x0b, 0xe8, 0x2a, 0x26, 0xb2, 0x19, 0x75, 0x9a, 0x82, 0x1b, 0xf8, 0xc3, 0x13, 0x8b, 0x3c, 0x6a, - 0x60, 0x17, 0x83, 0x3e, 0x83, 0x8e, 0xdd, 0x3f, 0x4e, 0xdc, 0x07, 0x37, 0x05, 0x1f, 0x1b, 0xe0, - 0x51, 0x03, 0x97, 0x11, 0xc3, 0x43, 0xe8, 0x96, 0x74, 0xe8, 0x13, 0x68, 0x1b, 0xdd, 0x56, 0xc0, - 0x9d, 0x83, 0x0f, 0xaf, 0x71, 0x54, 0x1b, 0xe9, 0x7a, 0x55, 0x0c, 0x1f, 0xb6, 0x01, 0xc3, 0xd7, - 0x1e, 0x74, 0x2c, 0x2b, 0x7a, 0x0e, 0xbd, 0x84, 0x69, 0x92, 0xe7, 0xa4, 0xca, 0x6d, 0x54, 0xd1, - 0x94, 0x7b, 0x33, 0xac, 0xd7, 0x64, 0xc5, 0xf5, 0x44, 0xf2, 0x39, 0x49, 0xf5, 0x98, 0xe9, 0x43, - 0x13, 0x86, 0x6b, 0x02, 0xf4, 0x39, 0x40, 0x9d, 0x75, 0x33, 0xae, 0xad, 0xdb, 0xd2, 0xde, 0xaf, - 0xd2, 0xae, 0xc6, 0x1d, 0x68, 0xa9, 0x82, 0x07, 0xbf, 0x7b, 0xd0, 0x7a, 0x4a, 0x29, 0x4a, 0xa1, - 0x4b, 0xb8, 0x19, 0x52, 0xd7, 0x6a, 0xf5, 0x92, 0x34, 0xeb, 0xf9, 0x9a, 0x14, 0x26, 0xc6, 0x0f, - 0xdf, 0xfc, 0xb9, 0xdb, 0xf8, 0xed, 0xaf, 0xdd, 0x51, 0xc6, 0xf4, 0xb4, 0x48, 0xc2, 0x54, 0xf2, - 0xa8, 0x5a, 0xfd, 0xf6, 0xb3, 0xaf, 0x26, 0xaf, 0x22, 0xbd, 0x9c, 0x53, 0x65, 0x03, 0x14, 0x76, - 0xd4, 0x68, 0x07, 0xfa, 0x19, 0x51, 0xf1, 0x8c, 0x71, 0xa6, 0x6d, 0x21, 0xda, 0xb8, 0x97, 0x11, - 0xf5, 0x9d, 0xb1, 0xd1, 0x16, 0x74, 0xe6, 0x64, 0x49, 0x73, 0xb7, 0x55, 0x4a, 0x03, 0x0d, 0x60, - 0x2d, 0xcb, 0x89, 0xd0, 0x6e, 0x99, 0xf4, 0x71, 0x65, 0x06, 0xdf, 0x02, 0x9c, 0xd0, 0xfc, 0x9c, - 0xa5, 0xf4, 0x58, 0x65, 0x68, 0x17, 0xd6, 0x39, 0xd5, 0x53, 0x39, 0x89, 0x05, 0xe1, 0x65, 0x85, - 0xfa, 0x18, 0x4a, 0xd7, 0x0b, 0xc2, 0xa9, 0x21, 0xca, 0x4d, 0x5f, 0x29, 0xed, 0xf6, 0x5a, 0x65, - 0x8e, 0xbf, 0x7c, 0x73, 0xe1, 0x7b, 0x6f, 0x2f, 0x7c, 0xef, 0xdd, 0x85, 0xef, 0xbd, 0xbe, 0xf4, - 0x1b, 0x6f, 0x2f, 0xfd, 0xc6, 0x1f, 0x97, 0x7e, 0xe3, 0xe5, 0x83, 0xdb, 0xff, 0x30, 0xd2, 0x8b, - 0xa4, 0x6b, 0xa7, 0xe2, 0xf1, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc3, 0xc0, 0x25, 0x15, 0x46, - 0x07, 0x00, 0x00, + 0x14, 0x5e, 0xef, 0x5f, 0xd6, 0x27, 0x49, 0x4b, 0x47, 0x11, 0xda, 0x6c, 0x54, 0x37, 0x18, 0x15, + 0xf6, 0x26, 0x76, 0x9b, 0x5e, 0xf0, 0x23, 0x24, 0xc8, 0x16, 0xaa, 0x54, 0xa5, 0x20, 0x4d, 0x72, + 0xd5, 0x1b, 0x6b, 0xec, 0x9d, 0x78, 0x47, 0x5d, 0xcf, 0x2c, 0x9e, 0x71, 0xb1, 0x1f, 0x02, 0xa9, + 0x42, 0x42, 0xbc, 0x03, 0x2f, 0xc0, 0x2b, 0xf4, 0xb2, 0x97, 0x5c, 0x41, 0x95, 0x3c, 0x08, 0x68, + 0xc6, 0x63, 0x27, 0x82, 0x55, 0x72, 0xc3, 0x95, 0xe7, 0x9c, 0xf9, 0xce, 0x37, 0x9f, 0xcf, 0x1f, + 0x4c, 0x12, 0x21, 0x33, 0x21, 0x43, 0x55, 0x86, 0xaf, 0x1e, 0xc6, 0x54, 0x91, 0x87, 0xa1, 0x2a, + 0x83, 0x55, 0x2e, 0x94, 0x40, 0x77, 0xea, 0xbb, 0x40, 0x95, 0x81, 0xbd, 0x9b, 0xec, 0xa4, 0x22, + 0x15, 0xe6, 0x36, 0xd4, 0xa7, 0x1a, 0x38, 0x39, 0xb0, 0x24, 0x49, 0x5e, 0xad, 0x94, 0x08, 0xb3, + 0x62, 0xa9, 0x98, 0x64, 0x69, 0xcb, 0xd8, 0x38, 0x2c, 0xdc, 0xb3, 0xf0, 0x98, 0x48, 0xda, 0x62, + 0x12, 0xc1, 0xb8, 0xbd, 0xff, 0xf8, 0x52, 0x93, 0x64, 0x29, 0x67, 0xfc, 0x92, 0xc9, 0xda, 0x16, + 0xb8, 0x9b, 0x0a, 0x91, 0x2e, 0x69, 0x68, 0xac, 0xb8, 0x38, 0x0b, 0x09, 0xaf, 0xea, 0x2b, 0xff, + 0x27, 0x07, 0xba, 0xa7, 0x25, 0x3a, 0x80, 0x7e, 0x2c, 0xe6, 0xd5, 0xd8, 0xd9, 0x77, 0xa6, 0x9b, + 0x87, 0xbb, 0xc1, 0x7f, 0xfe, 0x28, 0x38, 0x2d, 0x67, 0x62, 0x5e, 0x61, 0x03, 0x43, 0x9f, 0x82, + 0x4b, 0x0a, 0xb5, 0x88, 0x18, 0x3f, 0x13, 0xe3, 0xae, 0x89, 0xd9, 0x5b, 0x13, 0x73, 0x54, 0xa8, + 0xc5, 0x53, 0x7e, 0x26, 0xf0, 0x88, 0xd8, 0x13, 0xf2, 0x00, 0xb4, 0x36, 0xa2, 0x8a, 0x9c, 0xca, + 0x71, 0x6f, 0xbf, 0x37, 0xdd, 0xc2, 0x57, 0x3c, 0x3e, 0x87, 0xc1, 0x69, 0x89, 0xc9, 0x8f, 0xe8, + 0x2e, 0x80, 0x7e, 0x2a, 0x8a, 0x2b, 0x45, 0xa5, 0xd1, 0xb5, 0x85, 0x5d, 0xed, 0x99, 0x69, 0x07, + 0xfa, 0x08, 0x6e, 0xb7, 0x0a, 0x2c, 0xa6, 0x6b, 0x30, 0xdb, 0xcd, 0x53, 0x35, 0xee, 0xa6, 0xf7, + 0x7e, 0x76, 0x60, 0xe3, 0x84, 0xa5, 0xfc, 0x6b, 0x91, 0xfc, 0x5f, 0x4f, 0xee, 0xc2, 0x28, 0x59, + 0x10, 0xc6, 0x23, 0x36, 0x1f, 0xf7, 0xf6, 0x9d, 0xa9, 0x8b, 0x37, 0x8c, 0xfd, 0x74, 0x8e, 0xee, + 0xc3, 0x2d, 0x92, 0x24, 0xa2, 0xe0, 0x2a, 0xe2, 0x45, 0x16, 0xd3, 0x7c, 0xdc, 0xdf, 0x77, 0xa6, + 0x7d, 0xbc, 0x6d, 0xbd, 0xdf, 0x19, 0xa7, 0xff, 0x4b, 0x17, 0x86, 0x75, 0xbe, 0xd1, 0x03, 0x18, + 0x65, 0x54, 0x4a, 0x92, 0x1a, 0x45, 0xbd, 0xe9, 0xe6, 0xe1, 0x4e, 0x50, 0x57, 0x33, 0x68, 0xaa, + 0x19, 0x1c, 0xf1, 0x0a, 0xb7, 0x28, 0x84, 0xa0, 0x9f, 0xd1, 0xac, 0x2e, 0x8b, 0x8b, 0xcd, 0x59, + 0xbf, 0xab, 0x58, 0x46, 0x45, 0xa1, 0xa2, 0x05, 0x65, 0xe9, 0x42, 0x19, 0x61, 0x7d, 0xbc, 0x6d, + 0xbd, 0xc7, 0xc6, 0x89, 0x66, 0x70, 0x87, 0x96, 0x8a, 0x72, 0xc9, 0x04, 0x8f, 0xc4, 0x4a, 0x31, + 0xc1, 0xe5, 0xf8, 0xef, 0x8d, 0x6b, 0x9e, 0x7d, 0xaf, 0xc5, 0x7f, 0x5f, 0xc3, 0xd1, 0x0b, 0xf0, + 0xb8, 0xe0, 0x51, 0x92, 0x33, 0xc5, 0x12, 0xb2, 0x8c, 0xd6, 0x10, 0xde, 0xbe, 0x86, 0x70, 0x8f, + 0x0b, 0xfe, 0xd8, 0xc6, 0x7e, 0xf3, 0x2f, 0x6e, 0xff, 0x15, 0x8c, 0x9a, 0x96, 0x42, 0x5f, 0xc1, + 0x96, 0x2e, 0x23, 0xcd, 0x4d, 0x3d, 0x9a, 0xe4, 0xdc, 0x5d, 0xd3, 0x85, 0x27, 0x06, 0x66, 0xfa, + 0x70, 0x53, 0xb6, 0x67, 0x89, 0xa6, 0xd0, 0x3b, 0xa3, 0xd4, 0xb6, 0xef, 0xfb, 0x6b, 0x02, 0x9f, + 0x50, 0x8a, 0x35, 0xc4, 0xff, 0xd5, 0x01, 0xb8, 0x64, 0x41, 0x8f, 0x00, 0x56, 0x45, 0xbc, 0x64, + 0x49, 0xf4, 0x92, 0x36, 0x23, 0xb3, 0xfe, 0x6f, 0xdc, 0x1a, 0xf7, 0x8c, 0x9a, 0x91, 0xc9, 0xc4, + 0x9c, 0xde, 0x34, 0x32, 0xcf, 0xc5, 0x9c, 0xd6, 0x23, 0x93, 0xd9, 0x13, 0x9a, 0xc0, 0x48, 0xd2, + 0x1f, 0x0a, 0xca, 0x13, 0x6a, 0xcb, 0xd6, 0xda, 0xfe, 0xbb, 0x2e, 0x8c, 0x9a, 0x10, 0xf4, 0x05, + 0x0c, 0x25, 0xe3, 0xe9, 0x92, 0x5a, 0x4d, 0xfe, 0x35, 0xfc, 0xc1, 0x89, 0x41, 0x1e, 0x77, 0xb0, + 0x8d, 0x41, 0x9f, 0xc1, 0xc0, 0xec, 0x1f, 0x2b, 0xee, 0x83, 0xeb, 0x82, 0x9f, 0x6b, 0xe0, 0x71, + 0x07, 0xd7, 0x11, 0x93, 0x23, 0x18, 0xd6, 0x74, 0xe8, 0x13, 0xe8, 0x6b, 0xdd, 0x46, 0xc0, 0xad, + 0xc3, 0x0f, 0xaf, 0x70, 0x34, 0x1b, 0xe9, 0x6a, 0x55, 0x34, 0x1f, 0x36, 0x01, 0x93, 0xd7, 0x0e, + 0x0c, 0x0c, 0x2b, 0x7a, 0x06, 0xa3, 0x98, 0x29, 0x92, 0xe7, 0xa4, 0xc9, 0x6d, 0xd8, 0xd0, 0xd4, + 0x7b, 0x33, 0x68, 0xd7, 0x64, 0xc3, 0xf5, 0x58, 0x64, 0x2b, 0x92, 0xa8, 0x19, 0x53, 0x47, 0x3a, + 0x0c, 0xb7, 0x04, 0xe8, 0x73, 0x80, 0x36, 0xeb, 0x7a, 0x5c, 0x7b, 0x37, 0xa5, 0xdd, 0x6d, 0xd2, + 0x2e, 0x67, 0x03, 0xe8, 0xc9, 0x22, 0xf3, 0x7f, 0x77, 0xa0, 0xf7, 0x84, 0x52, 0x94, 0xc0, 0x90, + 0x64, 0x7a, 0x48, 0x6d, 0xab, 0xb5, 0x4b, 0x52, 0xaf, 0xe7, 0x2b, 0x52, 0x18, 0x9f, 0x3d, 0x78, + 0xf3, 0xe7, 0xbd, 0xce, 0x6f, 0x7f, 0xdd, 0x9b, 0xa6, 0x4c, 0x2d, 0x8a, 0x38, 0x48, 0x44, 0x16, + 0x36, 0xab, 0xdf, 0x7c, 0x0e, 0xe4, 0xfc, 0x65, 0xa8, 0xaa, 0x15, 0x95, 0x26, 0x40, 0x62, 0x4b, + 0x8d, 0xf6, 0xc0, 0x4d, 0x89, 0x8c, 0x96, 0x2c, 0x63, 0xca, 0x14, 0xa2, 0x8f, 0x47, 0x29, 0x91, + 0xdf, 0x6a, 0x1b, 0xed, 0xc0, 0x60, 0x45, 0x2a, 0x9a, 0xdb, 0xad, 0x52, 0x1b, 0x68, 0x0c, 0x1b, + 0x69, 0x4e, 0xb8, 0xb2, 0xcb, 0xc4, 0xc5, 0x8d, 0x39, 0xfb, 0xf2, 0xcd, 0xb9, 0xe7, 0xbc, 0x3d, + 0xf7, 0x9c, 0x77, 0xe7, 0x9e, 0xf3, 0xfa, 0xc2, 0xeb, 0xbc, 0xbd, 0xf0, 0x3a, 0x7f, 0x5c, 0x78, + 0x9d, 0x17, 0xf7, 0x6f, 0x16, 0x16, 0xaa, 0x32, 0x1e, 0x9a, 0x66, 0x7e, 0xf4, 0x4f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xd4, 0xb7, 0x75, 0x7d, 0xfd, 0x06, 0x00, 0x00, } func (m *Tx) Marshal() (dAtA []byte, err error) { @@ -1419,43 +1356,6 @@ func (m *Fee) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ServiceMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ServiceMsg) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Request) > 0 { - i -= len(m.Request) - copy(dAtA[i:], m.Request) - i = encodeVarintTx(dAtA, i, uint64(len(m.Request))) - i-- - dAtA[i] = 0x12 - } - if len(m.MethodName) > 0 { - i -= len(m.MethodName) - copy(dAtA[i:], m.MethodName) - i = encodeVarintTx(dAtA, i, uint64(len(m.MethodName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1703,23 +1603,6 @@ func (m *Fee) Size() (n int) { return n } -func (m *ServiceMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MethodName) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Request) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3169,125 +3052,6 @@ func (m *Fee) Unmarshal(dAtA []byte) error { } return nil } -func (m *ServiceMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ServiceMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MethodName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MethodName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Request = append(m.Request[:0], dAtA[iNdEx:postIndex]...) - if m.Request == nil { - m.Request = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/types/tx/types.go b/types/tx/types.go index a1261d62795b..2b15c751c230 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -27,7 +27,15 @@ func (t *Tx) GetMsgs() []sdk.Msg { anys := t.Body.Messages res := make([]sdk.Msg, len(anys)) for i, any := range anys { - msg := any.GetCachedValue().(sdk.Msg) + var msg sdk.Msg + if IsServiceMsg(any.TypeUrl) { + msg = sdk.ServiceMsg{ + MethodName: any.TypeUrl, + Request: any.GetCachedValue().(sdk.MsgRequest), + } + } else { + msg = any.GetCachedValue().(sdk.Msg) + } res[i] = msg } return res @@ -141,15 +149,12 @@ func (m *TxBody) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, any := range m.Messages { // If the any's typeUrl contains 2 slashes, then we unpack the any into // a ServiceMsg struct as per ADR-031. - if nSlashes := len(strings.Split("/", any.TypeUrl)) - 1; nSlashes >= 2 { - var serviceMsg ServiceMsg - req, err := unpacker.UnpackServiceMethodRequest(any) + if IsServiceMsg(any.TypeUrl) { + var req sdk.MsgRequest + err := unpacker.UnpackAny(any, &req) if err != nil { return err } - msgReq, ok := req.(MsgRequest) - serviceMsg.MethodName = any.TypeUrl - serviceMsg.Request = msgReq } else { var msg sdk.Msg err := unpacker.UnpackAny(any, &msg) @@ -183,3 +188,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterInterface("cosmos.tx.v1beta1.Tx", (*sdk.Tx)(nil)) registry.RegisterImplementations((*sdk.Tx)(nil), &Tx{}) } + +func IsServiceMsg(typeUrl string) bool { + return strings.Count(typeUrl, "/") >= 2 +} diff --git a/x/auth/tx/builder.go b/x/auth/tx/builder.go index 22e4f4742232..b3697e70b262 100644 --- a/x/auth/tx/builder.go +++ b/x/auth/tx/builder.go @@ -206,11 +206,15 @@ func (w *wrapper) SetMsgs(msgs ...sdk.Msg) error { for i, msg := range msgs { var err error switch msg := msg.(type) { - case tx.ServiceMsg: + case sdk.ServiceMsg: { + bz, err := proto.Marshal(msg.Request) + if err != nil { + return err + } anys[i] = &codectypes.Any{ TypeUrl: msg.MethodName, - Value: msg.Request, + Value: bz, } } default: diff --git a/x/auth/tx/config.go b/x/auth/tx/config.go index 5b6fc5abf618..b7ca179a84f3 100644 --- a/x/auth/tx/config.go +++ b/x/auth/tx/config.go @@ -29,7 +29,7 @@ func NewTxConfig(protoCodec *codec.ProtoCodec, enabledSignModes []signingtypes.S decoder: DefaultTxDecoder(protoCodec), encoder: DefaultTxEncoder(), jsonDecoder: DefaultJSONTxDecoder(protoCodec), - jsonEncoder: DefaultJSONTxEncoder(), + jsonEncoder: DefaultJSONTxEncoder(protoCodec), protoCodec: protoCodec, } } diff --git a/x/auth/tx/decoder.go b/x/auth/tx/decoder.go index 76129a3a1f2c..59ba8467ebde 100644 --- a/x/auth/tx/decoder.go +++ b/x/auth/tx/decoder.go @@ -14,7 +14,7 @@ func DefaultTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { var raw tx.TxRaw // reject all unknown proto fields in the root TxRaw - err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw) + err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw, cdc.InterfaceRegistry()) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, err.Error()) } @@ -27,7 +27,7 @@ func DefaultTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { var body tx.TxBody // allow non-critical unknown fields in TxBody - txBodyHasUnknownNonCriticals, err := unknownproto.RejectUnknownFields(raw.BodyBytes, &body, true) + txBodyHasUnknownNonCriticals, err := unknownproto.RejectUnknownFields(raw.BodyBytes, &body, true, cdc.InterfaceRegistry()) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, err.Error()) } @@ -40,7 +40,7 @@ func DefaultTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { var authInfo tx.AuthInfo // reject all unknown proto fields in AuthInfo - err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo) + err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo, cdc.InterfaceRegistry()) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, err.Error()) } diff --git a/x/auth/tx/encoder.go b/x/auth/tx/encoder.go index f8889cb62fab..5655df7686d7 100644 --- a/x/auth/tx/encoder.go +++ b/x/auth/tx/encoder.go @@ -29,16 +29,16 @@ func DefaultTxEncoder() sdk.TxEncoder { } // DefaultJSONTxEncoder returns a default protobuf JSON TxEncoder using the provided Marshaler. -func DefaultJSONTxEncoder() sdk.TxEncoder { +func DefaultJSONTxEncoder(cdc *codec.ProtoCodec) sdk.TxEncoder { return func(tx sdk.Tx) ([]byte, error) { txWrapper, ok := tx.(*wrapper) if ok { - return codec.ProtoMarshalJSON(txWrapper.tx) + return cdc.MarshalJSON(txWrapper.tx) } protoTx, ok := tx.(*txtypes.Tx) if ok { - return codec.ProtoMarshalJSON(protoTx) + return cdc.MarshalJSON(protoTx) } return nil, fmt.Errorf("expected %T, got %T", &wrapper{}, tx) diff --git a/x/auth/tx/sigs.go b/x/auth/tx/sigs.go index 0f58ace4ffef..d0e43ede7526 100644 --- a/x/auth/tx/sigs.go +++ b/x/auth/tx/sigs.go @@ -125,7 +125,7 @@ func (g config) MarshalSignatureJSON(sigs []signing.SignatureV2) ([]byte, error) toJSON := &signing.SignatureDescriptors{Signatures: descs} - return codec.ProtoMarshalJSON(toJSON) + return codec.ProtoMarshalJSON(toJSON, nil) } func (g config) UnmarshalSignatureJSON(bz []byte) ([]signing.SignatureV2, error) { From 687fc0995f64944216b7cd1f05e9a5c911ae3385 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 15:41:49 -0400 Subject: [PATCH 26/51] Fix tests --- codec/unknownproto/benchmarks_test.go | 4 ++-- codec/unknownproto/unknown_fields.go | 18 ++++++++++++++++++ codec/unknownproto/unknown_fields_test.go | 10 +++++----- simapp/app.go | 1 + std/codec.go | 3 --- x/auth/ante/testutil_test.go | 3 ++- x/auth/client/tx_test.go | 2 +- x/auth/vesting/types/codec.go | 2 ++ 8 files changed, 31 insertions(+), 12 deletions(-) diff --git a/codec/unknownproto/benchmarks_test.go b/codec/unknownproto/benchmarks_test.go index e2c4b2c19655..373dda7acfd5 100644 --- a/codec/unknownproto/benchmarks_test.go +++ b/codec/unknownproto/benchmarks_test.go @@ -56,7 +56,7 @@ func benchmarkRejectUnknownFields(b *testing.B, parallel bool) { b.ResetTimer() for i := 0; i < b.N; i++ { n1A := new(testdata.Nested1A) - if err := unknownproto.RejectUnknownFieldsStrict(n1BBlob, n1A); err == nil { + if err := unknownproto.RejectUnknownFieldsStrict(n1BBlob, n1A, unknownproto.DefaultAnyResolver{}); err == nil { b.Fatal("expected an error") } b.SetBytes(int64(len(n1BBlob))) @@ -68,7 +68,7 @@ func benchmarkRejectUnknownFields(b *testing.B, parallel bool) { for pb.Next() { // To simulate the conditions of multiple transactions being processed in parallel. n1A := new(testdata.Nested1A) - if err := unknownproto.RejectUnknownFieldsStrict(n1BBlob, n1A); err == nil { + if err := unknownproto.RejectUnknownFieldsStrict(n1BBlob, n1A, unknownproto.DefaultAnyResolver{}); err == nil { b.Fatal("expected an error") } mu.Lock() diff --git a/codec/unknownproto/unknown_fields.go b/codec/unknownproto/unknown_fields.go index d60ca42ec5d5..a839581eaa1d 100644 --- a/codec/unknownproto/unknown_fields.go +++ b/codec/unknownproto/unknown_fields.go @@ -7,6 +7,7 @@ import ( "fmt" "io/ioutil" "reflect" + "strings" "sync" "github.com/gogo/protobuf/jsonpb" @@ -408,3 +409,20 @@ func getDescriptorInfo(desc descriptorIface, msg proto.Message) (map[int32]*desc return tagNumToTypeIndex, md, nil } + +type DefaultAnyResolver struct{} + +var _ jsonpb.AnyResolver = DefaultAnyResolver{} + +func (d DefaultAnyResolver) Resolve(typeUrl string) (proto.Message, error) { + // Only the part of typeUrl after the last slash is relevant. + mname := typeUrl + if slash := strings.LastIndex(mname, "/"); slash >= 0 { + mname = mname[slash+1:] + } + mt := proto.MessageType(mname) + if mt == nil { + return nil, fmt.Errorf("unknown message type %q", mname) + } + return reflect.New(mt.Elem()).Interface().(proto.Message), nil +} diff --git a/codec/unknownproto/unknown_fields_test.go b/codec/unknownproto/unknown_fields_test.go index 937e8654d5a2..ad3926cedb55 100644 --- a/codec/unknownproto/unknown_fields_test.go +++ b/codec/unknownproto/unknown_fields_test.go @@ -230,7 +230,7 @@ func TestRejectUnknownFieldsRepeated(t *testing.T) { if err != nil { t.Fatal(err) } - hasUnknownNonCriticals, gotErr := RejectUnknownFields(protoBlob, tt.recv, tt.allowUnknownNonCriticals) + hasUnknownNonCriticals, gotErr := RejectUnknownFields(protoBlob, tt.recv, tt.allowUnknownNonCriticals, DefaultAnyResolver{}) require.Equal(t, tt.wantErr, gotErr) require.Equal(t, tt.hasUnknownNonCriticals, hasUnknownNonCriticals) }) @@ -289,7 +289,7 @@ func TestRejectUnknownFields_allowUnknownNonCriticals(t *testing.T) { } c1 := new(testdata.Customer1) - _, gotErr := RejectUnknownFields(blob, c1, tt.allowUnknownNonCriticals) + _, gotErr := RejectUnknownFields(blob, c1, tt.allowUnknownNonCriticals, DefaultAnyResolver{}) if !reflect.DeepEqual(gotErr, tt.wantErr) { t.Fatalf("Error mismatch\nGot:\n%s\n\nWant:\n%s", gotErr, tt.wantErr) } @@ -490,7 +490,7 @@ func TestRejectUnknownFieldsNested(t *testing.T) { if err != nil { t.Fatal(err) } - gotErr := RejectUnknownFieldsStrict(protoBlob, tt.recv) + gotErr := RejectUnknownFieldsStrict(protoBlob, tt.recv, DefaultAnyResolver{}) if !reflect.DeepEqual(gotErr, tt.wantErr) { t.Fatalf("Error mismatch\nGot:\n%s\n\nWant:\n%s", gotErr, tt.wantErr) } @@ -643,7 +643,7 @@ func TestRejectUnknownFieldsFlat(t *testing.T) { } c1 := new(testdata.Customer1) - gotErr := RejectUnknownFieldsStrict(blob, c1) + gotErr := RejectUnknownFieldsStrict(blob, c1, DefaultAnyResolver{}) if !reflect.DeepEqual(gotErr, tt.wantErr) { t.Fatalf("Error mismatch\nGot:\n%s\n\nWant:\n%s", gotErr, tt.wantErr) } @@ -660,7 +660,7 @@ func TestPackedEncoding(t *testing.T) { require.NoError(t, err) unmarshalled := &testdata.TestRepeatedUints{} - _, err = RejectUnknownFields(marshalled, unmarshalled, false) + _, err = RejectUnknownFields(marshalled, unmarshalled, false, DefaultAnyResolver{}) require.NoError(t, err) } diff --git a/simapp/app.go b/simapp/app.go index e9e9c4ac4df2..aa1375ea7a74 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -114,6 +114,7 @@ var ( upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, + vesting.AppModuleBasic{}, ) // module account permissions diff --git a/std/codec.go b/std/codec.go index 7cd633b41231..7310d75a25fd 100644 --- a/std/codec.go +++ b/std/codec.go @@ -6,14 +6,12 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" txtypes "github.com/cosmos/cosmos-sdk/types/tx" - vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) // RegisterLegacyAminoCodec registers types with the Amino codec. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { sdk.RegisterLegacyAminoCodec(cdc) cryptocodec.RegisterCrypto(cdc) - vesting.RegisterLegacyAminoCodec(cdc) } // RegisterInterfaces registers Interfaces from sdk/types, vesting, crypto, tx. @@ -21,5 +19,4 @@ func RegisterInterfaces(interfaceRegistry types.InterfaceRegistry) { sdk.RegisterInterfaces(interfaceRegistry) txtypes.RegisterInterfaces(interfaceRegistry) cryptocodec.RegisterInterfaces(interfaceRegistry) - vesting.RegisterInterfaces(interfaceRegistry) } diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 5ab35b7f19a5..63a2b308a53c 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -54,8 +54,9 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { // Set up TxConfig. encodingConfig := simapp.MakeEncodingConfig() - // We're using TestMsg amino encoding in some tests, so register it here. + // We're using TestMsg encoding in some tests, so register it here. encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) + encodingConfig.InterfaceRegistry.RegisterImplementations((*sdk.Msg)(nil), &testdata.TestMsg{}) suite.clientCtx = client.Context{}. WithTxConfig(encodingConfig.TxConfig) diff --git a/x/auth/client/tx_test.go b/x/auth/client/tx_test.go index 66371fdc290c..7ab1597bc8e6 100644 --- a/x/auth/client/tx_test.go +++ b/x/auth/client/tx_test.go @@ -31,7 +31,7 @@ func TestParseQueryResponse(t *testing.T) { Result: &sdk.Result{Data: []byte("tx data"), Log: "log"}, } - bz, err := codec.ProtoMarshalJSON(simRes) + bz, err := codec.ProtoMarshalJSON(simRes, nil) require.NoError(t, err) res, err := authclient.ParseQueryResponse(bz) diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index 8abf56cd6bd5..f5652ea017e1 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -31,6 +31,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*authtypes.AccountI)(nil), + &BaseVestingAccount{}, &DelayedVestingAccount{}, &ContinuousVestingAccount{}, &PeriodicVestingAccount{}, @@ -38,6 +39,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*authtypes.GenesisAccount)(nil), + &BaseVestingAccount{}, &DelayedVestingAccount{}, &ContinuousVestingAccount{}, &PeriodicVestingAccount{}, From b6bec3a75530767bbe206cd4fd8033e849a37d3e Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 15:56:48 -0400 Subject: [PATCH 27/51] Tidying up --- baseapp/baseapp.go | 3 +-- baseapp/msg_service_router.go | 2 +- {simapp => baseapp}/msg_service_test.go | 7 ++++--- baseapp/options.go | 3 +-- codec/types/interface_registry.go | 8 ++++++++ codec/unknownproto/unknown_fields.go | 6 +++++- testutil/testdata/msg_server.go | 6 +++--- types/{msg_service.go => service_msg.go} | 2 +- types/tx/types.go | 8 +++++--- 9 files changed, 29 insertions(+), 16 deletions(-) rename {simapp => baseapp}/msg_service_test.go (97%) rename types/{msg_service.go => service_msg.go} (98%) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 9b2e956ac46b..ea58b5ec090f 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -6,8 +6,6 @@ import ( "reflect" "strings" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/gogo/protobuf/proto" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/tmhash" @@ -15,6 +13,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" "github.com/cosmos/cosmos-sdk/store/rootmulti" diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 530a38d0af70..209c5d608a6e 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -32,7 +32,7 @@ func NewMsgServiceRouter() *MsgServiceRouter { // MsgServiceHandler defines a function type which handles Msg service message. type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) -// Route returns the MsgServiceHandler for a given query route path or nil +// Handler returns the MsgServiceHandler for a given query route path or nil // if not found. func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { handler, found := msr.routes[methodName] diff --git a/simapp/msg_service_test.go b/baseapp/msg_service_test.go similarity index 97% rename from simapp/msg_service_test.go rename to baseapp/msg_service_test.go index d02957ddea4a..f0f9be57b43f 100644 --- a/simapp/msg_service_test.go +++ b/baseapp/msg_service_test.go @@ -1,9 +1,11 @@ -package simapp_test +package baseapp_test import ( "os" "testing" + "github.com/cosmos/cosmos-sdk/baseapp" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" @@ -11,7 +13,6 @@ import ( "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -27,7 +28,7 @@ func TestMsgService(t *testing.T) { app.SetInterfaceRegistry(encCfg.InterfaceRegistry) testdata.RegisterMsgServer( app.MsgServiceRouter(), - testdata.MsgImpl{}, + testdata.MsgServerImpl{}, ) _ = app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 1}}) diff --git a/baseapp/options.go b/baseapp/options.go index 482863e1a128..e50e333159b1 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -4,10 +4,9 @@ import ( "fmt" "io" - "github.com/cosmos/cosmos-sdk/codec/types" - dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index 3b17309f05b7..c52e6253ec50 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -46,6 +46,14 @@ type InterfaceRegistry interface { // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) RegisterImplementations(iface interface{}, impls ...proto.Message) + // RegisterServiceRequestType allows a protobuf service method request type to be + // registered as the google.protobuf.Any value type for type URLs corresponding + // to the fully qualified method name. iface should be an interface as type + // as in RegisterInterface and RegisterImplementations. + // + // This will allow us to pack service methods in Any's using the full method name + // as the type URL and the request body as the value, and allow us to unpack + // such packed methods using the normal UnpackAny method for the interface iface. RegisterServiceRequestType(iface interface{}, methodName string, request proto.Message) // ListAllInterfaces list the type URLs of all registered interfaces. diff --git a/codec/unknownproto/unknown_fields.go b/codec/unknownproto/unknown_fields.go index a839581eaa1d..194fc3e766a0 100644 --- a/codec/unknownproto/unknown_fields.go +++ b/codec/unknownproto/unknown_fields.go @@ -11,7 +11,6 @@ import ( "sync" "github.com/gogo/protobuf/jsonpb" - "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" "google.golang.org/protobuf/encoding/protowire" @@ -27,6 +26,7 @@ type descriptorIface interface { // RejectUnknownFieldsStrict rejects any bytes bz with an error that has unknown fields for the provided proto.Message type. // This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. +// An AnyResolver must be provided for traversing inside google.protobuf.Any's. func RejectUnknownFieldsStrict(bz []byte, msg proto.Message, resolver jsonpb.AnyResolver) error { _, err := RejectUnknownFields(bz, msg, false, resolver) return err @@ -37,6 +37,7 @@ func RejectUnknownFieldsStrict(bz []byte, msg proto.Message, resolver jsonpb.Any // hasUnknownNonCriticals will be set to true if non-critical fields were encountered during traversal. This flag can be // used to treat a message with non-critical field different in different security contexts (such as transaction signing). // This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. +// An AnyResolver must be provided for traversing inside google.protobuf.Any's. func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals bool, resolver jsonpb.AnyResolver) (hasUnknownNonCriticals bool, err error) { if len(bz) == 0 { return hasUnknownNonCriticals, nil @@ -410,10 +411,13 @@ func getDescriptorInfo(desc descriptorIface, msg proto.Message) (map[int32]*desc return tagNumToTypeIndex, md, nil } +// DefaultAnyResolver is a default implementation of AnyResolver which uses +// the default encoding of type URLs as specified by the protobuf specification. type DefaultAnyResolver struct{} var _ jsonpb.AnyResolver = DefaultAnyResolver{} +// Resolve is the AnyResolver.Resolve method. func (d DefaultAnyResolver) Resolve(typeUrl string) (proto.Message, error) { // Only the part of typeUrl after the last slash is relevant. mname := typeUrl diff --git a/testutil/testdata/msg_server.go b/testutil/testdata/msg_server.go index d476445c569b..3b434c68c86c 100644 --- a/testutil/testdata/msg_server.go +++ b/testutil/testdata/msg_server.go @@ -4,12 +4,12 @@ import ( "context" ) -type MsgImpl struct{} +type MsgServerImpl struct{} -var _ MsgServer = MsgImpl{} +var _ MsgServer = MsgServerImpl{} // CreateDog implements the MsgServer interface. -func (m MsgImpl) CreateDog(_ context.Context, msg *MsgCreateDog) (*MsgCreateDogResponse, error) { +func (m MsgServerImpl) CreateDog(_ context.Context, msg *MsgCreateDog) (*MsgCreateDogResponse, error) { return &MsgCreateDogResponse{ Name: msg.Dog.Name, }, nil diff --git a/types/msg_service.go b/types/service_msg.go similarity index 98% rename from types/msg_service.go rename to types/service_msg.go index a4f5a9c04ae7..61c0f15ab12a 100644 --- a/types/msg_service.go +++ b/types/service_msg.go @@ -54,5 +54,5 @@ func (msg ServiceMsg) GetSigners() []AccAddress { // Type implements Msg.Type method. func (msg ServiceMsg) Type() string { - return "timeout_packet" + return msg.MethodName } diff --git a/types/tx/types.go b/types/tx/types.go index 2b15c751c230..f67841660580 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -28,7 +28,7 @@ func (t *Tx) GetMsgs() []sdk.Msg { res := make([]sdk.Msg, len(anys)) for i, any := range anys { var msg sdk.Msg - if IsServiceMsg(any.TypeUrl) { + if isServiceMsg(any.TypeUrl) { msg = sdk.ServiceMsg{ MethodName: any.TypeUrl, Request: any.GetCachedValue().(sdk.MsgRequest), @@ -149,7 +149,7 @@ func (m *TxBody) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, any := range m.Messages { // If the any's typeUrl contains 2 slashes, then we unpack the any into // a ServiceMsg struct as per ADR-031. - if IsServiceMsg(any.TypeUrl) { + if isServiceMsg(any.TypeUrl) { var req sdk.MsgRequest err := unpacker.UnpackAny(any, &req) if err != nil { @@ -189,6 +189,8 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Tx)(nil), &Tx{}) } -func IsServiceMsg(typeUrl string) bool { +// isServiceMsg checks if a type URL corresponds to a service method name, +// i.e. /cosmos.bank.Msg/Send vs /cosmos.bank.MsgSend +func isServiceMsg(typeUrl string) bool { return strings.Count(typeUrl, "/") >= 2 } From d89f2f662da77689077300c78554391fa3dcccac Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:01:22 -0400 Subject: [PATCH 28/51] Tidying up --- baseapp/baseapp.go | 9 ++++++--- baseapp/msg_server.go | 4 ---- baseapp/options.go | 2 +- ...ervice_router.go => service_msg_router.go} | 19 +++++++++---------- ...service_test.go => svc_msg_router_test.go} | 2 +- 5 files changed, 17 insertions(+), 19 deletions(-) delete mode 100644 baseapp/msg_server.go rename baseapp/{msg_service_router.go => service_msg_router.go} (86%) rename baseapp/{msg_service_test.go => svc_msg_router_test.go} (98%) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index ea58b5ec090f..ef3e80c13e88 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -54,7 +54,7 @@ type BaseApp struct { // nolint: maligned router sdk.Router // handle any kind of message queryRouter sdk.QueryRouter // router for redirecting query calls grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls - msgServiceRouter *MsgServiceRouter // router for redirecting Msg service messages + serviceMsgRouter *ServiceMsgRouter // router for redirecting Msg service messages interfaceRegistry types.InterfaceRegistry txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx @@ -147,7 +147,7 @@ func NewBaseApp( router: NewRouter(), queryRouter: NewQueryRouter(), grpcQueryRouter: NewGRPCQueryRouter(), - msgServiceRouter: NewMsgServiceRouter(), + serviceMsgRouter: NewMsgServiceRouter(), txDecoder: txDecoder, fauxMerkleMode: false, } @@ -180,6 +180,9 @@ func (app *BaseApp) Logger() log.Logger { return app.logger } +// ServiceMsgRouter returns the ServiceMsgRouter of a BaseApp. +func (app *BaseApp) ServiceMsgRouter() *ServiceMsgRouter { return app.serviceMsgRouter } + // MountStores mounts all IAVL or DB stores to the provided keys in the BaseApp // multistore. func (app *BaseApp) MountStores(keys ...sdk.StoreKey) { @@ -693,7 +696,7 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s if svcMsg, ok := msg.(sdk.ServiceMsg); ok { msgType = svcMsg.MethodName - handler := app.msgServiceRouter.Handler(msgType) + handler := app.serviceMsgRouter.Handler(msgType) if handler == nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message service method: %s; message index: %d", msgType, i) } diff --git a/baseapp/msg_server.go b/baseapp/msg_server.go deleted file mode 100644 index 0baa0aa7a61c..000000000000 --- a/baseapp/msg_server.go +++ /dev/null @@ -1,4 +0,0 @@ -package baseapp - -// MsgServiceRouter returns the MsgServiceRouter of a BaseApp. -func (app *BaseApp) MsgServiceRouter() *MsgServiceRouter { return app.msgServiceRouter } diff --git a/baseapp/options.go b/baseapp/options.go index e50e333159b1..18cc3e28d7c9 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -226,5 +226,5 @@ func (app *BaseApp) SetSnapshotKeepRecent(snapshotKeepRecent uint32) { func (app *BaseApp) SetInterfaceRegistry(registry types.InterfaceRegistry) { app.interfaceRegistry = registry app.grpcQueryRouter.SetInterfaceRegistry(registry) - app.msgServiceRouter.SetInterfaceRegistry(registry) + app.serviceMsgRouter.SetInterfaceRegistry(registry) } diff --git a/baseapp/msg_service_router.go b/baseapp/service_msg_router.go similarity index 86% rename from baseapp/msg_service_router.go rename to baseapp/service_msg_router.go index 209c5d608a6e..ec74df9aa531 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/service_msg_router.go @@ -13,18 +13,17 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// MsgServiceRouter routes Msg Service fully-qualified service methods to their -// handler. -type MsgServiceRouter struct { +// ServiceMsgRouter routes fully-qualified Msg service methods to their handler. +type ServiceMsgRouter struct { interfaceRegistry codectypes.InterfaceRegistry routes map[string]MsgServiceHandler } -var _ gogogrpc.Server = &MsgServiceRouter{} +var _ gogogrpc.Server = &ServiceMsgRouter{} -// NewMsgServiceRouter creates a new MsgServiceRouter. -func NewMsgServiceRouter() *MsgServiceRouter { - return &MsgServiceRouter{ +// NewMsgServiceRouter creates a new ServiceMsgRouter. +func NewMsgServiceRouter() *ServiceMsgRouter { + return &ServiceMsgRouter{ routes: map[string]MsgServiceHandler{}, } } @@ -34,7 +33,7 @@ type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, // Handler returns the MsgServiceHandler for a given query route path or nil // if not found. -func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { +func (msr *ServiceMsgRouter) Handler(methodName string) MsgServiceHandler { handler, found := msr.routes[methodName] if !found { return nil @@ -45,7 +44,7 @@ func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { // RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC // service description, handler is an object which implements that gRPC service. -func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { +func (msr *ServiceMsgRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { // adds a top-level query handler based on the gRPC service name for _, method := range sd.Methods { fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) @@ -94,6 +93,6 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter } // SetInterfaceRegistry sets the interface registry for the router. -func (msr *MsgServiceRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) { +func (msr *ServiceMsgRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) { msr.interfaceRegistry = interfaceRegistry } diff --git a/baseapp/msg_service_test.go b/baseapp/svc_msg_router_test.go similarity index 98% rename from baseapp/msg_service_test.go rename to baseapp/svc_msg_router_test.go index f0f9be57b43f..5501dc56d758 100644 --- a/baseapp/msg_service_test.go +++ b/baseapp/svc_msg_router_test.go @@ -27,7 +27,7 @@ func TestMsgService(t *testing.T) { app := baseapp.NewBaseApp("test", log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, encCfg.TxConfig.TxDecoder()) app.SetInterfaceRegistry(encCfg.InterfaceRegistry) testdata.RegisterMsgServer( - app.MsgServiceRouter(), + app.ServiceMsgRouter(), testdata.MsgServerImpl{}, ) _ = app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 1}}) From 82e252100e3b03c3dd3557f7b30c7749e6a09931 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:03:05 -0400 Subject: [PATCH 29/51] Tidying up --- baseapp/baseapp.go | 2 +- baseapp/options.go | 1 + baseapp/service_msg_router.go | 4 ++-- .../{svc_msg_router_test.go => service_msg_router_test.go} | 0 4 files changed, 4 insertions(+), 3 deletions(-) rename baseapp/{svc_msg_router_test.go => service_msg_router_test.go} (100%) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index ef3e80c13e88..18702922333a 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -147,7 +147,7 @@ func NewBaseApp( router: NewRouter(), queryRouter: NewQueryRouter(), grpcQueryRouter: NewGRPCQueryRouter(), - serviceMsgRouter: NewMsgServiceRouter(), + serviceMsgRouter: NewServiceMsgRouter(), txDecoder: txDecoder, fauxMerkleMode: false, } diff --git a/baseapp/options.go b/baseapp/options.go index 18cc3e28d7c9..c5f0b91652d6 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -223,6 +223,7 @@ func (app *BaseApp) SetSnapshotKeepRecent(snapshotKeepRecent uint32) { app.snapshotKeepRecent = snapshotKeepRecent } +// SetInterfaceRegistry sets the InterfaceRegistry. func (app *BaseApp) SetInterfaceRegistry(registry types.InterfaceRegistry) { app.interfaceRegistry = registry app.grpcQueryRouter.SetInterfaceRegistry(registry) diff --git a/baseapp/service_msg_router.go b/baseapp/service_msg_router.go index ec74df9aa531..f8afa172f4cd 100644 --- a/baseapp/service_msg_router.go +++ b/baseapp/service_msg_router.go @@ -21,8 +21,8 @@ type ServiceMsgRouter struct { var _ gogogrpc.Server = &ServiceMsgRouter{} -// NewMsgServiceRouter creates a new ServiceMsgRouter. -func NewMsgServiceRouter() *ServiceMsgRouter { +// NewServiceMsgRouter creates a new ServiceMsgRouter. +func NewServiceMsgRouter() *ServiceMsgRouter { return &ServiceMsgRouter{ routes: map[string]MsgServiceHandler{}, } diff --git a/baseapp/svc_msg_router_test.go b/baseapp/service_msg_router_test.go similarity index 100% rename from baseapp/svc_msg_router_test.go rename to baseapp/service_msg_router_test.go From 42f59ff75da77582e6194cc82c4263542a4c3a86 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:17:23 -0400 Subject: [PATCH 30/51] Add JSON test --- codec/types/types_test.go | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/codec/types/types_test.go b/codec/types/types_test.go index 0a14ed3e619f..a000c6960f7d 100644 --- a/codec/types/types_test.go +++ b/codec/types/types_test.go @@ -1,9 +1,17 @@ package types_test import ( + "context" + "fmt" "strings" "testing" + "github.com/gogo/protobuf/grpc" + "github.com/gogo/protobuf/proto" + grpc2 "google.golang.org/grpc" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/gogo/protobuf/jsonpb" "github.com/cosmos/cosmos-sdk/codec/types" @@ -153,3 +161,55 @@ func TestAny_ProtoJSON(t *testing.T) { require.NoError(t, err) require.Equal(t, spot, ha2.Animal.GetCachedValue()) } + +type testAnyPackClient struct { + any types.Any + interfaceRegistry types.InterfaceRegistry +} + +var _ grpc.ClientConn = &testAnyPackClient{} + +func (t *testAnyPackClient) Invoke(_ context.Context, method string, args, _ interface{}, _ ...grpc2.CallOption) error { + reqMsg, ok := args.(proto.Message) + if !ok { + return fmt.Errorf("can't proto marshal %T", args) + } + + t.interfaceRegistry.RegisterServiceRequestType((*interface{})(nil), method, reqMsg) + + bz, err := proto.Marshal(reqMsg) + if err != nil { + return err + } + + t.any.TypeUrl = method + t.any.Value = bz + + return nil +} + +func (t *testAnyPackClient) NewStream(context.Context, *grpc2.StreamDesc, string, ...grpc2.CallOption) (grpc2.ClientStream, error) { + return nil, fmt.Errorf("not supported") +} + +func TestAny_ServiceRequestProtoJSON(t *testing.T) { + interfaceRegistry := types.NewInterfaceRegistry() + anyPacker := &testAnyPackClient{interfaceRegistry: interfaceRegistry} + dogMsgClient := testdata.NewMsgClient(anyPacker) + _, err := dogMsgClient.CreateDog(context.Background(), &testdata.MsgCreateDog{Dog: &testdata.Dog{ + Name: "spot", + }}) + require.NoError(t, err) + + cdc := codec.NewProtoCodec(interfaceRegistry) + bz, err := cdc.MarshalJSON(&anyPacker.any) + require.NoError(t, err) + require.Equal(t, + `{"@type":"/testdata.Msg/CreateDog","dog":{"size":"","name":"spot"}}`, + string(bz)) + + var any2 types.Any + err = cdc.UnmarshalJSON(bz, &any2) + require.NoError(t, err) + require.Equal(t, anyPacker.any, any2) +} From 9a038a5dc9ab0603ab246ad240377d5cea759c2b Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:21:42 -0400 Subject: [PATCH 31/51] Add comments --- codec/types/types_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codec/types/types_test.go b/codec/types/types_test.go index a000c6960f7d..c3327aeb78a3 100644 --- a/codec/types/types_test.go +++ b/codec/types/types_test.go @@ -162,6 +162,8 @@ func TestAny_ProtoJSON(t *testing.T) { require.Equal(t, spot, ha2.Animal.GetCachedValue()) } +// this instance of grpc.ClientConn is used to test packing service method +// requests into Any's type testAnyPackClient struct { any types.Any interfaceRegistry types.InterfaceRegistry @@ -175,6 +177,7 @@ func (t *testAnyPackClient) Invoke(_ context.Context, method string, args, _ int return fmt.Errorf("can't proto marshal %T", args) } + // registry the method request type with the interface registry t.interfaceRegistry.RegisterServiceRequestType((*interface{})(nil), method, reqMsg) bz, err := proto.Marshal(reqMsg) @@ -201,6 +204,7 @@ func TestAny_ServiceRequestProtoJSON(t *testing.T) { }}) require.NoError(t, err) + // marshal JSON cdc := codec.NewProtoCodec(interfaceRegistry) bz, err := cdc.MarshalJSON(&anyPacker.any) require.NoError(t, err) @@ -208,6 +212,7 @@ func TestAny_ServiceRequestProtoJSON(t *testing.T) { `{"@type":"/testdata.Msg/CreateDog","dog":{"size":"","name":"spot"}}`, string(bz)) + // unmarshal JSON var any2 types.Any err = cdc.UnmarshalJSON(bz, &any2) require.NoError(t, err) From 8c56444c4506f328f5748256c2aed6201ff57e9a Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:22:30 -0400 Subject: [PATCH 32/51] Tidying --- codec/types/types_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/codec/types/types_test.go b/codec/types/types_test.go index c3327aeb78a3..2c0405df2522 100644 --- a/codec/types/types_test.go +++ b/codec/types/types_test.go @@ -7,17 +7,14 @@ import ( "testing" "github.com/gogo/protobuf/grpc" + "github.com/gogo/protobuf/jsonpb" "github.com/gogo/protobuf/proto" grpc2 "google.golang.org/grpc" - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/gogo/protobuf/jsonpb" - - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" ) From aa3192f623e759605ba13eda8e78b60128be1994 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:29:45 -0400 Subject: [PATCH 33/51] Lint --- codec/types/interface_registry.go | 18 +++++++++--------- codec/unknownproto/unknown_fields.go | 16 +++++++++------- types/tx/types.go | 4 ++-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index c52e6253ec50..bf52dfc7d55f 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -116,8 +116,8 @@ func (registry *interfaceRegistry) RegisterInterface(protoName string, iface int func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, impls ...proto.Message) { for _, impl := range impls { - typeUrl := "/" + proto.MessageName(impl) - registry.registerImpl(iface, typeUrl, impl) + typeURL := "/" + proto.MessageName(impl) + registry.registerImpl(iface, typeURL, impl) } } @@ -125,7 +125,7 @@ func (registry *interfaceRegistry) RegisterServiceRequestType(iface interface{}, registry.registerImpl(iface, methodName, request) } -func (registry *interfaceRegistry) registerImpl(iface interface{}, typeUrl string, impl proto.Message) { +func (registry *interfaceRegistry) registerImpl(iface interface{}, typeURL string, impl proto.Message) { ityp := reflect.TypeOf(iface).Elem() imap, found := registry.interfaceImpls[ityp] if !found { @@ -137,8 +137,8 @@ func (registry *interfaceRegistry) registerImpl(iface interface{}, typeUrl strin panic(fmt.Errorf("type %T doesn't actually implement interface %+v", impl, ityp)) } - imap[typeUrl] = implType - registry.typeURLMap[typeUrl] = implType + imap[typeURL] = implType + registry.typeURLMap[typeURL] = implType registry.interfaceImpls[ityp] = imap } @@ -223,15 +223,15 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error return nil } -func (registry *interfaceRegistry) Resolve(typeUrl string) (proto.Message, error) { - typ, found := registry.typeURLMap[typeUrl] +func (registry *interfaceRegistry) Resolve(typeURL string) (proto.Message, error) { + typ, found := registry.typeURLMap[typeURL] if !found { - return nil, fmt.Errorf("unable to resolve type URL %s", typeUrl) + return nil, fmt.Errorf("unable to resolve type URL %s", typeURL) } msg, ok := reflect.New(typ.Elem()).Interface().(proto.Message) if !ok { - return nil, fmt.Errorf("can't resolve type URL %s", typeUrl) + return nil, fmt.Errorf("can't resolve type URL %s", typeURL) } return msg, nil diff --git a/codec/unknownproto/unknown_fields.go b/codec/unknownproto/unknown_fields.go index 194fc3e766a0..b2e7a0e0693b 100644 --- a/codec/unknownproto/unknown_fields.go +++ b/codec/unknownproto/unknown_fields.go @@ -137,12 +137,14 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals protoMessageName = any.TypeUrl fieldBytes = any.Value msg, err = resolver.Resolve(protoMessageName) + if err != nil { + return hasUnknownNonCriticals, err + } } else { msg, err = protoMessageForTypeName(protoMessageName[1:]) - } - - if err != nil { - return hasUnknownNonCriticals, err + if err != nil { + return hasUnknownNonCriticals, err + } } hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, msg, allowUnknownNonCriticals, resolver) @@ -418,9 +420,9 @@ type DefaultAnyResolver struct{} var _ jsonpb.AnyResolver = DefaultAnyResolver{} // Resolve is the AnyResolver.Resolve method. -func (d DefaultAnyResolver) Resolve(typeUrl string) (proto.Message, error) { - // Only the part of typeUrl after the last slash is relevant. - mname := typeUrl +func (d DefaultAnyResolver) Resolve(typeURL string) (proto.Message, error) { + // Only the part of typeURL after the last slash is relevant. + mname := typeURL if slash := strings.LastIndex(mname, "/"); slash >= 0 { mname = mname[slash+1:] } diff --git a/types/tx/types.go b/types/tx/types.go index f67841660580..e9066ef41b42 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -191,6 +191,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { // isServiceMsg checks if a type URL corresponds to a service method name, // i.e. /cosmos.bank.Msg/Send vs /cosmos.bank.MsgSend -func isServiceMsg(typeUrl string) bool { - return strings.Count(typeUrl, "/") >= 2 +func isServiceMsg(typeURL string) bool { + return strings.Count(typeURL, "/") >= 2 } From 55577f6b0e26a38fefc7c818ec444283d536e46b Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:33:26 -0400 Subject: [PATCH 34/51] Register MsgRequest interface --- types/codec.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/codec.go b/types/codec.go index 5d1bf40e4cf2..152bb9d724f5 100644 --- a/types/codec.go +++ b/types/codec.go @@ -14,4 +14,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces registers the sdk message type. func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterInterface("cosmos.base.v1beta1.Msg", (*Msg)(nil)) + // the interface name for MsgRequest is ServiceMsg because this is most useful for clients + // to understand - it will be the way for clients to introspect on available Msg service methods + registry.RegisterInterface("cosmos.base.v1beta1.ServiceMsg", (*MsgRequest)(nil)) } From 701f879a66d65347c596659785bc1ca9fd6eaa07 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:35:52 -0400 Subject: [PATCH 35/51] Rename --- baseapp/baseapp.go | 10 +++++----- ...ice_msg_router.go => msg_service_router.go} | 18 +++++++++--------- ...uter_test.go => msg_service_router_test.go} | 2 +- baseapp/options.go | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) rename baseapp/{service_msg_router.go => msg_service_router.go} (87%) rename baseapp/{service_msg_router_test.go => msg_service_router_test.go} (98%) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 18702922333a..10996bfb03c3 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -54,7 +54,7 @@ type BaseApp struct { // nolint: maligned router sdk.Router // handle any kind of message queryRouter sdk.QueryRouter // router for redirecting query calls grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls - serviceMsgRouter *ServiceMsgRouter // router for redirecting Msg service messages + msgServiceRouter *MsgServiceRouter // router for redirecting Msg service messages interfaceRegistry types.InterfaceRegistry txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx @@ -147,7 +147,7 @@ func NewBaseApp( router: NewRouter(), queryRouter: NewQueryRouter(), grpcQueryRouter: NewGRPCQueryRouter(), - serviceMsgRouter: NewServiceMsgRouter(), + msgServiceRouter: NewMsgServiceRouter(), txDecoder: txDecoder, fauxMerkleMode: false, } @@ -180,8 +180,8 @@ func (app *BaseApp) Logger() log.Logger { return app.logger } -// ServiceMsgRouter returns the ServiceMsgRouter of a BaseApp. -func (app *BaseApp) ServiceMsgRouter() *ServiceMsgRouter { return app.serviceMsgRouter } +// MsgServiceRouter returns the MsgServiceRouter of a BaseApp. +func (app *BaseApp) MsgServiceRouter() *MsgServiceRouter { return app.msgServiceRouter } // MountStores mounts all IAVL or DB stores to the provided keys in the BaseApp // multistore. @@ -696,7 +696,7 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s if svcMsg, ok := msg.(sdk.ServiceMsg); ok { msgType = svcMsg.MethodName - handler := app.serviceMsgRouter.Handler(msgType) + handler := app.msgServiceRouter.Handler(msgType) if handler == nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message service method: %s; message index: %d", msgType, i) } diff --git a/baseapp/service_msg_router.go b/baseapp/msg_service_router.go similarity index 87% rename from baseapp/service_msg_router.go rename to baseapp/msg_service_router.go index f8afa172f4cd..9f7c3ebe453c 100644 --- a/baseapp/service_msg_router.go +++ b/baseapp/msg_service_router.go @@ -13,17 +13,17 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// ServiceMsgRouter routes fully-qualified Msg service methods to their handler. -type ServiceMsgRouter struct { +// MsgServiceRouter routes fully-qualified Msg service methods to their handler. +type MsgServiceRouter struct { interfaceRegistry codectypes.InterfaceRegistry routes map[string]MsgServiceHandler } -var _ gogogrpc.Server = &ServiceMsgRouter{} +var _ gogogrpc.Server = &MsgServiceRouter{} -// NewServiceMsgRouter creates a new ServiceMsgRouter. -func NewServiceMsgRouter() *ServiceMsgRouter { - return &ServiceMsgRouter{ +// NewMsgServiceRouter creates a new MsgServiceRouter. +func NewMsgServiceRouter() *MsgServiceRouter { + return &MsgServiceRouter{ routes: map[string]MsgServiceHandler{}, } } @@ -33,7 +33,7 @@ type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, // Handler returns the MsgServiceHandler for a given query route path or nil // if not found. -func (msr *ServiceMsgRouter) Handler(methodName string) MsgServiceHandler { +func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { handler, found := msr.routes[methodName] if !found { return nil @@ -44,7 +44,7 @@ func (msr *ServiceMsgRouter) Handler(methodName string) MsgServiceHandler { // RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC // service description, handler is an object which implements that gRPC service. -func (msr *ServiceMsgRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { +func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { // adds a top-level query handler based on the gRPC service name for _, method := range sd.Methods { fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) @@ -93,6 +93,6 @@ func (msr *ServiceMsgRouter) RegisterService(sd *grpc.ServiceDesc, handler inter } // SetInterfaceRegistry sets the interface registry for the router. -func (msr *ServiceMsgRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) { +func (msr *MsgServiceRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) { msr.interfaceRegistry = interfaceRegistry } diff --git a/baseapp/service_msg_router_test.go b/baseapp/msg_service_router_test.go similarity index 98% rename from baseapp/service_msg_router_test.go rename to baseapp/msg_service_router_test.go index 5501dc56d758..f0f9be57b43f 100644 --- a/baseapp/service_msg_router_test.go +++ b/baseapp/msg_service_router_test.go @@ -27,7 +27,7 @@ func TestMsgService(t *testing.T) { app := baseapp.NewBaseApp("test", log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, encCfg.TxConfig.TxDecoder()) app.SetInterfaceRegistry(encCfg.InterfaceRegistry) testdata.RegisterMsgServer( - app.ServiceMsgRouter(), + app.MsgServiceRouter(), testdata.MsgServerImpl{}, ) _ = app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 1}}) diff --git a/baseapp/options.go b/baseapp/options.go index c5f0b91652d6..008af9a18535 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -227,5 +227,5 @@ func (app *BaseApp) SetSnapshotKeepRecent(snapshotKeepRecent uint32) { func (app *BaseApp) SetInterfaceRegistry(registry types.InterfaceRegistry) { app.interfaceRegistry = registry app.grpcQueryRouter.SetInterfaceRegistry(registry) - app.serviceMsgRouter.SetInterfaceRegistry(registry) + app.msgServiceRouter.SetInterfaceRegistry(registry) } From 84033e4ed87520304041aaf4c9c1264235b6beca Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 16:54:29 -0400 Subject: [PATCH 36/51] Fix tests --- testutil/testdata/codec.go | 10 +++++++++- x/auth/ante/testutil_test.go | 2 +- x/auth/tx/encode_decode_test.go | 5 ++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/testutil/testdata/codec.go b/testutil/testdata/codec.go index 8952ebbe07b6..5c17f6b3739d 100644 --- a/testutil/testdata/codec.go +++ b/testutil/testdata/codec.go @@ -3,11 +3,20 @@ package testdata import ( amino "github.com/tendermint/go-amino" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/codec/types" ) func NewTestInterfaceRegistry() types.InterfaceRegistry { registry := types.NewInterfaceRegistry() + RegisterInterfaces(registry) + return registry +} + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), &TestMsg{}) + registry.RegisterInterface("Animal", (*Animal)(nil)) registry.RegisterImplementations( (*Animal)(nil), @@ -22,7 +31,6 @@ func NewTestInterfaceRegistry() types.InterfaceRegistry { (*HasHasAnimalI)(nil), &HasHasAnimal{}, ) - return registry } func NewTestAmino() *amino.Codec { diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 63a2b308a53c..a6755d0c35af 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -56,7 +56,7 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { encodingConfig := simapp.MakeEncodingConfig() // We're using TestMsg encoding in some tests, so register it here. encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) - encodingConfig.InterfaceRegistry.RegisterImplementations((*sdk.Msg)(nil), &testdata.TestMsg{}) + testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) suite.clientCtx = client.Context{}. WithTxConfig(encodingConfig.TxConfig) diff --git a/x/auth/tx/encode_decode_test.go b/x/auth/tx/encode_decode_test.go index a509704ef4b3..55fff38c366f 100644 --- a/x/auth/tx/encode_decode_test.go +++ b/x/auth/tx/encode_decode_test.go @@ -15,7 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" ) func TestDefaultTxDecoderError(t *testing.T) { @@ -32,9 +31,9 @@ func TestDefaultTxDecoderError(t *testing.T) { require.NoError(t, err) _, err = decoder(txBz) - require.EqualError(t, err, "no registered implementations of type types.Msg: tx parse error") + require.EqualError(t, err, "unable to resolve type URL /testdata.TestMsg: tx parse error") - registry.RegisterImplementations((*sdk.Msg)(nil), &testdata.TestMsg{}) + testdata.RegisterInterfaces(registry) _, err = decoder(txBz) require.NoError(t, err) } From b30a5ebfa1e388c88d164d6f70731b7f1ad44d2b Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 12:16:10 +0200 Subject: [PATCH 37/51] RegisterCustomTypeURL --- baseapp/msg_service_router.go | 5 ++--- codec/types/interface_registry.go | 6 +++--- codec/types/types_test.go | 2 +- testutil/testdata/codec.go | 3 +-- x/auth/types/codec.go | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 9f7c3ebe453c..d46adebe4ba2 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -61,7 +61,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter // work correctly anyway panic(fmt.Errorf("can't register request type %T for service method %s", i, fqMethod)) } - msr.interfaceRegistry.RegisterServiceRequestType((*sdk.MsgRequest)(nil), fqMethod, msg) + msr.interfaceRegistry.RegisterCustomTypeURL((*sdk.MsgRequest)(nil), fqMethod, msg) return nil }, func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { return nil, nil @@ -70,8 +70,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter msr.routes[fqMethod] = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) - // call the method handler from the service description with the handler object, - // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data + // call the method handler from the service description with the handler object res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { // we don't do any decoding here because the decoding was already done return nil diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index bf52dfc7d55f..208bcaef83db 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -46,7 +46,7 @@ type InterfaceRegistry interface { // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) RegisterImplementations(iface interface{}, impls ...proto.Message) - // RegisterServiceRequestType allows a protobuf service method request type to be + // RegisterCustomTypeURL allows a protobuf service method request type to be // registered as the google.protobuf.Any value type for type URLs corresponding // to the fully qualified method name. iface should be an interface as type // as in RegisterInterface and RegisterImplementations. @@ -54,7 +54,7 @@ type InterfaceRegistry interface { // This will allow us to pack service methods in Any's using the full method name // as the type URL and the request body as the value, and allow us to unpack // such packed methods using the normal UnpackAny method for the interface iface. - RegisterServiceRequestType(iface interface{}, methodName string, request proto.Message) + RegisterCustomTypeURL(iface interface{}, methodName string, request proto.Message) // ListAllInterfaces list the type URLs of all registered interfaces. ListAllInterfaces() []string @@ -121,7 +121,7 @@ func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, im } } -func (registry *interfaceRegistry) RegisterServiceRequestType(iface interface{}, methodName string, request proto.Message) { +func (registry *interfaceRegistry) RegisterCustomTypeURL(iface interface{}, methodName string, request proto.Message) { registry.registerImpl(iface, methodName, request) } diff --git a/codec/types/types_test.go b/codec/types/types_test.go index 2c0405df2522..5e2a0f7f77ee 100644 --- a/codec/types/types_test.go +++ b/codec/types/types_test.go @@ -175,7 +175,7 @@ func (t *testAnyPackClient) Invoke(_ context.Context, method string, args, _ int } // registry the method request type with the interface registry - t.interfaceRegistry.RegisterServiceRequestType((*interface{})(nil), method, reqMsg) + t.interfaceRegistry.RegisterCustomTypeURL((*interface{})(nil), method, reqMsg) bz, err := proto.Marshal(reqMsg) if err != nil { diff --git a/testutil/testdata/codec.go b/testutil/testdata/codec.go index 5c17f6b3739d..54f63d03c2bc 100644 --- a/testutil/testdata/codec.go +++ b/testutil/testdata/codec.go @@ -3,9 +3,8 @@ package testdata import ( amino "github.com/tendermint/go-amino" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) func NewTestInterfaceRegistry() types.InterfaceRegistry { diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index beb14eab7ae7..629e2919d24d 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -30,7 +30,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { ) registry.RegisterInterface( - "cosmos.auth.GenesisAccount", + "cosmos.auth.v1beta1.GenesisAccount", (*GenesisAccount)(nil), &BaseAccount{}, &ModuleAccount{}, From 715d002155a2102dabec71db4a7f08a17b8abf52 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 12:29:21 +0200 Subject: [PATCH 38/51] Add changelog entries --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26ecaceffeb8..563c6e0c1765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/staking) [\#7499](https://github.com/cosmos/cosmos-sdk/pull/7499) `BondStatus` is now a protobuf `enum` instead of an `int32`, and JSON serialized using its protobuf name, so expect names like `BOND_STATUS_UNBONDING` as opposed to `Unbonding`. +### API Breaking + +* (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. +* (codec) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) `InterfaceRegistry` now inherits `jsonpb.AnyResolver`, and has a `RegisterCustomTypeURL` method to support ADR 031 packing of `Any`s. `AnyResolver` is now a required parameter to `RejectUnknownFields`. +* (baseapp) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) Add `ServiceMsgRouter` to BaseApp to handle routing of protobuf service `Msg`s. The two new types defined in ADR 031, `sdk.ServiceMsg` and `sdk.MsgRequest` are introduced with this router. + ### Bug Fixes * (kvstore) [\#7415](https://github.com/cosmos/cosmos-sdk/pull/7415) Allow new stores to be registered during on-chain upgrades. From 791097ae9d6a78ca413f7a50afe4e0e7f04a17f2 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 14:32:28 +0200 Subject: [PATCH 39/51] Put in features --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 563c6e0c1765..1e52621cc53f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking * (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. + +### Features + * (codec) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) `InterfaceRegistry` now inherits `jsonpb.AnyResolver`, and has a `RegisterCustomTypeURL` method to support ADR 031 packing of `Any`s. `AnyResolver` is now a required parameter to `RejectUnknownFields`. * (baseapp) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) Add `ServiceMsgRouter` to BaseApp to handle routing of protobuf service `Msg`s. The two new types defined in ADR 031, `sdk.ServiceMsg` and `sdk.MsgRequest` are introduced with this router. From 62a887f0a7514da49d55fc3688403b997e00d5c8 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:15:53 +0200 Subject: [PATCH 40/51] Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk --- baseapp/msg_service_router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index d46adebe4ba2..4c6aca29bac7 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -50,7 +50,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) methodHandler := method.Handler - // NOTE: this is how we pull the concrete request type for each handler for registering in the InterfaceRegistry. + // NOTE: This is how we pull the concrete request type for each handler for registering in the InterfaceRegistry. // This approach is maybe a bit hacky, but less hacky than reflecting on the handler object itself. // We use a no-op interceptor to avoid actually calling into the handler itself. _, _ = methodHandler(nil, context.Background(), func(i interface{}) error { From 98fa5d24ef23bf0748502463590d8cef718ef155 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:16:21 +0200 Subject: [PATCH 41/51] Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk --- baseapp/msg_service_router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 4c6aca29bac7..f2b250c6636f 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -56,7 +56,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter _, _ = methodHandler(nil, context.Background(), func(i interface{}) error { msg, ok := i.(proto.Message) if !ok { - // we panic here because there is no other alternative and the app cannot be initialized correctly + // We panic here because there is no other alternative and the app cannot be initialized correctly // this should only happen if there is a problem with code generation in which case the app won't // work correctly anyway panic(fmt.Errorf("can't register request type %T for service method %s", i, fqMethod)) From c63105df3753e1f07f0a4447cbc81830c59960b1 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:16:51 +0200 Subject: [PATCH 42/51] Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk --- baseapp/msg_service_router.go | 1 + 1 file changed, 1 insertion(+) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index f2b250c6636f..a308ce1f43ac 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -61,6 +61,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter // work correctly anyway panic(fmt.Errorf("can't register request type %T for service method %s", i, fqMethod)) } + msr.interfaceRegistry.RegisterCustomTypeURL((*sdk.MsgRequest)(nil), fqMethod, msg) return nil }, func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { From 2be1a61e63993c75dc145850db64e0c47ad01131 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:17:08 +0200 Subject: [PATCH 43/51] Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk --- baseapp/msg_service_router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index a308ce1f43ac..86d256749e2d 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -72,7 +72,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter ctx = ctx.WithEventManager(sdk.NewEventManager()) // call the method handler from the service description with the handler object - res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(i interface{}) error { + res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(_ interface{}) error { // we don't do any decoding here because the decoding was already done return nil }, func(goCtx context.Context, _ interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { From 105b04a6997e0926a9b4a823bd0c1e7a6f2c38c2 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:17:22 +0200 Subject: [PATCH 44/51] Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk --- baseapp/msg_service_router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 86d256749e2d..4b2b33235f27 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -75,7 +75,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(_ interface{}) error { // we don't do any decoding here because the decoding was already done return nil - }, func(goCtx context.Context, _ interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + }, func(goCtx context.Context, _ interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) return handler(goCtx, req) }) From c306dffb64ce5cd40ee78a056ea83b8340731a77 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:17:33 +0200 Subject: [PATCH 45/51] Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk --- baseapp/msg_service_router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 4b2b33235f27..0329a7ba9934 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -58,7 +58,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter if !ok { // We panic here because there is no other alternative and the app cannot be initialized correctly // this should only happen if there is a problem with code generation in which case the app won't - // work correctly anyway + // work correctly anyway. panic(fmt.Errorf("can't register request type %T for service method %s", i, fqMethod)) } From eaebd7ed4089e06f8761c3165131aae27144aa47 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:17:46 +0200 Subject: [PATCH 46/51] Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk --- baseapp/msg_service_router.go | 1 + 1 file changed, 1 insertion(+) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 0329a7ba9934..8b30a914a37d 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -87,6 +87,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter if !ok { return nil, fmt.Errorf("can't proto encode %T", resMsg) } + return sdk.WrapServiceResult(ctx, resMsg, err) } } From 7cbc9f95dee1355923ec1f322cacabd1841829a1 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:21:21 +0200 Subject: [PATCH 47/51] Address review comments --- baseapp/baseapp.go | 20 +++++++++++--------- baseapp/grpcrouter_helpers.go | 6 ++++-- baseapp/msg_service_router.go | 6 +++--- codec/types/interface_registry.go | 15 ++++++++------- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 10996bfb03c3..f215868654df 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -689,22 +689,24 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s break } - var msgEvents sdk.Events - var msgResult *sdk.Result - var err error - var msgType string + var ( + msgEvents sdk.Events + msgResult *sdk.Result + msgFqName string + err error + ) if svcMsg, ok := msg.(sdk.ServiceMsg); ok { - msgType = svcMsg.MethodName - handler := app.msgServiceRouter.Handler(msgType) + msgFqName = svcMsg.MethodName + handler := app.msgServiceRouter.Handler(msgFqName) if handler == nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message service method: %s; message index: %d", msgType, i) + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message service method: %s; message index: %d", msgFqName, i) } msgResult, err = handler(ctx, svcMsg.Request) } else { // legacy sdk.Msg routing msgRoute := msg.Route() - msgType = msg.Type() + msgFqName = msg.Type() handler := app.router.Route(ctx, msgRoute) if handler == nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message route: %s; message index: %d", msgRoute, i) @@ -718,7 +720,7 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s } msgEvents = sdk.Events{ - sdk.NewEvent(sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyAction, msgType)), + sdk.NewEvent(sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyAction, msgFqName)), } msgEvents = msgEvents.AppendEvents(msgResult.GetEvents()) diff --git a/baseapp/grpcrouter_helpers.go b/baseapp/grpcrouter_helpers.go index da8dd5b2415a..bd7d498e7aee 100644 --- a/baseapp/grpcrouter_helpers.go +++ b/baseapp/grpcrouter_helpers.go @@ -21,8 +21,10 @@ type QueryServiceTestHelper struct { ctx sdk.Context } -var _ gogogrpc.Server = &QueryServiceTestHelper{} -var _ gogogrpc.ClientConn = &QueryServiceTestHelper{} +var ( + _ gogogrpc.Server = &QueryServiceTestHelper{} + _ gogogrpc.ClientConn = &QueryServiceTestHelper{} +) // NewQueryServerTestHelper creates a new QueryServiceTestHelper that wraps // the provided sdk.Context diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 8b30a914a37d..678f104c1b5c 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -45,7 +45,7 @@ func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { // RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC // service description, handler is an object which implements that gRPC service. func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { - // adds a top-level query handler based on the gRPC service name + // Adds a top-level query handler based on the gRPC service name. for _, method := range sd.Methods { fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) methodHandler := method.Handler @@ -71,9 +71,9 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter msr.routes[fqMethod] = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) - // call the method handler from the service description with the handler object + // Call the method handler from the service description with the handler object. res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(_ interface{}) error { - // we don't do any decoding here because the decoding was already done + // We don't do any decoding here because the decoding was already done. return nil }, func(goCtx context.Context, _ interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index 208bcaef83db..4e21d0efd94f 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -46,15 +46,16 @@ type InterfaceRegistry interface { // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) RegisterImplementations(iface interface{}, impls ...proto.Message) - // RegisterCustomTypeURL allows a protobuf service method request type to be - // registered as the google.protobuf.Any value type for type URLs corresponding - // to the fully qualified method name. iface should be an interface as type - // as in RegisterInterface and RegisterImplementations. + // RegisterCustomTypeURL allows a protobuf message to be registered as a + // google.protobuf.Any with a custom typeURL (besides its own canonical + // typeURL). iface should be an interface as type as in RegisterInterface + // and RegisterImplementations. // + // Ex: // This will allow us to pack service methods in Any's using the full method name // as the type URL and the request body as the value, and allow us to unpack // such packed methods using the normal UnpackAny method for the interface iface. - RegisterCustomTypeURL(iface interface{}, methodName string, request proto.Message) + RegisterCustomTypeURL(iface interface{}, typeURL string, impl proto.Message) // ListAllInterfaces list the type URLs of all registered interfaces. ListAllInterfaces() []string @@ -121,8 +122,8 @@ func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, im } } -func (registry *interfaceRegistry) RegisterCustomTypeURL(iface interface{}, methodName string, request proto.Message) { - registry.registerImpl(iface, methodName, request) +func (registry *interfaceRegistry) RegisterCustomTypeURL(iface interface{}, typeURL string, impl proto.Message) { + registry.registerImpl(iface, typeURL, impl) } func (registry *interfaceRegistry) registerImpl(iface interface{}, typeURL string, impl proto.Message) { From 8624ad7f4dcc66483520db3c5b67c11cec5ba9f2 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:25:21 +0200 Subject: [PATCH 48/51] Address nit --- baseapp/msg_service_router.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 678f104c1b5c..95d415c5cacc 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -34,10 +34,7 @@ type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, // Handler returns the MsgServiceHandler for a given query route path or nil // if not found. func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { - handler, found := msr.routes[methodName] - if !found { - return nil - } + handler, _ := msr.routes[methodName] return handler } From 880c7cbdc11f0b9d7ee59017966900c66073dc79 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Oct 2020 15:43:01 +0200 Subject: [PATCH 49/51] Fix lint --- baseapp/msg_service_router.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 95d415c5cacc..efc108881bda 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -34,9 +34,7 @@ type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, // Handler returns the MsgServiceHandler for a given query route path or nil // if not found. func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { - handler, _ := msr.routes[methodName] - - return handler + return msr.routes[methodName] } // RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC From 304e9378732a81a0fe605410fed4c83f9c875ddb Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Thu, 15 Oct 2020 10:40:03 +0200 Subject: [PATCH 50/51] Update codec/types/interface_registry.go Co-authored-by: Marie Gauthier --- codec/types/interface_registry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index 4e21d0efd94f..acd0194a097d 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -48,7 +48,7 @@ type InterfaceRegistry interface { // RegisterCustomTypeURL allows a protobuf message to be registered as a // google.protobuf.Any with a custom typeURL (besides its own canonical - // typeURL). iface should be an interface as type as in RegisterInterface + // typeURL). iface should be an interface as type, as in RegisterInterface // and RegisterImplementations. // // Ex: From ca9258c97f690e8263ef805640d96ff97a7876c4 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Thu, 15 Oct 2020 10:44:53 +0200 Subject: [PATCH 51/51] godoc --- codec/types/interface_registry.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index acd0194a097d..966e935692b4 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -224,6 +224,9 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error return nil } +// Resolve returns the proto message given its typeURL. It works with types +// registered with RegisterInterface/RegisterImplementations, as well as those +// registered with RegisterWithCustomTypeURL. func (registry *interfaceRegistry) Resolve(typeURL string) (proto.Message, error) { typ, found := registry.typeURLMap[typeURL] if !found {